This commit is contained in:
leafwai
2022-03-03 11:46:00 +08:00
parent 05abf00994
commit 047dc9a7ae
220 changed files with 1407 additions and 390 deletions

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter.fragment;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.graphics.drawable.Animatable;
@ -11,6 +12,7 @@ import android.widget.CheckedTextView;
import android.widget.ImageView;
import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
@ -39,6 +41,7 @@ import com.gh.common.util.HomeBottomBarHelper;
import com.gh.common.util.ImageUtils;
import com.gh.common.util.IntegralLogHelper;
import com.gh.common.util.LogUtils;
import com.gh.common.util.NightModeUtils;
import com.gh.common.view.ReserveDialog;
import com.gh.common.view.WelcomeDialog;
import com.gh.gamecenter.R;
@ -172,6 +175,7 @@ public class MainWrapperFragment extends BaseFragment_ViewPager_Checkable implem
.placeholder(R.drawable.ic_game_unselect)
.into(mBinding.mainTabGameIcon);
}
mBinding.viewShadow.setVisibility(NightModeUtils.INSTANCE.isNightMode(requireContext()) ? View.GONE : View.VISIBLE);
mViewModel.getNavBar().observe(this, this::updateGameBarContent);
@ -299,8 +303,8 @@ public class MainWrapperFragment extends BaseFragment_ViewPager_Checkable implem
changeTabImageColor(R.color.text_A1A5B7, PorterDuff.Mode.SRC_ATOP);
changeTabTextColor(R.color.text_A1A5B7, false);
} else {
mBinding.viewShadow.setVisibility(View.VISIBLE);
mCheckableGroup.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.white));
mBinding.viewShadow.setVisibility(NightModeUtils.INSTANCE.isNightMode(requireContext()) ? View.GONE : View.VISIBLE);
mCheckableGroup.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white));
changeTabImageColor(R.color.text_50556B, PorterDuff.Mode.DST);
changeTabTextColor(R.color.tab_selector, true);
}
@ -543,4 +547,10 @@ public class MainWrapperFragment extends BaseFragment_ViewPager_Checkable implem
public int getChildCount() {
return 5;
}
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
changeColor(mViewPager.getCurrentItem());
}
}