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); diff --git a/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml b/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml index 3473e057..196e61a0 100644 --- a/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml +++ b/app/src/main/res/layout/fragment_customize_bottom_app_bar.xml @@ -18,11 +18,9 @@ android:padding="16dp" android:drawablePadding="32dp" android:text="@string/restart_app_see_changes" - android:textColor="@color/settingsSubtitleColor" android:gravity="center_vertical" android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" - app:drawableStartCompat="@drawable/ic_info_preference_24dp" /> + android:fontFamily="?attr/font_family" /> @@ -55,6 +52,7 @@ android:background="?attr/selectableItemBackground"> @@ -273,6 +275,7 @@ android:background="?attr/selectableItemBackground"> + android:fontFamily="?attr/font_family" /> @@ -58,7 +56,6 @@ android:layout_height="wrap_content" android:layout_marginEnd="16dp" android:layout_gravity="center_vertical" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -77,13 +74,13 @@ android:background="?attr/selectableItemBackground"> @@ -109,7 +106,6 @@ android:paddingStart="72dp" android:paddingEnd="16dp" android:text="@string/settings_tab_1_summary" - android:textColor="@color/colorAccent" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -127,10 +123,10 @@ android:background="?attr/selectableItemBackground"> @@ -138,7 +134,6 @@ android:id="@+id/tab_1_title_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -158,10 +153,10 @@ android:background="?attr/selectableItemBackground"> @@ -169,7 +164,6 @@ android:id="@+id/tab_1_type_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -194,7 +188,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:fontFamily="?attr/font_family" - android:textColor="@color/primaryTextColor" android:textSize="?attr/font_16" app:layout_constraintEnd_toStartOf="@id/tab_1_name_add_image_view_customize_main_page_tabs_fragment" app:layout_constraintStart_toStartOf="parent" @@ -205,7 +198,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:fontFamily="?attr/font_family" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/tab_1_name_add_image_view_customize_main_page_tabs_fragment" @@ -241,7 +233,6 @@ android:paddingStart="72dp" android:paddingEnd="16dp" android:text="@string/settings_tab_2_summary" - android:textColor="@color/colorAccent" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -259,10 +250,10 @@ android:background="?attr/selectableItemBackground"> @@ -270,7 +261,6 @@ android:id="@+id/tab_2_title_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -290,10 +280,10 @@ android:background="?attr/selectableItemBackground"> @@ -301,7 +291,6 @@ android:id="@+id/tab_2_type_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -325,7 +314,6 @@ android:id="@+id/tab_2_name_title_text_view_customize_main_page_tabs_fragment" android:layout_width="0dp" android:layout_height="wrap_content" - android:textColor="@color/primaryTextColor" android:textSize="?attr/font_16" android:fontFamily="?attr/font_family" app:layout_constraintTop_toTopOf="parent" @@ -336,7 +324,6 @@ android:id="@+id/tab_2_name_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="0dp" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" app:layout_constraintTop_toBottomOf="@id/tab_2_name_title_text_view_customize_main_page_tabs_fragment" @@ -373,7 +360,6 @@ android:paddingStart="72dp" android:paddingEnd="16dp" android:text="@string/settings_tab_3_summary" - android:textColor="@color/colorAccent" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -391,10 +377,10 @@ android:background="?attr/selectableItemBackground"> @@ -402,7 +388,6 @@ android:id="@+id/tab_3_title_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -422,10 +407,10 @@ android:background="?attr/selectableItemBackground"> @@ -433,7 +418,6 @@ android:id="@+id/tab_3_type_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -457,7 +441,6 @@ android:id="@+id/tab_3_name_title_text_view_customize_main_page_tabs_fragment" android:layout_width="0dp" android:layout_height="wrap_content" - android:textColor="@color/primaryTextColor" android:textSize="?attr/font_16" android:fontFamily="?attr/font_family" app:layout_constraintTop_toTopOf="parent" @@ -468,7 +451,6 @@ android:id="@+id/tab_3_name_summary_text_view_customize_main_page_tabs_fragment" android:layout_width="0dp" android:layout_height="wrap_content" - android:textColor="?attr/secondaryTextColor" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" app:layout_constraintTop_toBottomOf="@id/tab_3_name_title_text_view_customize_main_page_tabs_fragment" @@ -505,7 +487,6 @@ android:paddingStart="72dp" android:paddingEnd="16dp" android:text="@string/settings_more_tabs_summary" - android:textColor="@color/colorAccent" android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> @@ -516,11 +497,9 @@ android:padding="16dp" android:drawablePadding="32dp" android:text="@string/settings_more_tabs_info_summary" - android:textColor="@color/settingsSubtitleColor" android:gravity="center_vertical" android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" - app:drawableStartCompat="@drawable/ic_info_preference_24dp" /> + android:fontFamily="?attr/font_family" /> @@ -566,13 +545,13 @@ android:background="?attr/selectableItemBackground"> @@ -597,13 +576,13 @@ android:background="?attr/selectableItemBackground"> @@ -628,13 +607,13 @@ android:background="?attr/selectableItemBackground"> diff --git a/app/src/main/res/layout/fragment_font_preview.xml b/app/src/main/res/layout/fragment_font_preview.xml index c5eba3d4..4eeba171 100644 --- a/app/src/main/res/layout/fragment_font_preview.xml +++ b/app/src/main/res/layout/fragment_font_preview.xml @@ -6,6 +6,7 @@ tools:context=".settings.FontPreviewFragment"> diff --git a/app/src/main/res/layout/fragment_nsfw_and_spoiler.xml b/app/src/main/res/layout/fragment_nsfw_and_spoiler.xml index 76fec79d..7ee168c5 100644 --- a/app/src/main/res/layout/fragment_nsfw_and_spoiler.xml +++ b/app/src/main/res/layout/fragment_nsfw_and_spoiler.xml @@ -26,12 +26,12 @@ android:background="?attr/selectableItemBackground"> + android:fontFamily="?attr/font_family" /> + android:fontFamily="?attr/font_family" /> "Tmavý motiv" "Amoled" "Spravovat motivy" - "Vlastní motivy nemohou být použity na stránku nastavení (kromě nástrojové lišty, stavové lišty a navigační lišty)." "Pokročilé" "Odstranit všechny subreddity v databázi" "Odstranit všechny uživatele v databázi" diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 866c0547..e099d98d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -421,7 +421,6 @@ Tippen für Neuversuch." "Dunkles Thema" "AMOLED-Thema" "Themen verwalten" - "Benutzerdefinierte Themen können nicht auf die Einstellungs-Seite angewandt werden (ausgenommen Werkzeug-, Status- und Navigationsleiste)." "Erweitert" "Alle Subreddits aus der Datenbank löschen" "Alle Benutzer aus der Datenbank löschen" diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 19098830..2eb93d6b 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -411,7 +411,6 @@ Premio means prize, so it's better suited the first word instead of the second o "Tema Oscuro" "Tema AMOLED" "Administrar Temas" - "Los temas no pueden ser aplicados a la página de configuración (a excepción de la barra de herramientas, la barra de estado y la barra de navegación)." "Avanzado" "Borrar Todos los subreddits en la base de datos" "Borrar todos los usuarios en la base de datos" diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 61a9ded4..75269275 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -450,7 +450,6 @@ peut ne pas fonctionner sur Android 11" "Thème Sombre" "Thème Amoled" "Gérer les Thèmes" - "Les thèmes personnalisés ne peuvent pas être appliqués à la page des paramètres (sauf la barre d'outils, la barre d'état et barre de navigation.)" "Avancés" "Supprimer Tous les Subreddits de la Base de Données" "Supprimer Tous les Utilisateurs de la Base de Données" diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index c33ac216..0f47d9ab 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -440,7 +440,6 @@ Behavior --> "गहरी थीम " "अमोलेड थीम " "थीम्स नियंत्रण " - "अनुकूलित थीम सेटिंग्स पृष्ट(टूलबार, स्टैटस बार एवं नेवीगेशन बार के अलावा) पर लागू नहीं की जा सकती।" "उन्नत " "डेटाबेस से सभी सबरैडिट्स मिटा दें " "डेटाबेस से सभी यूजर्स हटा दें " diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 5e90c23d..821d4dc4 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -410,7 +410,6 @@ "Tamna tema" "Amoled tema" "Upravljaj temama" - "Vlastite teme se ne mogu primijeniti na stranicu postavki (osim alatne trake, trake statusa i navigacijske trake)" "Napredno" "Obriši sve podreddite u bazi podataka" "Obriši sve korisnike u bazi podataka" diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index d72b53bc..825e7624 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -395,7 +395,6 @@ "Sötét téma" "Amoled téma" "Témák kezelése" - "Egyedi témákat nem lehet használni a beállítások aldalán (kivéve az eszköztáron, státusz sávon és navigációs sávon)." "Haladó" "Adatbázisban szereplő összes subreddit törlése" "Adatbázisban szereplő összes felhasználó törlése" diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2b86c7dc..a144a2cd 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -384,7 +384,6 @@ Tocca per riprovare." "Tema Scuro" "Tema Amoled" "Gestisci i temi" - "I temi personalizzati non possono essere applicati alla pagina delle impostazioni (tranne barra degli strumenti, barra di stato e barra di navigazione)." "Avanzate" "Elimina Tutti i Subreddit nel Database" "Elimina Tutti gli Utenti nel Database" diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index c0fc088b..76cd86eb 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -443,7 +443,6 @@ "ダークテーマ" "AMOLEDテーマ" "テーマの管理" - "カスタムテーマは設定画面には適用できません (ツールバー、ステータスバー、ナビゲーションバーを除く)" "高度な設定" "データベース中の全てのSubreddit情報を削除" "データベース中の全てのユーザー情報を削除" diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index d97318ee..ab122c9c 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -8,6 +8,5 @@ #FFFFFF #242424 #FFFFFF - #4DFFFFFF #69666c diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index c58b2a25..0f2dada4 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -394,7 +394,6 @@ Druk om opnieuw te proberen." "Donker thema" "Amoled-thema" "Thema's beheren" - "Aangepaste thema's kunnen niet worden toegepast op de instellingenpagina (behalve de werkbalk, statusbalk en navigatiebalk)." "Geavanceerd" "Alle subreddits verwijderen uit databank" "Alle gebruikers verwijderen uit databank" diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index a57a9786..7b98017a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -389,8 +389,6 @@ "Ciemny motyw" "Amoledowy motyw" "Zarządzaj motywami" - "Niestandardowe motywy nie mogą być zaaplikowane do strony ustawień -(z wyjątkiem paska narzędzi, paska stanu i paska nawigacji)." "Zaawansowane" "Usuń wszystkie Subreddity w bazie danych" "Usuń wszystkich użytkowników w bazie danych" diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index e309275e..ac6a4d6a 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -393,7 +393,6 @@ Toque para tentar novamente." "Tema Escuro" "Tema Amoled" "Gerenciar Temas" - "Temas personalizados não podem ser aplicados à página de configurações (exceto barra de ferramentas, barra de status e barra de navegação)." "Avançado" "Excluir Todos os Subreddits no Banco de Dados" "Excluir Todos os Usuários no Banco de Dados" diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 26d31902..5c58d2df 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -398,7 +398,6 @@ Toque para tentar novamente." "Tema Escuro" "Tema Amoled" "Gerir Temas" - "Temas personalizados não podem ser aplicados à página de definições (exceto à barra de ferramentas, barra de estado e barra de navegação)." "Avançado" "Eliminar Todas as Comunidades da BD" "Eliminar Todos os Utilizadores da BD" diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 55217113..2a475aac 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -387,7 +387,6 @@ Atinge pentru a reîncerca." "Temă întunecată" "Temă Amoled" "Gestionați temele" - "Temele personalizate nu pot fi aplicate la pagina de setări (cu excepția barei de instrumente, a barei de stare și a barei de navigare)." "Avansat" "Ștergeți toate subredditele din baza de date" "Ștergeți toți utilizatorii din baza de date" diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 147bc243..704c59ee 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -399,7 +399,6 @@ "Тёмная тема" "Тема AMOLED" "Менеджер тем" - "Пользовательские темы не применяются к странице настроек (кроме панели инструментов, строки состояния и панели навигации)." "Дополнительные" "Удалить все сабреддиты из базы данных" "Удалить всех пользователей из базы данных" diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index cbdbeca8..19308eb3 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -406,7 +406,6 @@ Tekrar denemek için tıklayın." "Koyu Tema" "Amoled Tema" "Temaları Yönetin" - "Özel temalar ayarlar sayfasına uygulanamaz (araç çubuğu, durum çubuğu ve navigasyon çubuğu hariç)." "Gelişmiş" "Veritabanındaki Tüm Subredditleri Sil" "Veritabanındaki Tüm Kullanıcıları Sil" diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index d4624613..23cae648 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -387,7 +387,6 @@ "Темна тема" "Тема Amoled" "Керувати темами" - "Власні теми не застосовуються до сторінки налаштувань (окрім панелі засобів, стрічки стану і панелі переходів)." "Розширені" "Видалити всі сабредити з бази даних" "Видалити всіх користувачів із бази даних" diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index fd989442..7ef0732c 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -400,7 +400,6 @@ Nhấn để thử lại." "Chủ đề tối" "Chủ đề Amoled" "Quản lý chủ đề" - "Các chủ đề tuỳ chỉnh không thể được áp dụng cho trang cài đặt (trừ thanh công cụ, thanh trạng thái và thanh điều hướng)." "Nâng cao" "Xoá tất cả subreddit trong cơ sở dữ liệu" "Xoá tất cả người dùng trong cơ sở dữ liệu" diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 5dac4031..d9e962bd 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -405,7 +405,6 @@ "黑暗主题" "Amoled 主题" "管理主题" - "自定义主题无法应用于设置页面(工具栏、状态栏和导航栏除外)" "高级" "删除数据库中的所有版块" "删除数据库中的所有用户" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 9085c9e0..074ab268 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -9,6 +9,5 @@ #FFFFFF #000000 #000000 - #42000000 #E0E0E0 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 89129fa9..ee96d717 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -490,7 +490,6 @@ Personalize Infinity based on Your Wallpaper Apply Material You In case Infinity did not change the theme - Custom themes cannot be applied to settings page (except toolbar, status bar and navigation bar). Advanced Delete All Subreddits in Database Delete All Users in Database diff --git a/app/src/main/res/xml/theme_preferences.xml b/app/src/main/res/xml/theme_preferences.xml index 6c8b9504..ab02e39b 100644 --- a/app/src/main/res/xml/theme_preferences.xml +++ b/app/src/main/res/xml/theme_preferences.xml @@ -41,11 +41,6 @@ app:icon="@drawable/ic_edit_24dp" app:title="@string/settings_manage_themes_title" /> - -