From 4932fc2d7bfe30b19c498178192301a771cd96cf Mon Sep 17 00:00:00 2001 From: leafwai Date: Fri, 29 Apr 2022 18:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=A4=9C=E9=97=B4=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E5=88=87=E6=8D=A2=20https://git.shanqu.cc/halo/androi?= =?UTF-8?q?d/assistant-android/-/issues/65?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/base/BaseActivity_TabLayout.java | 21 ++- .../base/fragment/BaseFragment_TabLayout.java | 39 ++++-- .../gh/base/fragment/BaseLazyTabFragment.kt | 2 +- .../com/gh/common/view/ConfigFilterView.kt | 27 +++- .../java/com/gh/common/view/VerifyEditText.kt | 22 +++- .../java/com/gh/gamecenter/AboutActivity.java | 12 ++ .../gh/gamecenter/ConcernInfoActivity.java | 14 ++ .../gamecenter/DownloadManagerActivity.java | 13 ++ .../gh/gamecenter/HelpAndFeedbackActivity.kt | 7 + .../java/com/gh/gamecenter/InfoActivity.java | 15 +++ .../com/gh/gamecenter/MessageActivity.java | 12 ++ .../gh/gamecenter/MessageDetailActivity.java | 7 +- .../com/gh/gamecenter/NewsDetailActivity.java | 17 +++ .../java/com/gh/gamecenter/SettingActivity.kt | 36 ++++-- .../com/gh/gamecenter/SuggestionActivity.java | 79 +++++++++++- .../adapter/viewholder/CommentViewHolder.java | 2 +- .../gh/gamecenter/baselist/ListFragment.java | 18 ++- .../download/GameDownloadFragment.java | 8 ++ .../download/GameDownloadFragmentAdapter.java | 14 ++ .../download/NewInstalledGameFragment.kt | 20 ++- .../download/UpdatableGameAdapter.kt | 18 ++- .../download/UpdatableGameFragment.kt | 17 ++- .../gh/gamecenter/game/GameItemViewHolder.kt | 10 +- .../game/vertical/GameVerticalAdapter.kt | 11 +- .../gamedetail/GameDetailFragment.kt | 2 +- .../home/skip/PackageSkipActivity.kt | 7 +- .../home/skip/PackageSkipFragment.kt | 13 ++ .../gh/gamecenter/info/ConcernAdapter.java | 8 ++ .../gh/gamecenter/info/ConcernFragment.java | 31 ++++- .../com/gh/gamecenter/info/InfoAdapter.java | 12 ++ .../com/gh/gamecenter/info/InfoFragment.java | 1 + .../gh/gamecenter/info/OriginalAdapter.java | 13 ++ .../gh/gamecenter/info/OriginalFragment.java | 1 + .../gh/gamecenter/info/StrategyAdapter.java | 6 + .../info/StrategyDialogAdapter.java | 3 + .../gh/gamecenter/info/StrategyFragment.java | 32 ++++- .../message/KeFuFragmentAdapter.java | 9 ++ .../gh/gamecenter/message/MessageAdapter.java | 8 ++ .../message/MessageDetailFragment.java | 7 + .../message/MessageItemViewHolder.java | 10 ++ .../newsdetail/NewsDetailAdapter.java | 34 +++++ .../personal/DeliveryInfoActivity.kt | 6 + .../personal/DeliveryInfoFragment.kt | 14 ++ .../personal/NewPersonalFragment.kt | 7 + .../NewPersonalFunctionGroupAdapter.kt | 10 +- .../setting/GameDownloadSettingFragment.kt | 46 +++++++ .../setting/VideoSettingFragment.kt | 53 ++++++++ .../simulatorgame/SimulatorGameFragment.kt | 2 +- .../suggest/SuggestSelectFragment.java | 33 ++++- .../suggest/SuggestSelectGameAdapter.java | 4 + .../com/gh/gamecenter/tag/TagsActivity.kt | 8 +- .../com/gh/gamecenter/tag/TagsListFragment.kt | 38 +++--- .../gh/gamecenter/tag/TagsListViewModel.kt | 2 +- .../teenagermode/PasswordSettingFragment.kt | 15 +++ .../teenagermode/TeenagerModeActivity.kt | 7 + .../teenagermode/TeenagerModeFragment.kt | 18 ++- .../toolbox/ToolBoxBlockActivity.kt | 27 ++++ .../gamecenter/toolbox/ToolBoxBlockAdapter.kt | 5 + .../gamecenter/toolbox/ToolBoxItemAdapter.kt | 13 +- .../video/poster/PosterEditActivity.kt | 2 +- .../halo/assistant/fragment/AboutFragment.kt | 43 +++++++ .../assistant/fragment/SettingsFragment.kt | 120 ++++++++++++++++++ .../myconcern/MyConcernRecommendAdapter.java | 6 +- app/src/main/res/drawable/bg_tag_text.xml | 2 +- .../main/res/drawable/textview_white_dn.xml | 2 +- .../main/res/drawable/textview_white_up.xml | 2 +- .../res/layout/activity_help_and_feedback.xml | 3 +- .../main/res/layout/activity_news_detail.xml | 4 +- app/src/main/res/layout/activity_suggest.xml | 74 +++++++---- .../layout/activity_tablayout_viewpager.xml | 3 +- .../res/layout/activity_toolbox_block.xml | 3 +- app/src/main/res/layout/comment_head_item.xml | 2 +- app/src/main/res/layout/comment_item.xml | 2 +- .../layout/dialog_strategy_select_game.xml | 6 +- app/src/main/res/layout/downloadmanager.xml | 7 +- .../res/layout/downloadmanager_item_head.xml | 3 +- app/src/main/res/layout/fragment_about.xml | 14 +- .../res/layout/fragment_delivery_info.xml | 11 +- .../layout/fragment_game_download_setting.xml | 12 +- .../res/layout/fragment_game_updatable.xml | 2 +- .../main/res/layout/fragment_info_concern.xml | 3 +- .../res/layout/fragment_info_strategy.xml | 92 +++++++------- .../main/res/layout/fragment_package_skip.xml | 2 + .../res/layout/fragment_password_setting.xml | 2 +- app/src/main/res/layout/fragment_setting.xml | 52 ++++++-- .../res/layout/fragment_suggest_select.xml | 24 +++- .../layout/fragment_tablayout_viewpager.xml | 2 +- app/src/main/res/layout/fragment_tags.xml | 2 +- .../res/layout/fragment_teenager_mode.xml | 2 +- .../res/layout/fragment_video_setting.xml | 16 ++- .../res/layout/fragment_zixun_skeleton.xml | 2 +- .../main/res/layout/gamedetail_item_news.xml | 11 +- app/src/main/res/layout/item_filter_size.xml | 2 +- app/src/main/res/layout/item_toolbox.xml | 3 +- .../main/res/layout/layout_config_filter.xml | 2 +- .../main/res/layout/layout_filter_size.xml | 2 +- app/src/main/res/layout/message_item.xml | 4 +- app/src/main/res/layout/message_kefu_item.xml | 3 +- .../main/res/layout/news_detail_comment.xml | 2 +- app/src/main/res/layout/news_digest_item.xml | 2 +- .../main/res/layout/piece_setting_divider.xml | 1 + app/src/main/res/values-night/colors.xml | 6 +- 102 files changed, 1272 insertions(+), 234 deletions(-) diff --git a/app/src/main/java/com/gh/base/BaseActivity_TabLayout.java b/app/src/main/java/com/gh/base/BaseActivity_TabLayout.java index 49b1869bea..bc7a211b3f 100644 --- a/app/src/main/java/com/gh/base/BaseActivity_TabLayout.java +++ b/app/src/main/java/com/gh/base/BaseActivity_TabLayout.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.List; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; @@ -98,7 +99,7 @@ public abstract class BaseActivity_TabLayout extends ToolBarActivity implements String tabTitle = tab.getText() != null ? tab.getText().toString() : ""; View tabView = provideTabView(i, tabTitle); if (tabView == null) - tabView = BaseFragment_TabLayout.createDefaultTabCustomView(tabTitle); + tabView = BaseFragment_TabLayout.createDefaultTabCustomView(this, tabTitle); tab.setCustomView(tabView); } @@ -133,4 +134,22 @@ public abstract class BaseActivity_TabLayout extends ToolBarActivity implements public void onPageScrollStateChanged(int state) { } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + View container = findViewById(R.id.activity_tab_container); + if (container != null) { + container.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + for (int i = 0; i < mTabLayout.getTabCount(); i++) { + TabLayout.Tab tab = mTabLayout.getTabAt(i); + if (tab != null) { + BaseFragment_TabLayout.updateTabStyle(tab, tab.isSelected()); + } + } + } + if (mDividerLineView != null) { + mDividerLineView.setBackgroundColor(ContextCompat.getColor(this, R.color.divider)); + } + } } diff --git a/app/src/main/java/com/gh/base/fragment/BaseFragment_TabLayout.java b/app/src/main/java/com/gh/base/fragment/BaseFragment_TabLayout.java index 1e48f4fde7..13837b680a 100644 --- a/app/src/main/java/com/gh/base/fragment/BaseFragment_TabLayout.java +++ b/app/src/main/java/com/gh/base/fragment/BaseFragment_TabLayout.java @@ -1,5 +1,6 @@ package com.gh.base.fragment; +import android.content.Context; import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; @@ -8,6 +9,12 @@ import android.view.View; import android.widget.CheckedTextView; import android.widget.TextView; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; +import androidx.viewpager.widget.ViewPager; + import com.gh.base.adapter.FragmentAdapter; import com.gh.common.view.TabIndicatorView; import com.gh.gamecenter.R; @@ -20,11 +27,6 @@ import com.lightgame.view.NoScrollableViewPager; import java.util.ArrayList; import java.util.List; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.viewpager.widget.ViewPager; - /** * Created by khy on 15/03/18. */ @@ -119,7 +121,7 @@ public abstract class BaseFragment_TabLayout extends NormalFragment implements V if (tab == null) continue; String tabTitle = tab.getText() != null ? tab.getText().toString() : ""; View tabView = provideTabView(i, tabTitle); - if (tabView == null) tabView = createDefaultTabCustomView(tabTitle); + if (tabView == null) tabView = createDefaultTabCustomView(requireContext(), tabTitle); tab.setCustomView(tabView); } @@ -152,7 +154,7 @@ public abstract class BaseFragment_TabLayout extends NormalFragment implements V }); } - private static void updateTabStyle(TabLayout.Tab tab, boolean isChecked) { + public static void updateTabStyle(TabLayout.Tab tab, boolean isChecked) { View tabView = tab.getCustomView(); if (tabView == null) { Utils.log("TabLayout->Tab样式不是通用样式,请检查"); @@ -171,12 +173,13 @@ public abstract class BaseFragment_TabLayout extends NormalFragment implements V return; } tabTitle.setTypeface(isChecked ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT); + tabTitle.setTextColor(ContextCompat.getColorStateList(tabTitle.getContext(), R.color.text_tabbar_style)); } // 如果不设置View的话,无法动态设置字体样式 @NonNull - public static View createDefaultTabCustomView(String title) { - View view = LayoutInflater.from(HaloApp.getInstance().getApplication().getBaseContext()).inflate(R.layout.tab_item, null); + public static View createDefaultTabCustomView(Context context, String title) { + View view = LayoutInflater.from(context).inflate(R.layout.tab_item, null); View tabTitle = view.findViewById(R.id.tab_title); if (tabTitle instanceof CheckedTextView) { ((CheckedTextView) tabTitle).setText(title); @@ -198,4 +201,22 @@ public abstract class BaseFragment_TabLayout extends NormalFragment implements V public void onPageScrollStateChanged(int state) { } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + View container = requireView().findViewById(R.id.fragment_tab_container); + if (container != null) { + container.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); + for (int i = 0; i < mTabLayout.getTabCount(); i++) { + TabLayout.Tab tab = mTabLayout.getTabAt(i); + if (tab != null) { + updateTabStyle(tab, tab.isSelected()); + } + } + } + if (mDividerLineView != null) { + mDividerLineView.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.divider)); + } + } } diff --git a/app/src/main/java/com/gh/base/fragment/BaseLazyTabFragment.kt b/app/src/main/java/com/gh/base/fragment/BaseLazyTabFragment.kt index 36d6ebba2f..d6b3773ddc 100644 --- a/app/src/main/java/com/gh/base/fragment/BaseLazyTabFragment.kt +++ b/app/src/main/java/com/gh/base/fragment/BaseLazyTabFragment.kt @@ -93,7 +93,7 @@ abstract class BaseLazyTabFragment : BaseLazyFragment(), ViewPager.OnPageChangeL val tab = mTabLayout.getTabAt(i) ?: continue val tabTitle = if (tab.text != null) tab.text.toString() else "" var tabView = provideTabView(i, tabTitle) - if (tabView == null) tabView = BaseFragment_TabLayout.createDefaultTabCustomView(tabTitle) + if (tabView == null) tabView = BaseFragment_TabLayout.createDefaultTabCustomView(requireContext(), tabTitle) tab.customView = tabView } BaseFragment_TabLayout.initTabStyle(mTabLayout, mCheckedIndex) diff --git a/app/src/main/java/com/gh/common/view/ConfigFilterView.kt b/app/src/main/java/com/gh/common/view/ConfigFilterView.kt index 98bdef2e0c..759821b350 100644 --- a/app/src/main/java/com/gh/common/view/ConfigFilterView.kt +++ b/app/src/main/java/com/gh/common/view/ConfigFilterView.kt @@ -23,11 +23,13 @@ class ConfigFilterView @JvmOverloads constructor( ) : ConstraintLayout(context, attrs, defStyleAttr) { private var mSizeTv: TextView + private var mPopupWindow: PopupWindow? = null var newestTv: TextView var ratingTv: TextView //目前只在专题页面显示 var recommendedTv: TextView var updateTv: TextView //更新 + var container: View var sizeFilterArray: ArrayList? = null @@ -42,6 +44,7 @@ class ConfigFilterView @JvmOverloads constructor( ratingTv = findViewById(R.id.rating_tv) updateTv = findViewById(R.id.updateTv) recommendedTv = findViewById(R.id.recommended_tv) + container = findViewById(R.id.config_controller) mSelectionTvList = arrayListOf(newestTv, ratingTv, updateTv, recommendedTv) @@ -77,6 +80,16 @@ class ConfigFilterView @JvmOverloads constructor( } } + fun updateAllTextView(sortType: SortType) { + when (sortType) { + SortType.RECOMMENDED -> updateHighlightedTextView(recommendedTv) + SortType.NEWEST -> updateHighlightedTextView(newestTv) + SortType.RATING -> updateHighlightedTextView(ratingTv) + SortType.UPDATE -> updateHighlightedTextView(updateTv) + } + mSizeTv.setTextColor(R.color.text_757575.toColor(context)) + } + fun setOnConfigSetupListener(onConfigFilterSetupListener: OnConfigFilterSetupListener) { mOnConfigFilterSetupListener = onConfigFilterSetupListener } @@ -97,6 +110,13 @@ class ConfigFilterView @JvmOverloads constructor( } } + fun updatePopupWindow() { + if (mPopupWindow != null) { + mPopupWindow?.dismiss() + showSelectionPopupWindow(this, mSizeTv, mSizeTv.text.toString()) + } + } + private fun showSelectionPopupWindow(containerView: View, sizeTv: TextView, sizeText: String) { val drawableUp = ContextCompat.getDrawable(sizeTv.context, R.drawable.ic_filter_arrow_up) val drawableDown = @@ -104,7 +124,7 @@ class ConfigFilterView @JvmOverloads constructor( drawableUp?.setBounds(0, 0, drawableUp.minimumWidth, drawableUp.minimumHeight) drawableDown?.setBounds(0, 0, drawableDown.minimumWidth, drawableDown.minimumHeight) - sizeTv.setTextColor(R.color.theme_font.toColor()) + sizeTv.setTextColor(R.color.theme_font.toColor(sizeTv.context)) sizeTv.setCompoundDrawables(null, null, drawableUp, null) val inflater = LayoutInflater.from(sizeTv.context) @@ -113,7 +133,7 @@ class ConfigFilterView @JvmOverloads constructor( layout, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT - ) + ).apply { mPopupWindow = this } val flexboxLayout = layout.findViewById(R.id.flexbox) val backgroundView = layout.findViewById(R.id.background) @@ -163,8 +183,9 @@ class ConfigFilterView @JvmOverloads constructor( } popupWindow.setOnDismissListener { - sizeTv.setTextColor(R.color.text_757575.toColor()) + sizeTv.setTextColor(R.color.text_757575.toColor(sizeTv.context)) sizeTv.setCompoundDrawables(null, null, drawableDown, null) + mPopupWindow = null } popupWindow.isTouchable = true diff --git a/app/src/main/java/com/gh/common/view/VerifyEditText.kt b/app/src/main/java/com/gh/common/view/VerifyEditText.kt index 9e9c054a4c..d576f3eb4d 100644 --- a/app/src/main/java/com/gh/common/view/VerifyEditText.kt +++ b/app/src/main/java/com/gh/common/view/VerifyEditText.kt @@ -2,6 +2,7 @@ package com.gh.common.view import android.annotation.SuppressLint import android.content.Context +import android.graphics.Color import android.graphics.drawable.Drawable import android.text.* import android.text.InputFilter.LengthFilter @@ -14,6 +15,7 @@ import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.LinearLayout import android.widget.TextView +import androidx.annotation.ColorInt import androidx.core.content.ContextCompat import com.gh.gamecenter.R import java.util.* @@ -33,6 +35,7 @@ class VerifyEditText @JvmOverloads constructor( private var mEditText: EditText? = null private var drawableNormal: Drawable? = null private var drawableSelected: Drawable? = null + private var textColor: Int private var mContext: Context? = null @@ -58,6 +61,23 @@ class VerifyEditText @JvmOverloads constructor( if (drawable != null) textView.background = drawable } + fun setTextViewStyle(normal: Drawable?, selected: Drawable?, @ColorInt color: Int) { + drawableNormal = normal + drawableSelected = selected + textColor = color + var isFirst = true + for (i in mTextViewList.indices) { + val textView = mTextViewList[i] + if (textView.text.isNullOrEmpty() && isFirst) { + isFirst = false + setTextViewBackground(textView, drawableSelected) + } else { + setTextViewBackground(textView, drawableNormal) + } + textView.setTextColor(textColor) + } + } + /** * 获取当前输入的内容 * @@ -179,7 +199,7 @@ class VerifyEditText @JvmOverloads constructor( obtainStyledAttributes.getDrawable(R.styleable.verify_EditText_verify_background_normal) drawableSelected = obtainStyledAttributes.getDrawable(R.styleable.verify_EditText_verify_background_selected) - val textColor = obtainStyledAttributes.getColor( + textColor = obtainStyledAttributes.getColor( R.styleable.verify_EditText_verify_textColor, ContextCompat.getColor(context, R.color.black) ) diff --git a/app/src/main/java/com/gh/gamecenter/AboutActivity.java b/app/src/main/java/com/gh/gamecenter/AboutActivity.java index 463b1fd912..0ec63701f1 100644 --- a/app/src/main/java/com/gh/gamecenter/AboutActivity.java +++ b/app/src/main/java/com/gh/gamecenter/AboutActivity.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.os.Bundle; import androidx.annotation.NonNull; +import com.gh.common.util.DisplayUtils; import com.gh.common.util.EntranceUtils; import com.halo.assistant.fragment.AboutFragment; @@ -13,6 +14,12 @@ import com.halo.assistant.fragment.AboutFragment; */ public class AboutActivity extends NormalActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } + @NonNull public static Intent getIntent(Context context, boolean isUpdate) { Bundle bundle = new Bundle(); @@ -20,4 +27,9 @@ public class AboutActivity extends NormalActivity { return getTargetIntent(context, AboutActivity.class, AboutFragment.class, bundle); } + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } } diff --git a/app/src/main/java/com/gh/gamecenter/ConcernInfoActivity.java b/app/src/main/java/com/gh/gamecenter/ConcernInfoActivity.java index 9f9c0f0f30..21fb3995de 100644 --- a/app/src/main/java/com/gh/gamecenter/ConcernInfoActivity.java +++ b/app/src/main/java/com/gh/gamecenter/ConcernInfoActivity.java @@ -2,7 +2,9 @@ package com.gh.gamecenter; import android.content.Context; import android.content.Intent; +import android.os.Bundle; +import com.gh.common.util.DisplayUtils; import com.gh.gamecenter.info.ConcernFragment; /** @@ -11,7 +13,19 @@ import com.gh.gamecenter.info.ConcernFragment; public class ConcernInfoActivity extends NormalActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } + public static Intent getIntent(Context context) { return getTargetIntent(context, ConcernInfoActivity.class, ConcernFragment.class); } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } } diff --git a/app/src/main/java/com/gh/gamecenter/DownloadManagerActivity.java b/app/src/main/java/com/gh/gamecenter/DownloadManagerActivity.java index 9bb829ad64..f047e2bcc1 100644 --- a/app/src/main/java/com/gh/gamecenter/DownloadManagerActivity.java +++ b/app/src/main/java/com/gh/gamecenter/DownloadManagerActivity.java @@ -5,6 +5,7 @@ import android.content.Intent; import android.os.Bundle; import com.gh.base.fragment.BaseFragment_TabLayout; +import com.gh.common.util.DisplayUtils; import com.gh.common.util.EntranceUtils; import com.gh.gamecenter.download.DownloadFragment; @@ -20,6 +21,12 @@ public class DownloadManagerActivity extends NormalActivity { public static final String TAG = "DownloadManagerActivity"; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } + @Override protected Intent provideNormalIntent() { return getTargetIntent(this, DownloadManagerActivity.class, DownloadFragment.class); @@ -48,4 +55,10 @@ public class DownloadManagerActivity extends NormalActivity { bundle.putString(EntranceUtils.KEY_PACKAGENAME, packageName); return getTargetIntent(context, DownloadManagerActivity.class, DownloadFragment.class, bundle); } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/HelpAndFeedbackActivity.kt b/app/src/main/java/com/gh/gamecenter/HelpAndFeedbackActivity.kt index 7ba24d33a2..5ba6c7173c 100644 --- a/app/src/main/java/com/gh/gamecenter/HelpAndFeedbackActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/HelpAndFeedbackActivity.kt @@ -5,6 +5,7 @@ import android.content.Intent import android.os.Bundle import androidx.fragment.app.Fragment import com.gh.base.BaseActivity_TabLayout +import com.gh.common.util.DisplayUtils import com.gh.gamecenter.help.HelpContainerFragment import com.gh.gamecenter.suggest.SuggestSelectFragment import com.lightgame.utils.Util_System_Keyboard @@ -38,6 +39,7 @@ class HelpAndFeedbackActivity : BaseActivity_TabLayout() { setNavigationTitle("帮助与反馈") val defaultPosition = intent.getIntExtra(PAGE_INDEX, HELP_ITEM) setCurrentItem(defaultPosition) + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) } override fun onPageSelected(position: Int) { @@ -51,6 +53,11 @@ class HelpAndFeedbackActivity : BaseActivity_TabLayout() { mViewPager.currentItem = position } + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) + } + companion object { const val HELP_ITEM = 0 diff --git a/app/src/main/java/com/gh/gamecenter/InfoActivity.java b/app/src/main/java/com/gh/gamecenter/InfoActivity.java index 04ea08075f..a513e50d28 100644 --- a/app/src/main/java/com/gh/gamecenter/InfoActivity.java +++ b/app/src/main/java/com/gh/gamecenter/InfoActivity.java @@ -2,7 +2,9 @@ package com.gh.gamecenter; import android.content.Context; import android.content.Intent; +import android.os.Bundle; +import com.gh.common.util.DisplayUtils; import com.gh.gamecenter.info.InfoWrapperFragment; /** @@ -10,7 +12,20 @@ import com.gh.gamecenter.info.InfoWrapperFragment; */ public class InfoActivity extends NormalActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } + public static Intent getIntent(Context context) { return getTargetIntent(context, InfoActivity.class, InfoWrapperFragment.class); } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } } diff --git a/app/src/main/java/com/gh/gamecenter/MessageActivity.java b/app/src/main/java/com/gh/gamecenter/MessageActivity.java index c99dbf386f..de10d93897 100644 --- a/app/src/main/java/com/gh/gamecenter/MessageActivity.java +++ b/app/src/main/java/com/gh/gamecenter/MessageActivity.java @@ -4,6 +4,7 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; +import com.gh.common.util.DisplayUtils; import com.gh.common.util.EntranceUtils; import com.gh.gamecenter.message.MessageFragment; @@ -13,10 +14,21 @@ import com.gh.gamecenter.message.MessageFragment; @Deprecated public class MessageActivity extends NormalActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } + public static Intent getIntent(Context context, String entrance) { Bundle bundle = new Bundle(); bundle.putString(EntranceUtils.KEY_ENTRANCE, entrance); return getTargetIntent(context, MessageActivity.class, MessageFragment.class, bundle); } + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + } } diff --git a/app/src/main/java/com/gh/gamecenter/MessageDetailActivity.java b/app/src/main/java/com/gh/gamecenter/MessageDetailActivity.java index 81f971b427..ce81a3831e 100644 --- a/app/src/main/java/com/gh/gamecenter/MessageDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/MessageDetailActivity.java @@ -34,7 +34,7 @@ public class MessageDetailActivity extends NormalActivity { ViewGroup.LayoutParams layoutParams = mShadowView.getLayoutParams(); layoutParams.height = DisplayUtils.dip2px(50f) + DisplayUtils.getStatusBarHeight(getResources()); mShadowView.setLayoutParams(layoutParams); - DisplayUtils.setStatusBarColor(this, R.color.transparent, false); + DisplayUtils.setStatusBarColor(this, R.color.transparent, !mNightMode); } public View getShadowView() { @@ -71,4 +71,9 @@ public class MessageDetailActivity extends NormalActivity { return getTargetIntent(context, MessageDetailActivity.class, MessageDetailFragment.class, intent.getExtras()); } + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, R.color.transparent, !mNightMode); + } } diff --git a/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java b/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java index 401b4ed487..36055dbbbe 100644 --- a/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java +++ b/app/src/main/java/com/gh/gamecenter/NewsDetailActivity.java @@ -19,6 +19,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import androidx.core.view.MotionEventCompat; import androidx.recyclerview.widget.RecyclerView; @@ -64,6 +65,7 @@ import com.lightgame.utils.Utils; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import org.w3c.dom.Text; import java.util.HashMap; import java.util.HashSet; @@ -236,6 +238,7 @@ public class NewsDetailActivity extends ToolBarActivity implements OnClickListen @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); mDetailRv = findViewById(R.id.news_detail_rv_show); mDetailBottomLl = findViewById(R.id.news_detail_ll_bottom); @@ -740,4 +743,18 @@ public class NewsDetailActivity extends ToolBarActivity implements OnClickListen protected boolean showDownloadMenu() { return true; } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + if (mContentView != null) { + mContentView.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + findViewById(R.id.commentContainer).setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + ((TextView) findViewById(R.id.commentTv)).setTextColor(ContextCompat.getColor(this, R.color.text_subtitle)); + } + if (adapter != null) { + adapter.notifyItemRangeChanged(0, adapter.getItemCount()); + } + } } diff --git a/app/src/main/java/com/gh/gamecenter/SettingActivity.kt b/app/src/main/java/com/gh/gamecenter/SettingActivity.kt index 30e6d45baf..c9879cc4cf 100644 --- a/app/src/main/java/com/gh/gamecenter/SettingActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/SettingActivity.kt @@ -3,20 +3,32 @@ package com.gh.gamecenter import android.content.Context import android.content.Intent import android.os.Bundle +import com.gh.common.util.DisplayUtils import com.gh.common.util.EntranceUtils import com.halo.assistant.fragment.SettingsFragment class SettingActivity : NormalActivity() { - companion object { - fun getIntent(context: Context, isUpdate: Boolean, entrance: String): Intent { - return getTargetIntent( - context, - SettingActivity::class.java, - SettingsFragment::class.java, Bundle().apply { - putString(EntranceUtils.KEY_ENTRANCE, entrance) - putBoolean(EntranceUtils.KEY_VERSION_UPDATE, isUpdate) - } - ) - } - } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) + } + + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) + } + + companion object { + fun getIntent(context: Context, isUpdate: Boolean, entrance: String): Intent { + return getTargetIntent( + context, + SettingActivity::class.java, + SettingsFragment::class.java, Bundle().apply { + putString(EntranceUtils.KEY_ENTRANCE, entrance) + putBoolean(EntranceUtils.KEY_VERSION_UPDATE, isUpdate) + } + ) + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java b/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java index 47eaefcbad..9398f88f7b 100644 --- a/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java +++ b/app/src/main/java/com/gh/gamecenter/SuggestionActivity.java @@ -61,6 +61,7 @@ import com.gh.common.util.ToastUtils; import com.gh.common.util.UploadImageUtils; import com.gh.common.util.UrlFilterUtils; import com.gh.common.view.FixLinearLayoutManager; +import com.gh.gamecenter.databinding.ActivitySuggestBinding; import com.gh.gamecenter.entity.ErrorEntity; import com.gh.gamecenter.entity.GameEntity; import com.gh.gamecenter.entity.InstallGameEntity; @@ -325,7 +326,7 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); initView(); Bundle extras = getIntent().getExtras(); @@ -1505,4 +1506,80 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall } return super.handleBackPressed(); } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + DisplayUtils.setStatusBarColor(this, mNightMode ? R.color.black : R.color.white); + ActivitySuggestBinding binding = ActivitySuggestBinding.bind(mContentView); + binding.suggestScrollview.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider1.setBackgroundColor(ContextCompat.getColor(this, R.color.cutting_line)); + binding.divider2.setBackgroundColor(ContextCompat.getColor(this, R.color.cutting_line)); + binding.divider3.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider4.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider5.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider6.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider7.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider8.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.divider9.setBackgroundColor(ContextCompat.getColor(this, R.color.background)); + binding.suggestGameContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.suggestGameSelect.setBackground(ContextCompat.getDrawable(this, R.drawable.border_suggest_bg)); + binding.suggestPlatformContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.suggestTypeContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.picContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.suggestLinkContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.contactMethodContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.suggestPostLl.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.copyrightContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.suggestCrashTypeContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.explanationTv.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.explanationEt.setBackgroundColor(ContextCompat.getColor(this, R.color.background_white)); + binding.suggestGameNameTitle.setTextColor(ContextCompat.getColor(this, R.color.text_black)); + binding.suggestPlatformTitle.setTextColor(ContextCompat.getColor(this, R.color.text_black)); + binding.suggestTypeName.setTextColor(ContextCompat.getColor(this, R.color.text_black)); + binding.suggestLinkTitle.setTextColor(ContextCompat.getColor(this, R.color.text_black)); + binding.suggestEmailName.setTextColor(ContextCompat.getColor(this, R.color.text_black)); + binding.suggestGameSelect.setTextColor(ContextCompat.getColor(this, R.color.hint)); + binding.suggestGameName.setTextColor(ContextCompat.getColor(this, R.color.title)); + binding.suggestPlatformEt.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.suggestPlatformEt.setHintTextColor(ContextCompat.getColor(this, R.color.content)); + binding.tvAd.setTextColor(ContextCompat.getColor(this, R.color.theme_font)); + binding.typeAccelerate.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.typeStandalone.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.typeMaterial.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.typeOther.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.typeOtherName.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.typeOtherName.setHintTextColor(ContextCompat.getColor(this, R.color.content)); + binding.typeOtherName.setBackground(ContextCompat.getDrawable(this, R.drawable.border_suggest_bg)); + binding.suggestCrashTypeName.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.suggestAppCrash.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.suggestGameCrash.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.suggestContentEt.setHintTextColor(ContextCompat.getColor(this, R.color.content)); + binding.suggestLinkEt.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.suggestLinkEt.setHintTextColor(ContextCompat.getColor(this, R.color.content)); + binding.suggestEmailEt.setTextColor(ContextCompat.getColor(this, R.color.content)); + binding.suggestEmailEt.setHintTextColor(ContextCompat.getColor(this, R.color.content)); + binding.suggestIdentityTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.credentialsCodeTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.credentialsCodeEt.setTextColor(ContextCompat.getColor(this, R.color.text_subtitle)); + binding.credentialsCodeEt.setHintTextColor(ContextCompat.getColor(this, R.color.text_body)); + binding.credentialsPhotoTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.appNameTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.appNameEt.setTextColor(ContextCompat.getColor(this, R.color.text_subtitle)); + binding.appNameEt.setHintTextColor(ContextCompat.getColor(this, R.color.text_body)); + binding.infringementAppScreenshotTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.infringementAppScreenshotTipTv.setTextColor(ContextCompat.getColor(this, R.color.text_subtitleDesc)); + binding.explanationTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.explanationEt.setTextColor(ContextCompat.getColor(this, R.color.text_subtitle)); + binding.explanationEt.setHintTextColor(ContextCompat.getColor(this, R.color.text_body)); + binding.contactMethodTv.setTextColor(ContextCompat.getColor(this, R.color.text_title)); + binding.contactMethodEt.setTextColor(ContextCompat.getColor(this, R.color.text_subtitle)); + binding.contactMethodEt.setHintTextColor(ContextCompat.getColor(this, R.color.text_body)); + binding.emailFeedbackTv.setTextColor(ContextCompat.getColor(this, R.color.text_subtitleDesc)); + binding.lookDetailDesTv.setTextColor(ContextCompat.getColor(this, R.color.theme_font)); + binding.suggestPersonalRb.setBackground(ContextCompat.getDrawable(this, R.drawable.game_upload_rg_button_selector)); + binding.suggestCompanyRb.setBackground(ContextCompat.getDrawable(this, R.drawable.game_upload_rg_button_selector)); + binding.suggestPersonalRb.setTextColor(ContextCompat.getColorStateList(this, R.color.game_upload_rg_button_selector)); + binding.suggestCompanyRb.setTextColor(ContextCompat.getColorStateList(this, R.color.game_upload_rg_button_selector)); + } } diff --git a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/CommentViewHolder.java b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/CommentViewHolder.java index 7655882333..ec964b9a17 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/CommentViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/CommentViewHolder.java @@ -33,7 +33,7 @@ public class CommentViewHolder extends BaseRecyclerViewHolder { public TextView badgeNameTv; public SimpleDraweeView quoteAuthorBadgeSdv; public View commentMore; - public View commentReply; + public TextView commentReply; @Nullable public View replyLine; diff --git a/app/src/main/java/com/gh/gamecenter/baselist/ListFragment.java b/app/src/main/java/com/gh/gamecenter/baselist/ListFragment.java index 6b6a3c7509..4e9f1b0ca4 100644 --- a/app/src/main/java/com/gh/gamecenter/baselist/ListFragment.java +++ b/app/src/main/java/com/gh/gamecenter/baselist/ListFragment.java @@ -55,13 +55,16 @@ public abstract class ListFragment { if (holder instanceof GameDownloadViewHolder) { final GameDownloadViewHolder viewHolder = (GameDownloadViewHolder) holder; + viewHolder.binding.getRoot().setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + viewHolder.binding.dmItemTvStartorpause.setBackground(ContextCompat.getDrawable(mContext, R.drawable.game_item_btn_download_style)); + viewHolder.binding.dmItemProgressbar.setProgressDrawable(ContextCompat.getDrawable(mContext, R.drawable.progressbar_bg_style)); + + viewHolder.binding.dmItemTvTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_title)); + viewHolder.binding.dmItemTvDownloads.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc)); + viewHolder.binding.dmItemTvSpeed.setTextColor(ContextCompat.getColor(mContext, R.color.text_9a9a9a)); + final DownloadEntity downloadEntity; if (doneList.size() != 0 && position > 0 && position <= doneList.size()) { downloadEntity = doneList.get(position - 1); @@ -388,6 +396,12 @@ class GameDownloadFragmentAdapter extends BaseRecyclerAdapter { } else if (holder instanceof DownloadHeadViewHolder) { final DownloadHeadViewHolder viewHolder = (DownloadHeadViewHolder) holder; + + viewHolder.binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.background_white)); + viewHolder.binding.divider.setBackgroundColor(ContextCompat.getColor(mContext, R.color.background)); + viewHolder.binding.dmItemHeadTvTask.setTextColor(ContextCompat.getColor(mContext, R.color.text_6c6c6c)); + viewHolder.binding.dmItemHeadTvAllstart.setTextColor(ContextCompat.getColor(mContext, R.color.theme_font)); + if (position == 0 && doneList.size() != 0) { viewHolder.binding.dmItemHeadTvTask.setText("已完成"); viewHolder.binding.dmItemHeadTvAllstart.setVisibility(View.GONE); diff --git a/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt b/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt index f7eb57096d..edf49fda3e 100644 --- a/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragment.kt @@ -41,6 +41,7 @@ class NewInstalledGameFragment : NormalFragment() { private var mExposureListener: ExposureListener? = null private var mSkeleton: ViewSkeletonScreen? = null + private var mItemDecoration: VerticalItemDecoration? = null private var isEverpause = false @@ -101,13 +102,7 @@ class NewInstalledGameFragment : NormalFragment() { false mAdapter = NewInstalledGameFragmentAdapter(requireContext(), mInstallGameViewModel) mExposureListener = ExposureListener(this, mAdapter!!) - mBinding.fmInstallRvShow.addItemDecoration( - VerticalItemDecoration( - requireContext(), - 8F, - true - ) - ) + mBinding.fmInstallRvShow.addItemDecoration(VerticalItemDecoration(requireContext(), 8F, true).apply { mItemDecoration = this }) mBinding.fmInstallRvShow.addOnScrollListener(mExposureListener!!) mBinding.fmInstallRvShow.adapter = mAdapter @@ -192,4 +187,15 @@ class NewInstalledGameFragment : NormalFragment() { } } } + + override fun onNightModeChange() { + super.onNightModeChange() + mBinding.root.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.reuseNodataSkip.reuseNodataSkip.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) } + mBinding.fmInstallRvShow.run { + mItemDecoration?.let { removeItemDecoration(it) } + addItemDecoration(VerticalItemDecoration(requireContext(), 8F, true).apply { mItemDecoration = this }) + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt index ea1cd202f1..76f5e4dc8a 100644 --- a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameAdapter.kt @@ -82,6 +82,7 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) : val itemData = mItemList?.get(position)!! when (holder) { is UpdatableHeaderViewHolder -> { + val mContext = holder.binding.root.context itemData.let { holder.binding.updateAllBtn.enlargeTouchArea() holder.binding.updateAllBtn.goneIf(!itemData.miscShowUpdateAll) @@ -93,7 +94,7 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) : } holder.binding.infoTv.text = itemData.header ?: itemData.ignoredUpdateHeader if (itemData.header != null) { - holder.binding.infoTv.setTextColor(R.color.text_title.toColor()) + holder.binding.infoTv.setTextColor(R.color.text_title.toColor(mContext)) holder.binding.root.setOnClickListener(null) holder.binding.infoTv.setCompoundDrawablesWithIntrinsicBounds( null, @@ -102,7 +103,7 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) : null ) } else { - holder.binding.infoTv.setTextColor(R.color.text_subtitleDesc.toColor()) + holder.binding.infoTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext)) holder.binding.root.setOnClickListener { mViewModel.toggleIgnoredUpdateVisibility() } @@ -121,11 +122,11 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) : } is BlankDividerViewHolder -> { if (itemData.divider == UpdatableGameViewModel.GREY) { - holder.binding.container.setBackgroundColor(R.color.background.toColor()) + holder.binding.container.setBackgroundColor(R.color.background.toColor(holder.binding.root.context)) } else if (itemData.divider == UpdatableGameViewModel.BLUE) { - holder.binding.container.setBackgroundColor(R.color.bg_F2F7FC.toColor()) + holder.binding.container.setBackgroundColor(R.color.bg_F2F7FC.toColor(holder.binding.root.context)) } else { - holder.binding.container.setBackgroundColor(Color.WHITE) + holder.binding.container.setBackgroundColor(R.color.background_white.toColor(holder.binding.root.context)) } } is UpdatableGameViewHolder -> { @@ -139,6 +140,9 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) : val downloadManager = DownloadManager.getInstance() holder.binding.run { + nameTv.setTextColor(R.color.text_title.toColor(context)) + currentVersionTv.setTextColor(R.color.text_subtitleDesc.toColor(context)) + newVersionTv.setTextColor(R.color.text_subtitleDesc.toColor(context)) otherVersionHintIv.goneIf(itemData.normalUpdateWithArrow == null) container.setOnClickListener { @@ -151,9 +155,9 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) : } if (itemData.otherVersionUpdate != null) { - container.setBackgroundColor(R.color.bg_F2F7FC.toColor()) + container.setBackgroundColor(R.color.bg_F2F7FC.toColor(context)) } else { - container.setBackgroundColor(Color.WHITE) + container.setBackgroundColor(R.color.background_white.toColor(context)) } iconIv.displayGameIcon(update.rawIcon ?: update.icon, update.iconSubscript) diff --git a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt index ef8b727847..c9ebd9f653 100644 --- a/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/download/UpdatableGameFragment.kt @@ -3,10 +3,7 @@ package com.gh.gamecenter.download import android.view.View import com.gh.base.fragment.LazyFragment import com.gh.common.exposure.ExposureListener -import com.gh.common.util.EntranceUtils -import com.gh.common.util.goneIf -import com.gh.common.util.observeNonNull -import com.gh.common.util.viewModelProvider +import com.gh.common.util.* import com.gh.common.view.FixLinearLayoutManager import com.gh.gamecenter.MainActivity import com.gh.gamecenter.R @@ -23,7 +20,7 @@ class UpdatableGameFragment : LazyFragment() { private var mViewModel: UpdatableGameViewModel? = null private var mPackageViewModel: PackageViewModel? = null private var mBinding: FragmentGameUpdatableBinding? = null - private val mAdapter: UpdatableGameAdapter by lazy { UpdatableGameAdapter(mViewModel!!) } + private var mAdapter: UpdatableGameAdapter? = null override fun getRealLayoutId() = R.layout.fragment_game_updatable override fun onRealLayoutInflated(inflatedView: View) { @@ -44,7 +41,7 @@ class UpdatableGameFragment : LazyFragment() { mViewModel?.setUpdatableList(updatableList) } mViewModel?.updatableData?.observe(viewLifecycleOwner) { - mAdapter.submitList(it) + mAdapter?.submitList(it) mBinding?.noDataContainer?.root?.goneIf(!it.isNullOrEmpty()) } } @@ -58,8 +55,9 @@ class UpdatableGameFragment : LazyFragment() { noDataContainer.reuseNodataSkipTvBtn.setOnClickListener { MainActivity.skipToMainActivity(activity, MainWrapperFragment.INDEX_HOME) } + mAdapter = UpdatableGameAdapter(mViewModel!!) recyclerView.layoutManager = FixLinearLayoutManager(requireContext()) - recyclerView.adapter = mAdapter.also { + recyclerView.adapter = mAdapter?.also { recyclerView.addOnScrollListener(ExposureListener(this@UpdatableGameFragment, it)) } } @@ -80,4 +78,9 @@ class UpdatableGameFragment : LazyFragment() { } } + override fun onNightModeChange() { + super.onNightModeChange() + mBinding?.recyclerView?.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mAdapter?.let { it.notifyItemRangeChanged(0, it.itemCount) } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt b/app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt index f190fca939..89992c8d70 100644 --- a/app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt +++ b/app/src/main/java/com/gh/gamecenter/game/GameItemViewHolder.kt @@ -25,6 +25,14 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder< isShowPlatform: Boolean = false ) { binding.run { + root.background = R.drawable.reuse_listview_item_style.toDrawable(root.context) + gameKaifuType.setBackgroundColor(R.color.theme.toColor(root.context)) + gameName.setTextColor(R.color.text_title.toColor(root.context)) + gameDes.setTextColor(R.color.text_subtitleDesc.toColor(root.context)) + downloadSpeed.setTextColor(R.color.text_subtitleDesc.toColor(root.context)) + downloadPercentage.setTextColor(R.color.theme_font.toColor(root.context)) + recommendStarPref.setTextColor(R.color.text_subtitleDesc.toColor(root.context)) + gameIconView.displayGameIcon(entity) BindingAdapters.setGameName(gameName, entity, isShowPlatform, isShowSuffix) BindingAdapters.setTextSize(gameRating, if (entity.commentCount > 3) 12 else 10) @@ -34,7 +42,7 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder< gameRating.text = if (entity.commentCount > 3) { if (entity.star == 10.0F) "10" else entity.star.toString() } else "" - gameRating.setTextColor(if (entity.commentCount > 3) R.color.theme_font.toColor() else R.color.theme.toColor()) + gameRating.setTextColor(if (entity.commentCount > 3) R.color.theme_font.toColor(root.context) else R.color.theme.toColor(root.context)) gameDes.text = entity.decoratedDes recommendStar.rating = entity.recommendStar.toFloat() } diff --git a/app/src/main/java/com/gh/gamecenter/game/vertical/GameVerticalAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/vertical/GameVerticalAdapter.kt index 20489bff08..7781dfd835 100644 --- a/app/src/main/java/com/gh/gamecenter/game/vertical/GameVerticalAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/vertical/GameVerticalAdapter.kt @@ -65,6 +65,13 @@ class GameVerticalAdapter( (holder.itemView as AsyncGameItemUi).bindWhenInflated { holder.itemView.ui!!.run { + gameNameTv.setTextColor(R.color.text_title.toColor(mContext)) + serverTypeTv.setTextColor(R.color.theme.toColor(mContext)) + downloadTv.background = R.drawable.download_button_normal_style.toDrawable(mContext) + gameDesTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext)) + downloadSpeedTv.setTextColor(R.color.text_subtitleDesc.toColor(mContext)) + downloadPercentageTv.setTextColor(R.color.theme_font.toColor(mContext)) + BindingAdapters.setGameName( gameNameTv, gameEntity, @@ -78,7 +85,7 @@ class GameVerticalAdapter( var gameRatingPaddingEnd = 0 var gameRatingDrawableStart: Drawable? = null - var gameRatingTextColor = R.color.theme.toColor() + var gameRatingTextColor = R.color.theme.toColor(mContext) var gameRatingText = "" gameRatingTv.textSize = if (gameEntity.commentCount > 3) 12F else 10F @@ -86,7 +93,7 @@ class GameVerticalAdapter( if (gameEntity.commentCount > 3) { gameRatingPaddingEnd = 8F.dip2px() gameRatingDrawableStart = R.drawable.game_horizontal_rating.toDrawable() - gameRatingTextColor = R.color.theme_font.toColor() + gameRatingTextColor = R.color.theme_font.toColor(mContext) gameRatingText = if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString() } diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt index 75b3f4582f..85789a1478 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/GameDetailFragment.kt @@ -623,7 +623,7 @@ class GameDetailFragment : NormalFragment() { for (i in 0 until mBodyBinding.tabLayout.tabCount) { val tab = mBodyBinding.tabLayout.getTabAt(i) ?: continue val tabTitle = if (tab.text != null) tab.text.toString() else "" - tab.customView = BaseFragment_TabLayout.createDefaultTabCustomView(tabTitle) + tab.customView = BaseFragment_TabLayout.createDefaultTabCustomView(requireContext(), tabTitle) tab.view.setOnTouchListener { _, event -> if (event.action == MotionEvent.ACTION_DOWN) { handleTabTouchEvent(tabTitle) diff --git a/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipActivity.kt b/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipActivity.kt index 18f7fddc80..64b9aeea72 100644 --- a/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipActivity.kt @@ -18,7 +18,12 @@ class PackageSkipActivity : BaseActivity() { ?: PackageSkipFragment().with(intent.extras) // 若 placeholder 外层为 RelativeLayout 的话,会出现莫名的偏移 supportFragmentManager.beginTransaction().replace(R.id.placeholder, containerFragment, PackageSkipFragment::class.java.simpleName).commitAllowingStateLoss() - DisplayUtils.setStatusBarColor(this, R.color.transparent, true) + DisplayUtils.setStatusBarColor(this, R.color.transparent, !mNightMode) + } + + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, R.color.transparent, !mNightMode) } companion object { diff --git a/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipFragment.kt b/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipFragment.kt index 01ed9be1ef..9372a71836 100644 --- a/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipFragment.kt @@ -7,7 +7,9 @@ import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.LinearLayoutManager import com.gh.base.fragment.BaseFragment import com.gh.common.util.LogUtils +import com.gh.common.util.toColor import com.gh.download.DownloadManager +import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentPackageSkipBinding import com.gh.gamecenter.entity.GameEntity import com.gh.gamecenter.eventbus.EBDownloadStatus @@ -115,4 +117,15 @@ class PackageSkipFragment : BaseFragment() { } } } + + override fun onNightModeChange() { + super.onNightModeChange() + mBinding.root.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.normalTitle.setTextColor(R.color.text_title.toColor(requireContext())) + mBinding.tipTv1.setTextColor(R.color.text_subtitleDesc.toColor(requireContext())) + mBinding.tipTv2.setTextColor(R.color.text_title.toColor(requireContext())) + if (::mAdapter.isInitialized) { + mAdapter.notifyItemRangeChanged(0, mAdapter.itemCount) + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java b/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java index 94391250e3..965520fdf9 100644 --- a/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java @@ -6,6 +6,7 @@ import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView.ViewHolder; @@ -347,6 +348,13 @@ class ConcernAdapter extends BaseRecyclerAdapter { } private void initNewsDigestViewHolder(final NewsDigestViewHolder viewHolder, int position) { + viewHolder.binding.getRoot().setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + viewHolder.binding.newsDigestTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_black)); + viewHolder.binding.newsDigestTime.setTextColor(ContextCompat.getColor(mContext, R.color.hint)); + viewHolder.binding.newsDigestContent.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a)); + viewHolder.binding.newsDigestLibaoHint.setTextColor(ContextCompat.getColor(mContext, R.color.hint)); + viewHolder.binding.newsDigestReadNum.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc)); + viewHolder.binding.newsDigestCommentnum.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitleDesc)); final ConcernEntity concernEntity = concernList.get(position); viewHolder.setClickData(concernEntity); diff --git a/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java b/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java index c709bc12fa..d4b72300f3 100644 --- a/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/ConcernFragment.java @@ -23,6 +23,7 @@ import com.gh.common.filter.RegionSettingHelper; import com.gh.common.util.ApkActiveUtils; import com.gh.common.util.CheckLoginUtils; import com.gh.common.util.DataCollectionUtils; +import com.gh.common.util.DisplayUtils; import com.gh.common.util.MtaHelper; import com.gh.common.util.StringUtils; import com.gh.common.view.Concern_LinearLayout; @@ -75,6 +76,7 @@ public class ConcernFragment extends NormalFragment implements SwipeRefreshLayou private MyConcernRecommendAdapter mConcernRecommendAdapter; private LinearLayoutManager layoutManager; + private RecyclerView.ItemDecoration mItemDecoration; Runnable mRunnable = new Runnable() { @Override @@ -111,10 +113,8 @@ public class ConcernFragment extends NormalFragment implements SwipeRefreshLayou mBinding.news1RvList.setHasFixedSize(true); layoutManager = new LinearLayoutManager(getActivity()); mBinding.news1RvList.setLayoutManager(layoutManager); - Drawable insetDivider = ContextCompat.getDrawable(requireContext(), R.drawable.divider_item_line_space_16); - CustomDividerItemDecoration itemDecoration = new CustomDividerItemDecoration(requireContext(), false, false, true, false); - itemDecoration.setDrawable(insetDivider); - mBinding.news1RvList.addItemDecoration(itemDecoration); + + mBinding.news1RvList.addItemDecoration(getItemDecoration()); mAdapter = new ConcernAdapter(getContext(), this, this); mBinding.news1RvList.setAdapter(mAdapter); mBinding.news1RvList.addOnScrollListener(new RecyclerView.OnScrollListener() { @@ -146,6 +146,14 @@ public class ConcernFragment extends NormalFragment implements SwipeRefreshLayou }); } + public RecyclerView.ItemDecoration getItemDecoration() { + Drawable insetDivider = ContextCompat.getDrawable(requireContext(), R.drawable.divider_item_line_space_16); + CustomDividerItemDecoration itemDecoration = new CustomDividerItemDecoration(requireContext(), false, false, true, false); + itemDecoration.setDrawable(insetDivider); + mItemDecoration = itemDecoration; + return mItemDecoration; + } + @Override public void onMenuItemClick(MenuItem menuItem) { if (menuItem.getItemId() == R.id.menu_concern) { @@ -231,7 +239,7 @@ public class ConcernFragment extends NormalFragment implements SwipeRefreshLayou int size = mConcernRecommendAdapter.getItemCount(); mBinding.concernRvRecommend.setAdapter(mConcernRecommendAdapter); - mBinding.concernRvRecommend.setLayoutManager(new GridLayoutManager(getContext(), size > 4 ? 4 : size)); + mBinding.concernRvRecommend.setLayoutManager(new GridLayoutManager(getContext(), Math.min(size, 4))); mConcernRecommendAdapter.notifyDataSetChanged(); } @@ -242,7 +250,7 @@ public class ConcernFragment extends NormalFragment implements SwipeRefreshLayou int size = mConcernRecommendAdapter.getItemCount(); mBinding.concernRvRecommend.setAdapter(mConcernRecommendAdapter); - mBinding.concernRvRecommend.setLayoutManager(new GridLayoutManager(getContext(), size > 4 ? 4 : size)); + mBinding.concernRvRecommend.setLayoutManager(new GridLayoutManager(getContext(), Math.min(size, 4))); mConcernRecommendAdapter.notifyDataSetChanged(); } @@ -414,4 +422,15 @@ public class ConcernFragment extends NormalFragment implements SwipeRefreshLayou break; } } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + mAdapter.notifyItemRangeChanged(0, mAdapter.getItemCount()); + if (mConcernRecommendAdapter != null) mConcernRecommendAdapter.notifyItemRangeChanged(0, mConcernRecommendAdapter.getItemCount()); + mBinding.news1RvList.removeItemDecoration(mItemDecoration); + mBinding.news1RvList.addItemDecoration(getItemDecoration()); + mBinding.getRoot().setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); + mBinding.divider.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.divider)); + } } diff --git a/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java b/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java index 915690a23b..d2c97ccd1f 100644 --- a/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java @@ -7,6 +7,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.gh.base.OnListClickListener; @@ -104,6 +105,8 @@ class InfoAdapter extends ListAdapter { viewHolder.setClickData(newsEntity); ImageUtils.display(viewHolder.binding.newsImage1Thumb, newsEntity.getThumbnail().getUrl().get(0)); viewHolder.binding.newsImage1Title.setText(newsEntity.getTitle()); + viewHolder.binding.newsImage1Title.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); + int views = newsEntity.getViews(); if (views == 0) { viewHolder.binding.newsImage1Read.setVisibility(View.GONE); @@ -111,7 +114,9 @@ class InfoAdapter extends ListAdapter { viewHolder.binding.newsImage1Read.setVisibility(View.VISIBLE); viewHolder.binding.newsImage1Read.setText(String.format(Locale.getDefault(), "阅读 %s", NumberUtils.transSimpleCount(views))); } + viewHolder.binding.newsImage1Read.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.content)); NewsUtils.setNewsType(viewHolder.binding.newsImage1Type, newsEntity.getType(), newsEntity.getPriority(), position); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } private void initNewsImage2ViewHolder(final NewsImage2ViewHolder viewHolder, int position) { @@ -134,6 +139,7 @@ class InfoAdapter extends ListAdapter { viewHolder.binding.newsImage2Thumb3.setLayoutParams(lparams3); viewHolder.binding.newsImage2Title.setText(newsEntity.getTitle()); + viewHolder.binding.newsImage2Title.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); ImageUtils.display(viewHolder.binding.newsImage2Thumb1, newsEntity.getThumbnail().getUrl().get(0)); ImageUtils.display(viewHolder.binding.newsImage2Thumb2, newsEntity.getThumbnail().getUrl().get(1)); @@ -145,7 +151,9 @@ class InfoAdapter extends ListAdapter { viewHolder.binding.newsImage2Read.setVisibility(View.VISIBLE); viewHolder.binding.newsImage2Read.setText(String.format(Locale.getDefault(), "阅读 %s", NumberUtils.transSimpleCount(views))); } + viewHolder.binding.newsImage2Read.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.content)); NewsUtils.setNewsType(viewHolder.binding.newsImage2Type, newsEntity.getType(), newsEntity.getPriority(), position); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } private void initNewsImage3ViewHolder(final NewsImage3ViewHolder viewHolder, int position) { @@ -153,6 +161,8 @@ class InfoAdapter extends ListAdapter { final NewsEntity newsEntity = mEntityList.get(position); viewHolder.setClickData(newsEntity); viewHolder.binding.newsImage3Title.setText(newsEntity.getTitle()); + viewHolder.binding.newsImage3Title.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); + ImageUtils.display(viewHolder.binding.newsImage3Thumb, newsEntity.getThumbnail().getUrl().get(0), mContext.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(mContext, 40)); int views = newsEntity.getViews(); @@ -162,7 +172,9 @@ class InfoAdapter extends ListAdapter { viewHolder.binding.newsImage3Read.setVisibility(View.VISIBLE); viewHolder.binding.newsImage3Read.setText(String.format(Locale.getDefault(), "阅读 %s", NumberUtils.transSimpleCount(views))); } + viewHolder.binding.newsImage3Read.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.content)); NewsUtils.setNewsType(viewHolder.binding.newsImage3Type, newsEntity.getType(), newsEntity.getPriority(), position); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } diff --git a/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java b/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java index a56ca4f724..1fcf2db542 100644 --- a/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/InfoFragment.java @@ -77,6 +77,7 @@ public class InfoFragment extends ListFragment { Drawable insetDivider = ContextCompat.getDrawable(requireContext(), R.drawable.divider_item_line_space_16); CustomDividerItemDecoration itemDecoration = new CustomDividerItemDecoration(requireContext(), false, false, true, false); itemDecoration.setDrawable(insetDivider); + mItemDecoration = itemDecoration; return itemDecoration; } diff --git a/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java b/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java index 66e5e2a7ea..c185ad3248 100644 --- a/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java @@ -2,6 +2,7 @@ package com.gh.gamecenter.info; import android.content.Context; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import android.text.TextUtils; @@ -100,6 +101,8 @@ class OriginalAdapter extends ListAdapter { viewHolder.setClickData(newsEntity); ImageUtils.display(viewHolder.binding.newsImage1Thumb, newsEntity.getThumbnail().getUrl().get(0)); viewHolder.binding.newsImage1Title.setText(newsEntity.getTitle()); + viewHolder.binding.newsImage1Title.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); + int views = newsEntity.getViews(); if (views == 0) { viewHolder.binding.newsImage1Read.setVisibility(View.GONE); @@ -107,7 +110,9 @@ class OriginalAdapter extends ListAdapter { viewHolder.binding.newsImage1Read.setVisibility(View.VISIBLE); viewHolder.binding.newsImage1Read.setText(String.format(Locale.getDefault(), "阅读 %s", NumberUtils.transSimpleCount(views))); } + viewHolder.binding.newsImage1Read.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.content)); NewsUtils.setNewsType(viewHolder.binding.newsImage1Type, newsEntity.getType(), newsEntity.getPriority(), position); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } private void initNewsImage2ViewHolder(final NewsImage2ViewHolder viewHolder, int position) { @@ -116,6 +121,8 @@ class OriginalAdapter extends ListAdapter { viewHolder.setClickData(newsEntity); viewHolder.binding.newsImage2Title.setText(newsEntity.getTitle()); + viewHolder.binding.newsImage2Title.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); + ImageUtils.display(viewHolder.binding.newsImage2Thumb1, newsEntity.getThumbnail().getUrl().get(0)); ImageUtils.display(viewHolder.binding.newsImage2Thumb2, newsEntity.getThumbnail().getUrl().get(1)); ImageUtils.display(viewHolder.binding.newsImage2Thumb3, newsEntity.getThumbnail().getUrl().get(2)); @@ -126,7 +133,9 @@ class OriginalAdapter extends ListAdapter { viewHolder.binding.newsImage2Read.setVisibility(View.VISIBLE); viewHolder.binding.newsImage2Read.setText(String.format(Locale.getDefault(), "阅读 %s", NumberUtils.transSimpleCount(views))); } + viewHolder.binding.newsImage2Read.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.content)); NewsUtils.setNewsType(viewHolder.binding.newsImage2Type, newsEntity.getType(), newsEntity.getPriority(), position); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } private void initNewsImage3ViewHolder(final NewsImage3ViewHolder viewHolder, int position) { @@ -134,6 +143,8 @@ class OriginalAdapter extends ListAdapter { NewsEntity newsEntity = mEntityList.get(position); viewHolder.setClickData(newsEntity); viewHolder.binding.newsImage3Title.setText(newsEntity.getTitle()); + viewHolder.binding.newsImage3Title.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); + ImageUtils.display(viewHolder.binding.newsImage3Thumb, newsEntity.getThumbnail().getUrl().get(0), mContext.getResources().getDisplayMetrics().widthPixels - DisplayUtils.dip2px(mContext, 40)); int views = newsEntity.getViews(); @@ -143,7 +154,9 @@ class OriginalAdapter extends ListAdapter { viewHolder.binding.newsImage3Read.setVisibility(View.VISIBLE); viewHolder.binding.newsImage3Read.setText(String.format(Locale.getDefault(), "阅读 %s", NumberUtils.transSimpleCount(views))); } + viewHolder.binding.newsImage3Read.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.content)); NewsUtils.setNewsType(viewHolder.binding.newsImage3Type, newsEntity.getType(), newsEntity.getPriority(), position); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } public void statNewsViews(final NewsEntity newsEntity, final int position) { diff --git a/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java b/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java index 57a908c0b4..24e3d68790 100644 --- a/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java +++ b/app/src/main/java/com/gh/gamecenter/info/OriginalFragment.java @@ -58,6 +58,7 @@ public class OriginalFragment extends ListFragment { viewHolder.binding.newsTextType.setBackgroundResource(NewsUtils.getDrawableIdByType(newsEntity.getType())); viewHolder.binding.newsTextType.setText(newsEntity.getType()); viewHolder.binding.newsTextTitle.setText(newsEntity.getTitle()); + viewHolder.binding.newsTextTitle.setTextColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.title)); + viewHolder.binding.newsTextLine.setBackgroundColor(ContextCompat.getColor(viewHolder.itemView.getContext(), R.color.cutting_line)); + viewHolder.itemView.setBackground(ContextCompat.getDrawable(viewHolder.itemView.getContext(), R.drawable.reuse_listview_item_style)); } else { final NewsFooterViewHolder footerViewHolder = ((NewsFooterViewHolder) holder); + footerViewHolder.binding.newsFooterHint.setTextColor(ContextCompat.getColor(footerViewHolder.itemView.getContext(), R.color.content)); if (isRemove) { footerViewHolder.binding.newsFooterHint.setText(R.string.loading_complete); footerViewHolder.binding.newsFooterLoading.setVisibility(View.GONE); diff --git a/app/src/main/java/com/gh/gamecenter/info/StrategyDialogAdapter.java b/app/src/main/java/com/gh/gamecenter/info/StrategyDialogAdapter.java index bfbc7d7e39..e71a949d2c 100644 --- a/app/src/main/java/com/gh/gamecenter/info/StrategyDialogAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/StrategyDialogAdapter.java @@ -4,6 +4,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; +import androidx.core.content.ContextCompat; + import com.gh.common.util.DisplayUtils; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.StrategyDialogViewHolder; @@ -41,6 +43,7 @@ class StrategyDialogAdapter extends BaseRecyclerAdapter mConcernGame; @@ -149,9 +152,9 @@ public class StrategyFragment extends BaseFragment implements SwipeRefreshLayout public void OnSelectGameClickListener() { isShowPopupBg(true); - View contentView = View.inflate(getContext(), R.layout.dialog_strategy_select_game, null); - RecyclerView selectGameRv = contentView.findViewById(R.id.dialog_strategy_select_game_rv); - RelativeLayout allGameRl = contentView.findViewById(R.id.dialog_strategy_select_game_rl); + dialogContentView = View.inflate(getContext(), R.layout.dialog_strategy_select_game, null); + RecyclerView selectGameRv = dialogContentView.findViewById(R.id.dialog_strategy_select_game_rv); + RelativeLayout allGameRl = dialogContentView.findViewById(R.id.dialog_strategy_select_game_rl); if (mConcernGame.size() >= 8) { ViewGroup.LayoutParams params = selectGameRv.getLayoutParams(); @@ -170,17 +173,18 @@ public class StrategyFragment extends BaseFragment implements SwipeRefreshLayout }); selectGameRv.setLayoutManager(new LinearLayoutManager(getContext())); - selectGameRv.setAdapter(new StrategyDialogAdapter(StrategyFragment.this, mConcernGame)); + mStrategyDialogAdapter = new StrategyDialogAdapter(StrategyFragment.this, mConcernGame); + selectGameRv.setAdapter(mStrategyDialogAdapter); dialog = new Dialog(getContext()); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); - dialog.setContentView(contentView); + dialog.setContentView(dialogContentView); dialog.show(); - contentView.setOnClickListener(new View.OnClickListener() { + dialogContentView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { isShowPopupBg(false); @@ -283,4 +287,20 @@ public class StrategyFragment extends BaseFragment implements SwipeRefreshLayout NewsDetailActivity.startNewsDetailActivity(getContext(), newsEntity, StringUtils.buildString("(资讯:攻略[" + position + "])")); } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + mBinding.container.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); + mStrategyAdapter.notifyItemRangeChanged(0, mStrategyAdapter.getItemCount()); + if (dialog != null && dialogContentView != null && mStrategyDialogAdapter != null) { + DialogStrategySelectGameBinding binding = DialogStrategySelectGameBinding.bind(dialogContentView); + mStrategyDialogAdapter.notifyItemRangeChanged(0, mStrategyDialogAdapter.getItemCount()); + binding.dialogStrategySelectGameRv.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); + binding.dialogStrategySelectGameRl.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); + binding.desTv.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.cutting_line)); + binding.desTv.setTextColor(ContextCompat.getColor(requireContext(), R.color.title)); + binding.titleTv.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + } + } } diff --git a/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java index 43db012d54..0b4e52bd01 100644 --- a/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java @@ -10,6 +10,7 @@ import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.facebook.drawee.generic.GenericDraweeHierarchy; @@ -108,6 +109,14 @@ public class KeFuFragmentAdapter extends ListAdapter { } private void initKeFuViewHolder(KeFuViewHolder viewHolder, final MessageKeFuEntity keFuEntity) { + viewHolder.binding.messageKaifuItem.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + viewHolder.binding.messageKefuSuggestion.setBackgroundColor(ContextCompat.getColor(mContext, R.color.background)); + viewHolder.binding.messageKefuSuggestion.setTextColor(ContextCompat.getColor(mContext, R.color.title)); + viewHolder.binding.messageKefuName.setTextColor(ContextCompat.getColor(mContext, R.color.text_black)); + viewHolder.binding.messageKefuContent.setTextColor(ContextCompat.getColor(mContext, R.color.title)); + viewHolder.binding.messageKefuTime.setTextColor(ContextCompat.getColor(mContext, R.color.hint)); + viewHolder.binding.copyTv.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle)); + boolean shouldShouldUserId = keFuEntity.getShowUserId() != null && keFuEntity.getShowUserId(); List images = keFuEntity.getImages(); diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java b/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java index afd82aa638..f1cc7a564b 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java @@ -4,6 +4,7 @@ import android.content.Context; import android.view.View; import android.view.ViewGroup; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.gh.base.OnListClickListener; @@ -86,6 +87,13 @@ public class MessageAdapter extends ListAdapter { switch (getItemViewType(position)) { case ItemViewType.ITEM_HEADER: MessageTopViewHolder topViewHolder = (MessageTopViewHolder) holder; + topViewHolder.mBinding.messageInviteName.setTextColor(ContextCompat.getColor(mContext, R.color.text_title)); + topViewHolder.mBinding.messageVoteName.setTextColor(ContextCompat.getColor(mContext, R.color.text_title)); + topViewHolder.mBinding.messageServiceName.setTextColor(ContextCompat.getColor(mContext, R.color.text_title)); + topViewHolder.mBinding.messageVote.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + topViewHolder.mBinding.messageService.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + topViewHolder.mBinding.messageInvite.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + BindingAdapters.setMessageUnread(topViewHolder.mBinding.unreadVote, mUnreadEntity.getVoteCount()); BindingAdapters.showHide(topViewHolder.mBinding.unreadVote, mUnreadEntity.getVoteCount() != 0); diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java b/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java index 09abdae1d7..c36e778af0 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageDetailFragment.java @@ -530,4 +530,11 @@ public class MessageDetailFragment extends NormalFragment implements OnCommentCa return false; } + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + if (adapter != null) { + adapter.notifyItemRangeChanged(0, adapter.getItemCount()); + } + } } diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java b/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java index d6a7969a71..d3e511b905 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageItemViewHolder.java @@ -45,6 +45,7 @@ import java.util.ArrayList; import java.util.List; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentActivity; import io.reactivex.android.schedulers.AndroidSchedulers; @@ -72,6 +73,15 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder } public void setMessageItem(MessageEntity messageEntity, Context context, String entrance) { + mBinding.messageItem.setBackground(ContextCompat.getDrawable(mBinding.getRoot().getContext(), R.drawable.reuse_listview_item_style)); + mBinding.messageOriginal.setBackgroundColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.background)); + mBinding.messageUserName.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.text_black)); + mBinding.messageUserMore.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.theme_font)); + mBinding.messageCommand.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.title)); + mBinding.messageTime.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.hint)); + mBinding.messageContent.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.text_black)); + mBinding.messageOriginalTitle.setTextColor(ContextCompat.getColor(mBinding.getRoot().getContext(), R.color.title)); + setClickData(messageEntity); ImageUtils.display(mBinding.messageUserIcon, messageEntity.getUserEntity().getIcon()); if (messageEntity.getUserEntity().getAuth() != null) { diff --git a/app/src/main/java/com/gh/gamecenter/newsdetail/NewsDetailAdapter.java b/app/src/main/java/com/gh/gamecenter/newsdetail/NewsDetailAdapter.java index e39e7b37cb..223bb9ff5e 100644 --- a/app/src/main/java/com/gh/gamecenter/newsdetail/NewsDetailAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/newsdetail/NewsDetailAdapter.java @@ -221,6 +221,10 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter { } private void initNewsDetailContentViewHolder(NewsDetailContentViewHolder viewHolder) { + viewHolder.binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.background_white)); + viewHolder.binding.newsdetailItemTvTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_black)); + viewHolder.binding.newsdetailItemTvTime.setTextColor(ContextCompat.getColor(mContext, R.color.hint)); + viewHolder.binding.newsdetailItemTvAuthor.setTextColor(ContextCompat.getColor(mContext, R.color.hint)); viewHolder.binding.newsdetailItemTvTitle.setText(mNewsDetailEntity.getTitle()); if (mHideUselessInfo) { @@ -275,6 +279,13 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter { } private void initGameViewHolder(final NewsDetailGameViewHolder viewHolder) { + viewHolder.binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.background_white)); + viewHolder.binding.gameTvName.setTextColor(ContextCompat.getColor(mContext, R.color.text_black)); + viewHolder.binding.gameServerType.setTextColor(ContextCompat.getColor(mContext, R.color.text_white)); + viewHolder.binding.gameTvInfo.setTextColor(ContextCompat.getColor(mContext, R.color.hint)); + viewHolder.binding.gameTvConcern.setTextColor(ContextCompat.getColor(mContext, R.color.text_white)); + viewHolder.binding.gameTvConcern.setBackground(ContextCompat.getDrawable(mContext, R.drawable.textview_blue_style)); + BindingAdapters.setGame(viewHolder.binding.gameIvThumb, mGameEntity); viewHolder.binding.gameTvName.setText(mGameEntity.getName()); if (mGameEntity.getApk() != null && mGameEntity.getApk().size() != 0) { @@ -406,6 +417,25 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter { } private void initNewsDetailNewsViewHolder(GameDetailNewsViewHolder viewHolder) { + viewHolder.binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.background_white)); + viewHolder.binding.gamedetailItemLineNews1.setBackgroundColor(ContextCompat.getColor(mContext, R.color.cutting_line)); + viewHolder.binding.gamedetailItemLineNews2.setBackgroundColor(ContextCompat.getColor(mContext, R.color.cutting_line)); + viewHolder.binding.gamedetailItemLineNews3.setBackgroundColor(ContextCompat.getColor(mContext, R.color.cutting_line)); + viewHolder.binding.gamedetailItemNews1.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + viewHolder.binding.gamedetailItemNews2.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + viewHolder.binding.gamedetailItemNews3.setBackground(ContextCompat.getDrawable(mContext, R.drawable.reuse_listview_item_style)); + viewHolder.binding.gamedetailItemNewsType1.setBackground(ContextCompat.getDrawable(mContext, R.drawable.button_normal_border)); + viewHolder.binding.gamedetailItemNewsType2.setBackground(ContextCompat.getDrawable(mContext, R.drawable.button_normal_border)); + viewHolder.binding.gamedetailItemNewsType3.setBackground(ContextCompat.getDrawable(mContext, R.drawable.button_normal_border)); + viewHolder.binding.gamedetailItemNewsTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_black)); + viewHolder.binding.allTv.setTextColor(ContextCompat.getColor(mContext, R.color.theme_font)); + viewHolder.binding.gamedetailItemNewsType1.setTextColor(ContextCompat.getColor(mContext, R.color.text_white)); + viewHolder.binding.gamedetailItemNewsTitle1.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a)); + viewHolder.binding.gamedetailItemNewsType2.setTextColor(ContextCompat.getColor(mContext, R.color.text_white)); + viewHolder.binding.gamedetailItemNewsTitle2.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a)); + viewHolder.binding.gamedetailItemNewsType3.setTextColor(ContextCompat.getColor(mContext, R.color.text_white)); + viewHolder.binding.gamedetailItemNewsTitle3.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a)); + final List newsList = mNewsDetailEntity.getMore(); // 有点乱 先在这么做点击事件 @@ -459,6 +489,10 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter { } private void initNewsDetailNewsCommentViewHolder(final NewsDetailCommentListViewHolder holder) { + holder.binding.getRoot().setBackgroundColor(ContextCompat.getColor(mContext, R.color.background_white)); + holder.binding.newsdetailCommentLine.setBackgroundColor(ContextCompat.getColor(mContext, R.color.cutting_line)); + holder.binding.newsdetailCommentTitle.setTextColor(ContextCompat.getColor(mContext, R.color.text_3a3a3a)); + AtomicBoolean isChildLongClick = new AtomicBoolean(false); holder.binding.newsdetailCommentList.removeAllViews(); if (mIsHotComment) { diff --git a/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoActivity.kt b/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoActivity.kt index 00c26a55b9..da8d941f17 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoActivity.kt @@ -12,6 +12,12 @@ class DeliveryInfoActivity : NormalActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setNavigationTitle(R.string.delivery_info) + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) + } + + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) } companion object { diff --git a/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoFragment.kt b/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoFragment.kt index 9f7dc46c59..bc8a341e77 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/DeliveryInfoFragment.kt @@ -3,6 +3,7 @@ package com.gh.gamecenter.personal import android.os.Bundle import android.view.View import com.gh.common.util.DirectUtils +import com.gh.common.util.toColor import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentDeliveryInfoBinding import com.gh.gamecenter.normal.NormalFragment @@ -37,4 +38,17 @@ class DeliveryInfoFragment: NormalFragment() { R.id.withdrawContainer -> DirectUtils.directToWithdrawInfo(requireContext()) } } + + override fun onNightModeChange() { + super.onNightModeChange() + mBinding.divider.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.divider2.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.divider3.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.divider4.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.root.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mBinding.container.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mBinding.addressTv.setTextColor(R.color.text_title.toColor(requireContext())) + mBinding.prizeTv.setTextColor(R.color.text_title.toColor(requireContext())) + mBinding.withdrawTv.setTextColor(R.color.text_title.toColor(requireContext())) + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt b/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt index e000371927..51890afca2 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFragment.kt @@ -720,6 +720,13 @@ class NewPersonalFragment : BaseLazyFragment() { } } + override fun onNightModeChange() { + super.onNightModeChange() + if (::mStubBinding.isInitialized) { + mStubBinding.listRefresh.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mPersonalFuncGroupAdapter.notifyItemRangeChanged(0, mPersonalFuncGroupAdapter.itemCount) + } + } companion object { const val LOGIN_TAG = "login_tag" //登入标识 diff --git a/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFunctionGroupAdapter.kt b/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFunctionGroupAdapter.kt index 6f863fbdfd..890b3f6da9 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFunctionGroupAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/NewPersonalFunctionGroupAdapter.kt @@ -10,6 +10,8 @@ import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.RecyclerView import com.gh.common.constant.Constants import com.gh.common.util.SPUtils +import com.gh.common.util.dip2px +import com.gh.common.util.toColor import com.gh.common.view.GridSpacingItemColorDecoration import com.gh.gamecenter.R import com.gh.gamecenter.entity.FunctionalGroupEntity @@ -46,6 +48,12 @@ class NewPersonalFunctionGroupAdapter(val context: Context) : BaseRecyclerAdapte groupNameTv.text = groupEntity.name funcRv.apply { if (adapter != null) { + groupNameTv.setTextColor(R.color.text_title.toColor(holder.itemView.context)) + holder.itemView.setPadding(16F.dip2px(), 0, 16F.dip2px(), 32F.dip2px()) + for (i in 0 until itemDecorationCount) { + removeItemDecorationAt(i) + } + addItemDecoration(GridSpacingItemColorDecoration(context, 0, 32, R.color.background_white)) (adapter as PersonalFunctionAdapter).checkResetData(groupEntity) return } @@ -55,7 +63,7 @@ class NewPersonalFunctionGroupAdapter(val context: Context) : BaseRecyclerAdapte layoutManager = GridLayoutManager(context, 4) isNestedScrollingEnabled = false if (itemDecorationCount == 0) { - addItemDecoration(GridSpacingItemColorDecoration(context, 0, 32, R.color.white)) + addItemDecoration(GridSpacingItemColorDecoration(context, 0, 32, R.color.background_white)) } } } diff --git a/app/src/main/java/com/gh/gamecenter/setting/GameDownloadSettingFragment.kt b/app/src/main/java/com/gh/gamecenter/setting/GameDownloadSettingFragment.kt index bd32a43dde..59fa15918a 100644 --- a/app/src/main/java/com/gh/gamecenter/setting/GameDownloadSettingFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/setting/GameDownloadSettingFragment.kt @@ -12,6 +12,8 @@ import com.airbnb.lottie.LottieAnimationView import com.gh.common.util.MtaHelper.onEvent import com.gh.common.util.PackageUtils import com.gh.common.util.SPUtils +import com.gh.common.util.toColor +import com.gh.common.util.toDrawable import com.gh.gamecenter.BuildConfig import com.gh.gamecenter.CleanApkActivity import com.gh.gamecenter.R @@ -126,6 +128,50 @@ class GameDownloadSettingFragment: NormalFragment() { } } + override fun onNightModeChange() { + super.onNightModeChange() + mBinding?.run { + val background = R.drawable.reuse_listview_item_style.toDrawable(requireContext()) + val backgroundWhite = R.color.background_white.toColor(requireContext()) + val divider = R.color.divider.toColor(requireContext()) + val textTitle = R.color.text_title.toColor(requireContext()) + val textSubtitleDesc = R.color.text_subtitleDesc.toColor(requireContext()) + root.setBackgroundColor(R.color.background.toColor(requireContext())) + autoInstallItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + concernGameItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + trafficItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + downloadPathItem.run { + root.background = background + titleTv.setTextColor(textTitle) + contentTv.setTextColor(textSubtitleDesc) + } + picPathItem.run { + root.background = background + titleTv.setTextColor(textTitle) + contentTv.setTextColor(textSubtitleDesc) + } + cleanPackageItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + divider1.root.setBackgroundColor(backgroundWhite) + divider1.divider.setBackgroundColor(divider) + divider2.root.setBackgroundColor(backgroundWhite) + divider2.divider.setBackgroundColor(divider) + divider3.root.setBackgroundColor(backgroundWhite) + divider3.divider.setBackgroundColor(divider) + } + } + companion object { const val AUTO_INSTALL_SP_KEY = "autoinstall" const val CONCERN_GAME_SP_KEY = "concerngame" diff --git a/app/src/main/java/com/gh/gamecenter/setting/VideoSettingFragment.kt b/app/src/main/java/com/gh/gamecenter/setting/VideoSettingFragment.kt index dad2a94ef7..148977fe22 100644 --- a/app/src/main/java/com/gh/gamecenter/setting/VideoSettingFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/setting/VideoSettingFragment.kt @@ -5,6 +5,8 @@ import android.view.View import com.airbnb.lottie.LottieAnimationView import com.gh.common.constant.Constants import com.gh.common.util.SPUtils +import com.gh.common.util.toColor +import com.gh.common.util.toDrawable import com.gh.gamecenter.R import com.gh.gamecenter.databinding.FragmentVideoSettingBinding import com.gh.gamecenter.normal.NormalFragment @@ -159,6 +161,57 @@ class VideoSettingFragment: NormalFragment() { return status == SPUtils.getString(SP_HOME_OR_DETAIL_VIDEO_OPTION, VIDEO_OPTION_WIFI) ?: VIDEO_OPTION_WIFI } + override fun onNightModeChange() { + super.onNightModeChange() + val background = R.drawable.reuse_listview_item_style.toDrawable(requireContext()) + val backgroundWhite = R.color.background_white.toColor(requireContext()) + val divider = R.color.divider.toColor(requireContext()) + val textTitle = R.color.text_title.toColor(requireContext()) + val textSubtitleDesc = R.color.text_subtitleDesc.toColor(requireContext()) + mBinding?.root?.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding?.contentVideoTitle?.root?.setTextColor(textSubtitleDesc) + mBinding?.homeOrDetailVideoTitle?.root?.setTextColor(textSubtitleDesc) + mBinding?.run { + divider1.root.setBackgroundColor(backgroundWhite) + divider1.divider.setBackgroundColor(divider) + divider2.root.setBackgroundColor(backgroundWhite) + divider2.divider.setBackgroundColor(divider) + divider3.root.setBackgroundColor(backgroundWhite) + divider3.divider.setBackgroundColor(divider) + divider4.root.setBackgroundColor(backgroundWhite) + divider4.divider.setBackgroundColor(divider) + } + mBinding?.contentVideoOptionAllItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding?.contentVideoOptionWifiItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding?.contentVideoOptionCloseItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding?.homeOrDetailVideoOptionAllItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding?.homeOrDetailVideoOptionWifiItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding?.homeOrDetailVideoOptionCloseItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding?.muteItem?.run { + root.background = background + titleTv.setTextColor(textTitle) + tipsTv.setTextColor(textSubtitleDesc) + } + } + companion object { const val SP_CONTENT_VIDEO_OPTION = Constants.SP_CONTENT_VIDEO_OPTION const val SP_HOME_OR_DETAIL_VIDEO_OPTION = Constants.SP_HOME_OR_DETAIL_VIDEO_OPTION diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameFragment.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameFragment.kt index bd045a6d7c..e9abde2799 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameFragment.kt @@ -156,7 +156,7 @@ class SimulatorGameFragment : NormalFragment() { for (i in 0 until mBinding.fragmentTabLayout.tabCount) { val tab = mBinding.fragmentTabLayout.getTabAt(i) ?: continue val tabTitle = if (tab.text != null) tab.text.toString() else "" - val tabView = BaseFragment_TabLayout.createDefaultTabCustomView(tabTitle) + val tabView = BaseFragment_TabLayout.createDefaultTabCustomView(requireContext(), tabTitle) tab.customView = tabView } } diff --git a/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectFragment.java b/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectFragment.java index 39be11a70f..c85ad14c7b 100644 --- a/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectFragment.java +++ b/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectFragment.java @@ -5,6 +5,7 @@ import android.text.TextUtils; import android.view.View; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import com.gh.base.fragment.BaseFragment; import com.gh.common.constant.Config; @@ -12,7 +13,6 @@ import com.gh.common.util.DirectUtils; import com.gh.common.util.MtaHelper; import com.gh.common.util.ShareUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.SuggestionActivity; import com.gh.gamecenter.databinding.FragmentSuggestSelectBinding; import com.gh.gamecenter.entity.SettingsEntity; @@ -105,4 +105,35 @@ public class SuggestSelectFragment extends BaseFragment { DirectUtils.directToSuggestion(requireContext(), type, SUGGEST_TYPE_REQUEST); } + + @Override + protected void onNightModeChange() { + super.onNightModeChange(); + if (mBinding != null) { + mBinding.getRoot().setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background_white)); + mBinding.divider1.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.divider2.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.divider3.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.divider4.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.divider5.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.divider6.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.divider7.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.background)); + mBinding.suggestQunDesTv.setTextColor(ContextCompat.getColor(requireContext(), R.color.text_subtitleDesc)); + mBinding.suggestQqun.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv1.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv2.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv3.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv4.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv5.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv6.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestTitleTv7.setTextColor(ContextCompat.getColor(requireContext(), R.color.theme_font)); + mBinding.suggestDesTv1.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + mBinding.suggestDesTv2.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + mBinding.suggestDesTv3.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + mBinding.suggestDesTv4.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + mBinding.suggestDesTv5.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + mBinding.suggestDesTv6.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + mBinding.suggestDesTv7.setTextColor(ContextCompat.getColor(requireContext(), R.color.content)); + } + } } diff --git a/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectGameAdapter.java b/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectGameAdapter.java index cb55f5ae28..cbb281066c 100644 --- a/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectGameAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/suggest/SuggestSelectGameAdapter.java @@ -8,10 +8,13 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; +import androidx.core.content.ContextCompat; + import com.gh.base.OnRequestCallBackListener; import com.gh.base.fragment.BaseFragment; import com.gh.common.util.BitmapUtils; import com.gh.common.util.PackageUtils; +import com.gh.gamecenter.R; import com.gh.gamecenter.SuggestionActivity; import com.gh.gamecenter.databinding.DialogSelectGameItemBinding; import com.gh.gamecenter.entity.InstallGameEntity; @@ -110,6 +113,7 @@ public class SuggestSelectGameAdapter extends BaseRecyclerAdapter listener.loadDone(installGameEntity)); } diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsActivity.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsActivity.kt index fd94c3ae2e..a1c2a83990 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsActivity.kt @@ -4,8 +4,8 @@ import android.content.Context import android.content.Intent import android.os.Bundle import com.gh.base.BaseActivity +import com.gh.common.util.DisplayUtils import com.gh.common.util.EntranceUtils -import com.gh.download.DownloadManager import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.NormalActivity import com.gh.gamecenter.R @@ -39,6 +39,7 @@ class TagsActivity : NormalActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setToolbarMenu(R.menu.menu_download) + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) } override fun showDownloadMenu(): Boolean { @@ -49,6 +50,11 @@ class TagsActivity : NormalActivity() { return "游戏标签详情" } + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) + } + enum class From(val value: String) { GAME_DETAIL("game_detail"), diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt index 4305dec216..472987ff44 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListFragment.kt @@ -1,6 +1,5 @@ package com.gh.gamecenter.tag -import android.graphics.Color import android.os.Bundle import android.view.View import androidx.recyclerview.widget.LinearLayoutManager @@ -169,21 +168,6 @@ class TagsListFragment : ListFragment() { mListRv.visibility = View.GONE } - override fun onLoadDone() { - mCachedView?.setBackgroundColor(Color.TRANSPARENT) - super.onLoadDone() - } - - override fun onLoadEmpty() { - mCachedView?.setBackgroundColor(Color.TRANSPARENT) - super.onLoadEmpty() - } - - override fun onLoadError() { - mCachedView?.setBackgroundColor(Color.TRANSPARENT) - super.onLoadError() - } - override fun onRefresh() { mAdapter?.clearPositionAndPackageMap() super.onRefresh() @@ -217,4 +201,26 @@ class TagsListFragment : ListFragment() { } } } + + override fun onNightModeChange() { + super.onNightModeChange() + mSkeletonScreen = Skeleton.bind(mBinding.listSkeleton) + .shimmer(true) + .angle(Constants.SHIMMER_ANGLE) + .color(R.color.skeleton_shimmer_color) + .duration(Constants.SHIMMER_DURATION) + .maskWidth(Constants.MASK_WIDTH) + .gradientCenterColorWidth(Constants.GRADIENT_CENTER_COLOR_WIDTH) + .load(R.layout.fragment_tags_skeleton) + .show().apply { hide() } + mCachedView?.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mBinding.tagsRecyclerView.setBackgroundColor(R.color.background_white.toColor(requireContext())) + mBinding.tagsRecyclerView.adapter?.notifyDataSetChanged() + mBinding.divider.setBackgroundColor(R.color.background.toColor(requireContext())) + mBinding.configContainer.run { + container.setBackgroundColor(R.color.background_white.toColor(requireContext())) + updateAllTextView(mViewModel.mSortType) + updatePopupWindow() + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt index 96b7b917b5..3abaa099a1 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListViewModel.kt @@ -26,7 +26,7 @@ class TagsListViewModel(application: Application) : ListViewModel() - private var mSortType = ConfigFilterView.SortType.RECOMMENDED + var mSortType = ConfigFilterView.SortType.RECOMMENDED private var mSortSize = SubjectSettingEntity.Size() var selectedTag = TagEntity() diff --git a/app/src/main/java/com/gh/gamecenter/teenagermode/PasswordSettingFragment.kt b/app/src/main/java/com/gh/gamecenter/teenagermode/PasswordSettingFragment.kt index c7be31273a..98ea4953f7 100644 --- a/app/src/main/java/com/gh/gamecenter/teenagermode/PasswordSettingFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/teenagermode/PasswordSettingFragment.kt @@ -1,11 +1,13 @@ package com.gh.gamecenter.teenagermode +import android.graphics.Color import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider import com.gh.common.constant.Constants import com.gh.common.util.SPUtils import com.gh.common.util.toColor +import com.gh.common.util.toDrawable import com.gh.common.view.VerifyEditText import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.MainActivity @@ -31,6 +33,7 @@ class PasswordSettingFragment : NormalFragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) mViewModel = ViewModelProvider(this).get(TeenagerModeViewModel::class.java) + mBinding?.include?.normalToolbar?.setBackgroundColor(Color.TRANSPARENT) mBinding?.resetPwdTv?.setOnClickListener { startActivity(WebActivity.getWebIntent(requireContext(), "找回密码", Constants.TEEN_MODE_RESET_PASSWORD)) } @@ -192,4 +195,16 @@ class PasswordSettingFragment : NormalFragment() { }) requireActivity().finish() } + + override fun onNightModeChange() { + super.onNightModeChange() + mBinding?.run { + root.setBackgroundColor(R.color.background_white.toColor(requireContext())) + titleTv.setTextColor(R.color.text_title.toColor(requireContext())) + hintTv.setTextColor(R.color.text_subtitle.toColor(requireContext())) + resetPwdTv.setTextColor(R.color.theme_font.toColor(requireContext())) + nextTv.background = R.drawable.download_button_normal_style.toDrawable(requireContext()) + verifyEt.setTextViewStyle(R.drawable.bg_verify_password.toDrawable(requireContext()), R.drawable.bg_verify_password_select.toDrawable(requireContext()), R.color.text_title.toColor(requireContext())) + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeActivity.kt b/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeActivity.kt index 55d66d6c8f..b5f6a6d74e 100644 --- a/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeActivity.kt @@ -5,6 +5,7 @@ import android.content.Intent import android.os.Bundle import androidx.fragment.app.Fragment import com.gh.base.BaseActivity +import com.gh.common.util.DisplayUtils import com.gh.gamecenter.R class TeenagerModeActivity : BaseActivity() { @@ -15,6 +16,7 @@ class TeenagerModeActivity : BaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + DisplayUtils.setStatusBarColor(this, R.color.transparent, !mNightMode) mContainerFragment = supportFragmentManager.findFragmentByTag(TeenagerModeFragment::class.java.simpleName) ?: TeenagerModeFragment().with(intent.extras) if (mContainerFragment?.isAdded == false) { @@ -24,6 +26,11 @@ class TeenagerModeActivity : BaseActivity() { override fun preventRecreateFragmentByFragmentManager(): Boolean = true + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, R.color.transparent, !mNightMode) + } + companion object { const val TYPE = "type" diff --git a/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeFragment.kt b/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeFragment.kt index 681f6a661d..f2e7e0b062 100644 --- a/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/teenagermode/TeenagerModeFragment.kt @@ -1,12 +1,11 @@ package com.gh.gamecenter.teenagermode +import android.graphics.Color import android.os.Bundle import android.view.View import androidx.constraintlayout.widget.ConstraintLayout import com.gh.common.constant.Constants -import com.gh.common.util.SPUtils -import com.gh.common.util.SpanBuilder -import com.gh.common.util.dip2px +import com.gh.common.util.* import com.gh.common.view.CustomLinkMovementMethod import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity @@ -31,6 +30,7 @@ class TeenagerModeFragment : NormalFragment() { bundle.putString(TeenagerModeActivity.TYPE, TeenagerModeActivity.TYPE_ENABLE) showEnable() } + mBinding?.include?.normalToolbar?.setBackgroundColor(Color.TRANSPARENT) mBinding?.switchTv?.setOnClickListener { val mContainerFragment = requireActivity().supportFragmentManager.findFragmentByTag(PasswordSettingFragment::class.java.simpleName) ?: PasswordSettingFragment().with(bundle) @@ -73,4 +73,16 @@ class TeenagerModeFragment : NormalFragment() { } } } + + override fun onNightModeChange() { + super.onNightModeChange() + mBinding?.run { + root.setBackgroundColor(R.color.background_white.toColor(requireContext())) + titleTv.setTextColor(R.color.text_title.toColor(requireContext())) + desTv.setTextColor(R.color.text_title.toColor(requireContext())) + hintTv.setTextColor(R.color.text_subtitle.toColor(requireContext())) + changePwdTv.setTextColor(R.color.theme_font.toColor(requireContext())) + switchTv.background = R.drawable.download_button_normal_style.toDrawable(requireContext()) + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt index cc8a5d5743..a3d20ff08d 100644 --- a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockActivity.kt @@ -2,6 +2,7 @@ package com.gh.gamecenter.toolbox import android.content.Context import android.content.Intent +import android.os.Build import android.os.Bundle import android.view.KeyEvent import android.view.MotionEvent @@ -49,6 +50,7 @@ class ToolBoxBlockActivity : ToolBarActivity() { mSearchAdapter = ToolBoxItemAdapter(this, false) mLayoutManager = LinearLayoutManager(this@ToolBoxBlockActivity) setNavigationTitle("光环工具箱") + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) // 跳转到工具箱 https://gitlab.ghzs.com/pm/halo-app-issues/issues/636 val gameId = intent.getStringExtra(EntranceUtils.KEY_GAMEID) @@ -268,6 +270,31 @@ class ToolBoxBlockActivity : ToolBarActivity() { } } + override fun onNightModeChange() { + super.onNightModeChange() + DisplayUtils.setStatusBarColor(this, if (mNightMode) R.color.black else R.color.white) + mAdapter + if (::mBinding.isInitialized) { + mBinding.run { + toolboxRv.adapter?.run { notifyItemRangeChanged(0, itemCount) } + toolboxAppbar.setBackgroundColor(R.color.background.toColor(this@ToolBoxBlockActivity)) + toolboxRv.setBackgroundColor(R.color.background_white.toColor(this@ToolBoxBlockActivity)) + feedbackCv.setCardBackgroundColor(R.color.background_white.toColor(this@ToolBoxBlockActivity)) + feedbackTv.setTextColor(R.color.text_subtitleDesc.toColor(this@ToolBoxBlockActivity)) + reuseSearchBar.run { + root.setBackgroundColor(R.color.background_white.toColor(this@ToolBoxBlockActivity)) + searchBackground.background = R.drawable.actionbar_search_bg.toDrawable(this@ToolBoxBlockActivity) + tvSearch.setTextColor(R.color.theme_font.toColor(this@ToolBoxBlockActivity)) + etSearch.setTextColor(R.color.text_black.toColor(this@ToolBoxBlockActivity)) + etSearch.setHintTextColor(R.color.text_body.toColor(this@ToolBoxBlockActivity)) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + etSearch.textCursorDrawable = R.drawable.cursor_color.toDrawable(this@ToolBoxBlockActivity) + } + } + } + } + } + companion object { @JvmStatic fun getIntent(context: Context, entrance: String?): Intent { diff --git a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt index b56dc8b1a8..eff4bd977d 100644 --- a/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/toolbox/ToolBoxBlockAdapter.kt @@ -7,6 +7,8 @@ import androidx.recyclerview.widget.GridLayoutManager import com.gh.base.BaseRecyclerViewHolder import com.gh.common.util.goneIf import com.gh.common.util.safelyGetInRelease +import com.gh.common.util.toColor +import com.gh.gamecenter.R import com.gh.gamecenter.baselist.ListExecutor import com.gh.gamecenter.databinding.ToolboxBlockItemBinding import com.gh.gamecenter.entity.ToolBoxBlockEntity @@ -80,6 +82,9 @@ class ToolBoxBlockAdapter(context: Context) : BaseRecyclerAdapter(context) { private var mEntityList: List = arrayListOf() fun setDataList(dataList: List, isSearch: Boolean = false) { + if (mEntityList == dataList) { + notifyItemRangeChanged(0, itemCount) + return + } if (dataList.isEmpty() || isSearch) { mEntityList = dataList notifyDataSetChanged() @@ -78,6 +82,13 @@ class ToolBoxItemAdapter(context: Context, val isBlockInside: Boolean = false) : override fun getItemCount() = mEntityList.size private fun initToolBoxViewHolder(viewHolder: ToolBoxViewHolder, toolBoxEntity: ToolBoxEntity) { + viewHolder.binding.run { + container.setBackgroundColor(R.color.background_white.toColor(mContext)) + divider.setBackgroundColor(R.color.F2F2F2.toColor(mContext)) + toolboxItemTitle.setTextColor(R.color.text_title.toColor(mContext)) + toolboxItemDes.setTextColor(R.color.text_subtitleDesc.toColor(mContext)) + } + viewHolder.binding.toolboxItemDes.text = toolBoxEntity.des viewHolder.binding.toolboxItemTitle.text = toolBoxEntity.name display(viewHolder.binding.toolboxItemGameThumb, toolBoxEntity.icon) diff --git a/app/src/main/java/com/gh/gamecenter/video/poster/PosterEditActivity.kt b/app/src/main/java/com/gh/gamecenter/video/poster/PosterEditActivity.kt index e3059f8eba..2b77c53e9a 100644 --- a/app/src/main/java/com/gh/gamecenter/video/poster/PosterEditActivity.kt +++ b/app/src/main/java/com/gh/gamecenter/video/poster/PosterEditActivity.kt @@ -52,7 +52,7 @@ class PosterEditActivity : BaseActivity_TabLayout(), AdapterView.OnItemSelectedL } override fun provideTabView(position: Int, tabTitle: String?): View { - val tabCustomView = BaseFragment_TabLayout.createDefaultTabCustomView(tabTitle) + val tabCustomView = BaseFragment_TabLayout.createDefaultTabCustomView(this, tabTitle) tabCustomView.findViewById(R.id.tab_title).setTextColor(resources.getColorStateList(R.color.poster_text_tabbar_style)) return tabCustomView } diff --git a/app/src/main/java/com/halo/assistant/fragment/AboutFragment.kt b/app/src/main/java/com/halo/assistant/fragment/AboutFragment.kt index f43d9ef4c9..b1de690b38 100644 --- a/app/src/main/java/com/halo/assistant/fragment/AboutFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/AboutFragment.kt @@ -14,6 +14,7 @@ import com.gh.common.util.TimeUtils.getFormatTime import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity import com.gh.gamecenter.databinding.FragmentAboutBinding +import com.gh.gamecenter.databinding.PieceSettingDividerBinding import com.gh.gamecenter.manager.UpdateManager import com.gh.gamecenter.normal.NormalFragment import com.halo.assistant.HaloApp @@ -150,4 +151,46 @@ class AboutFragment : NormalFragment() { false } } + + private fun updateDivider(divider: PieceSettingDividerBinding) { + divider.root.setBackgroundColor(R.color.background_white.toColor(requireContext())) + divider.divider.setBackgroundColor(R.color.divider.toColor(requireContext())) + } + + override fun onNightModeChange() { + super.onNightModeChange() + val background = R.drawable.reuse_listview_item_style.toDrawable(requireContext()) + val textTitle = R.color.text_title.toColor(requireContext()) + val textSubtitleDesc = R.color.text_subtitleDesc.toColor(requireContext()) + + mBinding.run { + root.setBackgroundColor(R.color.background.toColor(requireContext())) + appNameTv.setTextColor(R.color.title.toColor(requireContext())) + ghCopyright.setTextColor(R.color.content.toColor(requireContext())) + copyrightTv.setTextColor(R.color.content.toColor(requireContext())) + updateDivider(divider1) + updateDivider(divider2) + updateDivider(divider3) + } + + mBinding.updateItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding.userProtocolItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.privacyPolicyItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.douyinItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + } } \ No newline at end of file diff --git a/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt b/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt index 8fbb4aefbc..167f8bd36d 100644 --- a/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/SettingsFragment.kt @@ -19,6 +19,7 @@ import com.gh.common.util.* import com.gh.download.server.BrowserInstallHelper import com.gh.gamecenter.* import com.gh.gamecenter.databinding.FragmentSettingBinding +import com.gh.gamecenter.databinding.PieceSettingDividerBinding import com.gh.gamecenter.entity.UserInfoEntity import com.gh.gamecenter.entity.WechatConfigEntity import com.gh.gamecenter.eventbus.EBReuse @@ -538,6 +539,125 @@ class SettingsFragment : NormalFragment() { return str + "M" } + private fun updateDivider(divider: PieceSettingDividerBinding) { + divider.root.setBackgroundColor(R.color.background_white.toColor(requireContext())) + divider.divider.setBackgroundColor(R.color.divider.toColor(requireContext())) + } + + override fun onNightModeChange() { + super.onNightModeChange() + mBinding.run { + root.setBackgroundColor(R.color.background.toColor(requireContext())) + updateDivider(divider1) + updateDivider(divider2) + updateDivider(divider3) + updateDivider(divider4) + updateDivider(divider5) + updateDivider(divider6) + updateDivider(divider7) + updateDivider(divider8) + updateDivider(divider9) + updateDivider(divider10) + updateDivider(divider11) + updateDivider(divider12) + updateDivider(divider13) + } + + val background = R.drawable.reuse_listview_item_style.toDrawable(requireContext()) + val textTitle = R.color.text_title.toColor(requireContext()) + val textSubtitleDesc = R.color.text_subtitleDesc.toColor(requireContext()) + + mBinding.securityItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.videoItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.gameDownloadItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.gameSubmissionItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.installMethodItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.usageStatsItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding.wechatRemindItem.run { + root.background = background + titleTv.setTextColor(textTitle) + textMoreTv.setTextColor(textSubtitleDesc) + } + mBinding.notificationAuthorityItem.run { + root.background = background + titleTv.setTextColor(textTitle) + tipsTv.setTextColor(textSubtitleDesc) + } + mBinding.personalRecommendItem.run { + root.background = background + titleTv.setTextColor(textTitle) + tipsTv.setTextColor(textSubtitleDesc) + } + mBinding.userProtocolItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding.privacyPolicyItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + + mBinding.infoListItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + + mBinding.sdkListItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + + mBinding.permissionAndUsageItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + + mBinding.childrenPolicyItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + + mBinding.aboutItem.run { + root.background = background + titleTv.setTextColor(textTitle) + contentTv.setTextColor(textSubtitleDesc) + } + mBinding.cacheItem.run { + root.background = background + titleTv.setTextColor(textTitle) + contentTv.setTextColor(textSubtitleDesc) + } + mBinding.networkDiagnosisItem.run { + root.background = background + titleTv.setTextColor(textTitle) + } + mBinding.settingLogout.background = background + mBinding.settingLogout.setTextColor(textTitle) + } + companion object { const val AUTO_INSTALL_SP_KEY = "autoinstall" const val CONCERN_GAME_SP_KEY = "concerngame" diff --git a/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernRecommendAdapter.java b/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernRecommendAdapter.java index 27fc1b9b79..ff1ce63082 100644 --- a/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernRecommendAdapter.java +++ b/app/src/main/java/com/halo/assistant/fragment/myconcern/MyConcernRecommendAdapter.java @@ -1,10 +1,10 @@ package com.halo.assistant.fragment.myconcern; import android.content.Context; -import android.graphics.Color; import android.view.ViewGroup; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import com.gh.base.OnRequestCallBackListener; import com.gh.common.constant.Config; @@ -173,7 +173,7 @@ public class MyConcernRecommendAdapter extends BaseRecyclerAdapter CheckLoginUtils.checkLogin(mContext, "我的关注-热门游戏推荐-[关注]", () -> { @@ -213,6 +213,8 @@ public class MyConcernRecommendAdapter extends BaseRecyclerAdapter \ No newline at end of file diff --git a/app/src/main/res/drawable/textview_white_dn.xml b/app/src/main/res/drawable/textview_white_dn.xml index 5ad1bf2160..3d5349d257 100644 --- a/app/src/main/res/drawable/textview_white_dn.xml +++ b/app/src/main/res/drawable/textview_white_dn.xml @@ -3,7 +3,7 @@ - + diff --git a/app/src/main/res/drawable/textview_white_up.xml b/app/src/main/res/drawable/textview_white_up.xml index e02b6c097d..5afb6afeaf 100644 --- a/app/src/main/res/drawable/textview_white_up.xml +++ b/app/src/main/res/drawable/textview_white_up.xml @@ -2,7 +2,7 @@ - + diff --git a/app/src/main/res/layout/activity_help_and_feedback.xml b/app/src/main/res/layout/activity_help_and_feedback.xml index c98a851533..0aa23b1076 100644 --- a/app/src/main/res/layout/activity_help_and_feedback.xml +++ b/app/src/main/res/layout/activity_help_and_feedback.xml @@ -11,9 +11,10 @@ android:id="@+id/activity_tab_container" android:layout_width="match_parent" android:layout_height="48dp" - android:background="@color/white"> + android:background="@color/background_white"> @@ -31,7 +32,7 @@ android:layout_width = "match_parent" android:layout_height = "50dp" android:layout_centerInParent = "true" - android:background = "@color/white" + android:background = "@color/background_white" android:gravity = "center_vertical" android:paddingRight = "20dp" android:visibility = "visible" > @@ -42,7 +43,7 @@ android:layout_height = "wrap_content" android:paddingLeft = "20dp" android:text = "游戏名字" - android:textColor = "@color/black" + android:textColor = "@color/text_black" android:textSize = "15sp" /> @@ -88,7 +89,7 @@ android:layout_height = "wrap_content" android:paddingLeft = "20dp" android:text = "游戏平台" - android:textColor = "@color/black" + android:textColor = "@color/text_black" android:textSize = "15sp" /> @@ -115,7 +116,7 @@ android:layout_width = "match_parent" android:layout_height = "wrap_content" android:layout_marginTop = "8dp" - android:background = "@color/white" + android:background = "@color/background_white" android:orientation = "vertical" android:paddingBottom = "15dp" android:visibility = "visible" > @@ -132,7 +133,7 @@ android:gravity = "center_vertical" android:paddingLeft = "20dp" android:text = "功能需求" - android:textColor = "@color/black" + android:textColor = "@color/text_black" android:textSize = "15sp" /> @@ -244,11 +246,12 @@ android:layout_width="match_parent" android:layout_height="54dp" android:layout_marginTop="8dp" - android:background="@color/white" + android:background="@color/background_white" android:gravity="center_vertical" android:orientation="horizontal"> @@ -364,7 +370,7 @@ android:layout_width = "match_parent" android:layout_height = "40dp" android:layout_marginTop = "8dp" - android:background = "@color/white" + android:background = "@color/background_white" android:gravity = "center_vertical" > @@ -400,7 +406,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:background="@color/white"> + android:background="@color/background_white"> + + + android:layout_marginRight="20dp" /> + + android:layout_height="8dp" /> + + android:layout_marginRight="20dp" /> @@ -586,6 +600,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + android:layout_height="8dp" /> + + android:layout_height="8dp" /> + + android:layout_height="8dp" /> - + diff --git a/app/src/main/res/layout/activity_tablayout_viewpager.xml b/app/src/main/res/layout/activity_tablayout_viewpager.xml index 76ae7633ab..eb11f791a3 100644 --- a/app/src/main/res/layout/activity_tablayout_viewpager.xml +++ b/app/src/main/res/layout/activity_tablayout_viewpager.xml @@ -10,8 +10,7 @@ + android:layout_height = "@dimen/tab_layout_height" > @@ -57,6 +57,7 @@ android:clickable="true" android:focusable="true" app:cardCornerRadius="8dp" + app:cardBackgroundColor="@color/background_white" app:cardElevation="12dp"> diff --git a/app/src/main/res/layout/comment_item.xml b/app/src/main/res/layout/comment_item.xml index 0d91f048b7..4fe01e75d7 100644 --- a/app/src/main/res/layout/comment_item.xml +++ b/app/src/main/res/layout/comment_item.xml @@ -130,7 +130,7 @@ android:background="@color/theme" android:gravity="center" android:text="置顶" - android:textColor="#fff" + android:textColor="@color/white" android:textSize="9sp" android:visibility="gone" app:layout_constrainedWidth="true" diff --git a/app/src/main/res/layout/dialog_strategy_select_game.xml b/app/src/main/res/layout/dialog_strategy_select_game.xml index 5b8967f244..1806391e99 100644 --- a/app/src/main/res/layout/dialog_strategy_select_game.xml +++ b/app/src/main/res/layout/dialog_strategy_select_game.xml @@ -8,9 +8,10 @@ android:id = "@+id/dialog_strategy_select_game_rl" android:layout_width = "match_parent" android:layout_height = "50dp" - android:background = "@color/white" > + android:background = "@color/background_white" > + android:background = "@color/background_white" /> \ No newline at end of file diff --git a/app/src/main/res/layout/downloadmanager.xml b/app/src/main/res/layout/downloadmanager.xml index b03c128d84..64d3e20d28 100644 --- a/app/src/main/res/layout/downloadmanager.xml +++ b/app/src/main/res/layout/downloadmanager.xml @@ -9,7 +9,7 @@ android:id="@+id/downloadmanager_rv_show" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/white" /> + android:background="@color/background_white" /> + android:background="@color/background_white"> diff --git a/app/src/main/res/layout/downloadmanager_item_head.xml b/app/src/main/res/layout/downloadmanager_item_head.xml index 17dfb90468..9ab48deb8c 100644 --- a/app/src/main/res/layout/downloadmanager_item_head.xml +++ b/app/src/main/res/layout/downloadmanager_item_head.xml @@ -2,10 +2,11 @@ diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index c82e3761b9..b285917cf9 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -18,6 +18,7 @@ android:src="@mipmap/logo_for_in_app_display" /> - + - + - + - + - + - + diff --git a/app/src/main/res/layout/fragment_info_concern.xml b/app/src/main/res/layout/fragment_info_concern.xml index 88716c36b2..bff0308fb7 100644 --- a/app/src/main/res/layout/fragment_info_concern.xml +++ b/app/src/main/res/layout/fragment_info_concern.xml @@ -3,10 +3,11 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/white" + android:background="@color/background_white" android:orientation="vertical"> diff --git a/app/src/main/res/layout/fragment_info_strategy.xml b/app/src/main/res/layout/fragment_info_strategy.xml index f77f50a839..d26f060227 100644 --- a/app/src/main/res/layout/fragment_info_strategy.xml +++ b/app/src/main/res/layout/fragment_info_strategy.xml @@ -1,57 +1,59 @@ - + + android:id="@+id/container" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center_horizontal" + android:background="@color/background_white" + android:orientation="vertical"> + android:id="@+id/strategy_select_game_rl" + android:layout_width="136dp" + android:layout_height="32dp" + android:layout_marginTop="12dp" + android:layout_marginBottom="12dp" + android:background="@drawable/button_border_blue_oval" + android:gravity="center"> + android:includeFontPadding="false" + android:paddingRight="4dp" + android:text="@string/news_concenrn_game_mine" + android:textColor="@color/theme_font" + android:textSize="14sp" /> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_toRightOf="@+id/strategy_game_name" + android:src="@drawable/ic_followed_game" /> - + + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:id="@+id/strategy_refresh" + android:layout_width="match_parent" + android:layout_height="match_parent"> - + android:id="@+id/strategy_rv" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + - + - + - \ No newline at end of file + android:id="@+id/popup_bg" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/bg_popup" + android:visibility="gone" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_package_skip.xml b/app/src/main/res/layout/fragment_package_skip.xml index 8155b65ed6..b3d304cf29 100644 --- a/app/src/main/res/layout/fragment_package_skip.xml +++ b/app/src/main/res/layout/fragment_package_skip.xml @@ -56,6 +56,7 @@ android:paddingRight="20dp"> + android:background="@color/background_white"> - + - + - + - + - + - + - + - + - + - + - + - + - + + android:background="@color/background_white"> + android:background="@color/background_white"> diff --git a/app/src/main/res/layout/fragment_teenager_mode.xml b/app/src/main/res/layout/fragment_teenager_mode.xml index c5ccc4b09c..43f1c9a36e 100644 --- a/app/src/main/res/layout/fragment_teenager_mode.xml +++ b/app/src/main/res/layout/fragment_teenager_mode.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/white"> + android:background="@color/background_white"> - + - + - + - + @@ -20,7 +20,7 @@ android:layout_height = "wrap_content" android:layout_centerVertical = "true" android:text = "@string/news_info" - android:textColor = "@color/black" + android:textColor = "@color/text_black" android:textSize = "15sp" android:textStyle = "bold" /> @@ -33,6 +33,7 @@ android:gravity = "center" > + android:background="@color/background_white"> diff --git a/app/src/main/res/layout/layout_filter_size.xml b/app/src/main/res/layout/layout_filter_size.xml index 8c7a8e1d99..75aa4b0b9a 100644 --- a/app/src/main/res/layout/layout_filter_size.xml +++ b/app/src/main/res/layout/layout_filter_size.xml @@ -10,7 +10,7 @@ android:id="@+id/flexbox" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/white" + android:background="@color/background_white" android:paddingBottom="8dp" app:flexDirection="row" app:flexWrap="wrap" /> diff --git a/app/src/main/res/layout/message_item.xml b/app/src/main/res/layout/message_item.xml index 0cd2ad6860..867bce9fb0 100644 --- a/app/src/main/res/layout/message_item.xml +++ b/app/src/main/res/layout/message_item.xml @@ -48,7 +48,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="12dp" - android:textColor="@color/black" + android:textColor="@color/text_black" android:textSize="12sp" app:layout_constraintLeft_toRightOf="@id/message_icon_container" app:layout_constraintTop_toTopOf="parent" @@ -95,7 +95,7 @@ android:layout_marginLeft="12dp" android:layout_marginTop="4dp" android:ellipsize="end" - android:textColor="@color/black" + android:textColor="@color/text_black" android:textSize="13sp" app:layout_constraintLeft_toRightOf="@id/message_icon_container" app:layout_constraintRight_toRightOf="parent" diff --git a/app/src/main/res/layout/message_kefu_item.xml b/app/src/main/res/layout/message_kefu_item.xml index 9461b3cc58..d720eb914e 100644 --- a/app/src/main/res/layout/message_kefu_item.xml +++ b/app/src/main/res/layout/message_kefu_item.xml @@ -49,7 +49,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/message_icon_container" - android:textColor="@color/black" + android:textColor="@color/text_black" android:textSize="12sp" tools:text="Kris Wu" /> @@ -147,6 +147,7 @@ android:src="@drawable/ic_id" /> diff --git a/app/src/main/res/layout/news_digest_item.xml b/app/src/main/res/layout/news_digest_item.xml index df11f0ce12..6a7146565b 100644 --- a/app/src/main/res/layout/news_digest_item.xml +++ b/app/src/main/res/layout/news_digest_item.xml @@ -32,7 +32,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="7dp" - android:textColor="@color/black" + android:textColor="@color/text_black" android:textSize="16sp" /> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index dfa596fb67..041b3fbc6e 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -161,7 +161,7 @@ #aaaaaa #AAAAAA - #dcdcdc + @color/background #c7c7c7 #d6d5ff #f8f8f8 @@ -169,7 +169,7 @@ #e6e6e6 #ECF6FF #EDEDED - #F2F2F2 + @color/divider #FFC247 #FF9933 #F4F5F6 @@ -211,7 +211,7 @@ #d5d5d5 #b3b3b3 #B3B3B3 - #6c6c6c + @color/text_subtitle #ff5151 #ffbf00 #FA8500