From 7d8e32320f867504e28429ede1aec419e10c3db2 Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Mon, 15 Aug 2022 21:10:42 +1000 Subject: Apply custom theme to settings page. --- .../CustomThemeWrapperReceiver.java | 7 ++ .../infinityforreddit/activities/BaseActivity.java | 2 +- .../activities/CustomizeThemeActivity.java | 9 +-- .../activities/PostFilterPreferenceActivity.java | 4 +- .../activities/PostFilterUsageListingActivity.java | 4 +- .../AcknowledgementRecyclerViewAdapter.java | 9 ++- .../adapters/CrashReportsRecyclerViewAdapter.java | 8 ++- .../CustomizeThemeRecyclerViewAdapter.java | 21 ++++-- .../adapters/PostFilterRecyclerViewAdapter.java | 14 +++- .../PostFilterUsageRecyclerViewAdapter.java | 9 ++- .../customviews/CustomFontEditTextPreference.java | 33 ++++++++- .../customviews/CustomFontListPreference.java | 33 ++++++++- .../customviews/CustomFontPreference.java | 33 ++++++++- .../customviews/CustomFontPreferenceCategory.java | 23 +++++-- .../CustomFontPreferenceFragmentCompat.java | 17 ++++- .../customviews/CustomFontSeekBarPreference.java | 33 ++++++++- .../customviews/CustomFontSwitchPreference.java | 33 ++++++++- .../settings/AboutPreferenceFragment.java | 4 -- .../settings/AcknowledgementFragment.java | 8 ++- .../settings/AdvancedPreferenceFragment.java | 7 -- .../settings/CommentPreferenceFragment.java | 4 -- .../settings/CrashReportsFragment.java | 2 + .../settings/CreditsPreferenceFragment.java | 7 -- .../settings/CustomizeBottomAppBarFragment.java | 71 +++++++++++++++++++- .../settings/CustomizeMainPageTabsFragment.java | 78 +++++++++++++++++++++- .../settings/DataSavingModePreferenceFragment.java | 4 -- .../DownloadLocationPreferenceFragment.java | 7 -- .../settings/FontPreferenceFragment.java | 4 -- .../settings/FontPreviewFragment.java | 23 +++++++ .../GesturesAndButtonsPreferenceFragment.java | 4 -- .../ImmersiveInterfacePreferenceFragment.java | 4 -- .../settings/InterfacePreferenceFragment.java | 4 -- .../settings/MainPreferenceFragment.java | 4 -- .../settings/MiscellaneousPreferenceFragment.java | 4 -- .../NavigationDrawerPreferenceFragment.java | 4 -- .../settings/NotificationPreferenceFragment.java | 4 -- .../settings/NsfwAndSpoilerFragment.java | 36 ++++++++-- ...umberOfColumnsInPostFeedPreferenceFragment.java | 4 -- .../settings/PostDetailsPreferenceFragment.java | 4 -- .../settings/PostHistoryFragment.java | 29 +++++++- .../settings/PostPreferenceFragment.java | 4 -- .../settings/SecurityPreferenceFragment.java | 4 -- .../settings/SortTypePreferenceFragment.java | 4 -- .../settings/SwipeActionPreferenceFragment.java | 4 -- .../settings/ThemePreferenceFragment.java | 4 -- .../settings/TimeFormatPreferenceFragment.java | 4 -- .../settings/TranslationFragment.java | 2 + .../settings/VideoPreferenceFragment.java | 4 -- 48 files changed, 478 insertions(+), 164 deletions(-) create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/CustomThemeWrapperReceiver.java (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomThemeWrapperReceiver.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomThemeWrapperReceiver.java new file mode 100644 index 00000000..58ac1bd1 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomThemeWrapperReceiver.java @@ -0,0 +1,7 @@ +package ml.docilealligator.infinityforreddit; + +import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; + +public interface CustomThemeWrapperReceiver { + void setCustomThemeWrapper(CustomThemeWrapper customThemeWrapper); +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java index b0dec874..a839bc1e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/BaseActivity.java @@ -62,7 +62,7 @@ public abstract class BaseActivity extends AppCompatActivity implements CustomFo private boolean isImmersiveInterfaceApplicable = true; private int systemVisibilityToolbarExpanded = 0; private int systemVisibilityToolbarCollapsed = 0; - private CustomThemeWrapper customThemeWrapper; + public CustomThemeWrapper customThemeWrapper; public Typeface typeface; public Typeface titleTypeface; public Typeface contentTypeface; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java index 58dd009b..ddc0962d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomizeThemeActivity.java @@ -148,14 +148,14 @@ public class CustomizeThemeActivity extends BaseActivity { themeName = customTheme.name; } - adapter = new CustomizeThemeRecyclerViewAdapter(this, themeName, isPredefinedTheme); + adapter = new CustomizeThemeRecyclerViewAdapter(this, customThemeWrapper, themeName); recyclerView.setAdapter(adapter); adapter.setCustomThemeSettingsItem(customThemeSettingsItems); }); } else { isPredefinedTheme = getIntent().getBooleanExtra(EXTRA_IS_PREDEFIINED_THEME, false); themeName = getIntent().getStringExtra(EXTRA_THEME_NAME); - adapter = new CustomizeThemeRecyclerViewAdapter(this, themeName, isPredefinedTheme); + adapter = new CustomizeThemeRecyclerViewAdapter(this, customThemeWrapper, themeName); recyclerView.setAdapter(adapter); if (isPredefinedTheme) { customThemeSettingsItems = CustomThemeSettingsItem.convertCustomThemeToSettingsItem( @@ -163,7 +163,7 @@ public class CustomizeThemeActivity extends BaseActivity { CustomThemeWrapper.getPredefinedCustomTheme(this, themeName), androidVersion); - adapter = new CustomizeThemeRecyclerViewAdapter(this, themeName, isPredefinedTheme); + adapter = new CustomizeThemeRecyclerViewAdapter(this, customThemeWrapper, themeName); recyclerView.setAdapter(adapter); adapter.setCustomThemeSettingsItem(customThemeSettingsItems); } else { @@ -177,7 +177,7 @@ public class CustomizeThemeActivity extends BaseActivity { } } } else { - adapter = new CustomizeThemeRecyclerViewAdapter(this, themeName, isPredefinedTheme); + adapter = new CustomizeThemeRecyclerViewAdapter(this, customThemeWrapper, themeName); recyclerView.setAdapter(adapter); adapter.setCustomThemeSettingsItem(customThemeSettingsItems); } @@ -257,5 +257,6 @@ public class CustomizeThemeActivity extends BaseActivity { @Override protected void applyCustomTheme() { applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar); + coordinatorLayout.setBackgroundColor(customThemeWrapper.getBackgroundColor()); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java index ab96b850..a4a63b1b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterPreferenceActivity.java @@ -98,7 +98,7 @@ public class PostFilterPreferenceActivity extends BaseActivity { } }); - adapter = new PostFilterRecyclerViewAdapter(this, postFilter -> { + adapter = new PostFilterRecyclerViewAdapter(this, customThemeWrapper, postFilter -> { if (post != null) { showPostFilterOptions(post, postFilter); } else if (subredditName != null) { @@ -211,6 +211,8 @@ public class PostFilterPreferenceActivity extends BaseActivity { @Override protected void applyCustomTheme() { applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar); + applyFABTheme(fab); + coordinatorLayout.setBackgroundColor(customThemeWrapper.getBackgroundColor()); } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java index e24a47b9..4bef4cd7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostFilterUsageListingActivity.java @@ -94,7 +94,7 @@ public class PostFilterUsageListingActivity extends BaseActivity { newPostFilterUsageBottomSheetFragment.show(getSupportFragmentManager(), newPostFilterUsageBottomSheetFragment.getTag()); }); - adapter = new PostFilterUsageRecyclerViewAdapter(this, postFilterUsage -> { + adapter = new PostFilterUsageRecyclerViewAdapter(this, customThemeWrapper, postFilterUsage -> { PostFilterUsageOptionsBottomSheetFragment postFilterUsageOptionsBottomSheetFragment = new PostFilterUsageOptionsBottomSheetFragment(); Bundle bundle = new Bundle(); bundle.putParcelable(PostFilterUsageOptionsBottomSheetFragment.EXTRA_POST_FILTER_USAGE, postFilterUsage); @@ -213,5 +213,7 @@ public class PostFilterUsageListingActivity extends BaseActivity { @Override protected void applyCustomTheme() { applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar); + applyFABTheme(fab); + coordinatorLayout.setBackgroundColor(customThemeWrapper.getBackgroundColor()); } } \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/AcknowledgementRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/AcknowledgementRecyclerViewAdapter.java index 9e53600f..3cc05331 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/AcknowledgementRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/AcknowledgementRecyclerViewAdapter.java @@ -14,15 +14,15 @@ import java.util.ArrayList; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.activities.BaseActivity; import ml.docilealligator.infinityforreddit.activities.LinkResolverActivity; +import ml.docilealligator.infinityforreddit.activities.SettingsActivity; import ml.docilealligator.infinityforreddit.settings.Acknowledgement; public class AcknowledgementRecyclerViewAdapter extends RecyclerView.Adapter { private ArrayList acknowledgements; - private BaseActivity activity; + private SettingsActivity activity; - public AcknowledgementRecyclerViewAdapter(BaseActivity activity, ArrayList acknowledgements) { + public AcknowledgementRecyclerViewAdapter(SettingsActivity activity, ArrayList acknowledgements) { this.activity = activity; this.acknowledgements = acknowledgements; } @@ -66,6 +66,9 @@ public class AcknowledgementRecyclerViewAdapter extends RecyclerView.Adapter { - private BaseActivity activity; + private SettingsActivity activity; private List crashReports; - public CrashReportsRecyclerViewAdapter(BaseActivity activity, List crashReports) { + public CrashReportsRecyclerViewAdapter(SettingsActivity activity, List crashReports) { this.activity = activity; this.crashReports = crashReports; } @@ -44,6 +44,8 @@ public class CrashReportsRecyclerViewAdapter extends RecyclerView.Adapter { @@ -29,16 +30,16 @@ public class CustomizeThemeRecyclerViewAdapter extends RecyclerView.Adapter customThemeSettingsItems; private String themeName; - private boolean isPredefinedTheme; - public CustomizeThemeRecyclerViewAdapter(BaseActivity activity, String themeName, - boolean isPredefinedTheme) { + public CustomizeThemeRecyclerViewAdapter(BaseActivity activity, CustomThemeWrapper customThemeWrapper, + String themeName) { this.activity = activity; + this.customThemeWrapper = customThemeWrapper; customThemeSettingsItems = new ArrayList<>(); this.themeName = themeName; - this.isPredefinedTheme = isPredefinedTheme; } @Override @@ -148,6 +149,10 @@ public class CustomizeThemeRecyclerViewAdapter extends RecyclerView.Adapter { @@ -20,6 +22,7 @@ public class PostFilterRecyclerViewAdapter extends RecyclerView.Adapter postFilterList; @@ -27,8 +30,10 @@ public class PostFilterRecyclerViewAdapter extends RecyclerView.Adapter { private List postFilterUsages; - private OnItemClickListener onItemClickListener; private BaseActivity activity; + private CustomThemeWrapper customThemeWrapper; + private OnItemClickListener onItemClickListener; public interface OnItemClickListener { void onClick(PostFilterUsage postFilterUsage); } - public PostFilterUsageRecyclerViewAdapter(BaseActivity activity, + public PostFilterUsageRecyclerViewAdapter(BaseActivity activity, CustomThemeWrapper customThemeWrapper, OnItemClickListener onItemClickListener) { this.activity = activity; + this.customThemeWrapper = customThemeWrapper; this.onItemClickListener = onItemClickListener; } @@ -85,6 +88,8 @@ public class PostFilterUsageRecyclerViewAdapter extends RecyclerView.Adapter { @@ -181,9 +194,20 @@ public class NsfwAndSpoilerFragment extends Fragment { return rootView; } + private void applyCustomTheme() { + int primaryTextColor = activity.customThemeWrapper.getPrimaryTextColor(); + enableNsfwTextView.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(activity, R.drawable.ic_nsfw_on_24dp, activity.customThemeWrapper.getPrimaryIconColor()), null, null, null); + enableNsfwTextView.setTextColor(primaryTextColor); + blurNsfwTextView.setTextColor(primaryTextColor); + doNotBlurNsfwInNsfwSubredditsTextView.setTextColor(primaryTextColor); + blurSpoilerTextView.setTextColor(primaryTextColor); + dangerousTextView.setTextColor(primaryTextColor); + disableNsfwForeverTextView.setTextColor(primaryTextColor); + } + @Override public void onAttach(@NonNull Context context) { super.onAttach(context); - this.activity = (BaseActivity) context; + this.activity = (SettingsActivity) context; } } \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NumberOfColumnsInPostFeedPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NumberOfColumnsInPostFeedPreferenceFragment.java index 2ebb31a1..61a4b205 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NumberOfColumnsInPostFeedPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/NumberOfColumnsInPostFeedPreferenceFragment.java @@ -9,9 +9,5 @@ public class NumberOfColumnsInPostFeedPreferenceFragment extends CustomFontPrefe @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.number_of_columns_in_post_feed_preferences, rootKey); - - if (activity.typeface != null) { - setFont(activity.typeface); - } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java index 224fffd5..5fe11360 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java @@ -14,9 +14,5 @@ public class PostDetailsPreferenceFragment extends CustomFontPreferenceFragmentC PreferenceManager preferenceManager = getPreferenceManager(); preferenceManager.setSharedPreferencesName(SharedPreferencesUtils.POST_DETAILS_SHARED_PREFERENCES_FILE); setPreferencesFromResource(R.xml.post_details_preferences, rootKey); - - if (activity.typeface != null) { - setFont(activity.typeface); - } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java index 878ead80..0384f050 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostHistoryFragment.java @@ -2,6 +2,7 @@ package ml.docilealligator.infinityforreddit.settings; import android.content.Context; import android.content.SharedPreferences; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -21,7 +22,7 @@ import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; -import ml.docilealligator.infinityforreddit.activities.BaseActivity; +import ml.docilealligator.infinityforreddit.activities.SettingsActivity; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.Utils; @@ -33,24 +34,32 @@ public class PostHistoryFragment extends Fragment { TextView infoTextView; @BindView(R.id.mark_posts_as_read_linear_layout_post_history_fragment) LinearLayout markPostsAsReadLinearLayout; + @BindView(R.id.mark_posts_as_read_text_view_post_history_fragment) + TextView markPostsAsReadTextView; @BindView(R.id.mark_posts_as_read_switch_post_history_fragment) SwitchMaterial markPostsAsReadSwitch; @BindView(R.id.mark_posts_as_read_after_voting_linear_layout_post_history_fragment) LinearLayout markPostsAsReadAfterVotingLinearLayout; + @BindView(R.id.mark_posts_as_read_after_voting_text_view_post_history_fragment) + TextView markPostsAsReadAfterVotingTextView; @BindView(R.id.mark_posts_as_read_after_voting_switch_post_history_fragment) SwitchMaterial markPostsAsReadAfterVotingSwitch; @BindView(R.id.mark_posts_as_read_on_scroll_linear_layout_post_history_fragment) LinearLayout markPostsAsReadOnScrollLinearLayout; + @BindView(R.id.mark_posts_as_read_on_scroll_text_view_post_history_fragment) + TextView markPostsAsReadOnScrollTextView; @BindView(R.id.mark_posts_as_read_on_scroll_switch_post_history_fragment) SwitchMaterial markPostsAsReadOnScrollSwitch; @BindView(R.id.hide_read_posts_automatically_linear_layout_post_history_fragment) LinearLayout hideReadPostsAutomaticallyLinearLayout; + @BindView(R.id.hide_read_posts_automatically_text_view_post_history_fragment) + TextView hideReadPostsAutomaticallyTextView; @BindView(R.id.hide_read_posts_automatically_switch_post_history_fragment) SwitchMaterial hideReadPostsAutomaticallySwitch; @Inject @Named("post_history") SharedPreferences postHistorySharedPreferences; - private BaseActivity activity; + private SettingsActivity activity; public PostHistoryFragment() { // Required empty public constructor @@ -66,6 +75,9 @@ public class PostHistoryFragment extends Fragment { ButterKnife.bind(this, rootView); + rootView.setBackgroundColor(activity.customThemeWrapper.getBackgroundColor()); + applyCustomTheme(); + if (activity.typeface != null) { Utils.setFontToAllTextViews(rootView, activity.typeface); } @@ -112,9 +124,20 @@ public class PostHistoryFragment extends Fragment { return rootView; } + private void applyCustomTheme() { + infoTextView.setTextColor(activity.customThemeWrapper.getSecondaryTextColor()); + Drawable infoDrawable = Utils.getTintedDrawable(activity, R.drawable.ic_info_preference_24dp, activity.customThemeWrapper.getPrimaryIconColor()); + infoTextView.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null); + int primaryTextColor = activity.customThemeWrapper.getPrimaryTextColor(); + markPostsAsReadTextView.setTextColor(primaryTextColor); + markPostsAsReadAfterVotingTextView.setTextColor(primaryTextColor); + markPostsAsReadOnScrollTextView.setTextColor(primaryTextColor); + hideReadPostsAutomaticallyTextView.setTextColor(primaryTextColor); + } + @Override public void onAttach(@NonNull Context context) { super.onAttach(context); - this.activity = (BaseActivity) context; + this.activity = (SettingsActivity) context; } } \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java index cacdf83b..7f4fe935 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java @@ -31,10 +31,6 @@ public class PostPreferenceFragment extends CustomFontPreferenceFragmentCompat { @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.post_preferences, rootKey); - - if (activity.typeface != null) { - setFont(activity.typeface); - } ListPreference defaultPostLayoutList = findPreference(SharedPreferencesUtils.DEFAULT_POST_LAYOUT_KEY); ListPreference defaultLinkPostLayoutList = findPreference(SharedPreferencesUtils.DEFAULT_LINK_POST_LAYOUT_KEY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java index 7bac9841..a1d49a82 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SecurityPreferenceFragment.java @@ -42,10 +42,6 @@ public class SecurityPreferenceFragment extends CustomFontPreferenceFragmentComp ((Infinity) activity.getApplication()).getAppComponent().inject(this); - if (activity.typeface != null) { - setFont(activity.typeface); - } - SwitchPreference requireAuthToAccountSectionSwitch = findPreference(SharedPreferencesUtils.REQUIRE_AUTHENTICATION_TO_GO_TO_ACCOUNT_SECTION_IN_NAVIGATION_DRAWER); SwitchPreference secureModeSwitch = findPreference(SharedPreferencesUtils.SECURE_MODE); SwitchPreference appLockSwitch = findPreference(SharedPreferencesUtils.APP_LOCK); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SortTypePreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SortTypePreferenceFragment.java index dbb3f615..e10d9e82 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SortTypePreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SortTypePreferenceFragment.java @@ -10,9 +10,5 @@ public class SortTypePreferenceFragment extends CustomFontPreferenceFragmentComp @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.sort_type_preferences, rootKey); - - if (activity.typeface != null) { - setFont(activity.typeface); - } } } \ No newline at end of file diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SwipeActionPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SwipeActionPreferenceFragment.java index a7d03631..56da79d8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SwipeActionPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/SwipeActionPreferenceFragment.java @@ -22,10 +22,6 @@ public class SwipeActionPreferenceFragment extends CustomFontPreferenceFragmentC public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.swipe_action_preferences, rootKey); - if (activity.typeface != null) { - setFont(activity.typeface); - } - SwitchPreference enableSwipeActionSwitch = findPreference(SharedPreferencesUtils.ENABLE_SWIPE_ACTION); ListPreference swipeLeftActionListPreference = findPreference(SharedPreferencesUtils.SWIPE_LEFT_ACTION); ListPreference swipeRightActionListPreference = findPreference(SharedPreferencesUtils.SWIPE_RIGHT_ACTION); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java index 65bea6ef..f2539426 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java @@ -71,10 +71,6 @@ public class ThemePreferenceFragment extends CustomFontPreferenceFragmentCompat ((Infinity) activity.getApplication()).getAppComponent().inject(this); - if (activity.typeface != null) { - setFont(activity.typeface); - } - ListPreference themePreference = findPreference(SharedPreferencesUtils.THEME_KEY); SwitchPreference amoledDarkSwitch = findPreference(SharedPreferencesUtils.AMOLED_DARK_KEY); Preference customizeLightThemePreference = findPreference(SharedPreferencesUtils.CUSTOMIZE_LIGHT_THEME); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TimeFormatPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TimeFormatPreferenceFragment.java index 21e190aa..b8b3b8cf 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TimeFormatPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TimeFormatPreferenceFragment.java @@ -18,10 +18,6 @@ public class TimeFormatPreferenceFragment extends CustomFontPreferenceFragmentCo public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.time_format_preferences, rootKey); - if (activity.typeface != null) { - setFont(activity.typeface); - } - SwitchPreference showElapsedTimeSwitch = findPreference(SharedPreferencesUtils.SHOW_ELAPSED_TIME_KEY); ListPreference timeFormatList = findPreference(SharedPreferencesUtils.TIME_FORMAT_KEY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java index 576a6af1..41db0168 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/TranslationFragment.java @@ -45,6 +45,8 @@ public class TranslationFragment extends Fragment { TranslationFragmentRecyclerViewAdapter adapter = new TranslationFragmentRecyclerViewAdapter(activity, customThemeWrapper); recyclerView.setAdapter(adapter); + rootView.setBackgroundColor(customThemeWrapper.getBackgroundColor()); + return rootView; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java index 9802e3cb..e00dce6d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/VideoPreferenceFragment.java @@ -38,10 +38,6 @@ public class VideoPreferenceFragment extends CustomFontPreferenceFragmentCompat ((Infinity) activity.getApplication()).getAppComponent().inject(this); - if (activity.typeface != null) { - setFont(activity.typeface); - } - ListPreference videoAutoplayListPreference = findPreference(SharedPreferencesUtils.VIDEO_AUTOPLAY); SwitchPreference muteAutoplayingVideosSwitchPreference = findPreference(SharedPreferencesUtils.MUTE_AUTOPLAYING_VIDEOS); SwitchPreference rememberMutingOptionInPostFeedSwitchPreference = findPreference(SharedPreferencesUtils.REMEMBER_MUTING_OPTION_IN_POST_FEED); -- cgit v1.2.3