diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e3283575..b13132c7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,11 +21,14 @@ android:theme="@style/AppTheme" android:usesCleartextTraffic="true" tools:replace="android:label"> + + android:theme="@style/AppTheme.NoActionBar" /> customThemeLiveData; + switch (themeType) { + case EXTRA_DARK_THEME: + toolbar.setTitle(getString(R.string.customize_dark_theme_fragment_title)); + customThemeLiveData = customThemeViewModel.getDarkCustomTheme(); + break; + case EXTRA_AMOLED_THEME: + toolbar.setTitle(getString(R.string.customize_amoled_theme_fragment_title)); + customThemeLiveData = customThemeViewModel.getAmoledCustomTheme(); + break; + default: + toolbar.setTitle(getString(R.string.customize_light_theme_fragment_title)); + customThemeLiveData = customThemeViewModel.getLightCustomTheme(); + break; + } + + int androidVersion = Build.VERSION.SDK_INT; + customThemeLiveData.observe(this, new Observer() { + @Override + public void onChanged(CustomTheme customTheme) { + ArrayList customThemeSettingsItems = + CustomThemeSettingsItem.convertCustomTheme(CustomizeThemeActivity.this, customTheme); + if (androidVersion < Build.VERSION_CODES.O) { + customThemeSettingsItems.get(customThemeSettingsItems.size() - 2).itemDetails = getString(R.string.theme_item_available_on_android_8); + } + if (androidVersion < Build.VERSION_CODES.M) { + customThemeSettingsItems.get(customThemeSettingsItems.size() - 3).itemDetails = getString(R.string.theme_item_available_on_android_6); + } + + adapter.setCustomThemeSettingsItem(customThemeSettingsItems); + } + }); + } + + @Override + protected SharedPreferences getSharedPreferences() { + return sharedPreferences; + } + + @Override + protected CustomThemeWrapper getCustomThemeWrapper() { + return customThemeWrapper; + } + + @Override + protected void applyCustomTheme() { + applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java index 1a678afe..c8ad39c5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SettingsActivity.java @@ -7,7 +7,6 @@ import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; -import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; @@ -31,8 +30,6 @@ public class SettingsActivity extends BaseActivity implements private static final String TITLE_STATE = "TS"; - @BindView(R.id.coordinator_layout_settings_activity) - CoordinatorLayout coordinatorLayout; @BindView(R.id.appbar_layout_settings_activity) AppBarLayout appBarLayout; @BindView(R.id.toolbar_settings_activity) @@ -96,7 +93,6 @@ public class SettingsActivity extends BaseActivity implements @Override protected void applyCustomTheme() { - coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index 75564f05..7b89c940 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -303,7 +303,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter { + private static final int VIEW_TYPE_COLOR = 1; + private static final int VIEW_TYPE_SWITCH = 2; + private ArrayList customThemeSettingsItems; + + public CustomizeThemeRecyclerViewAdapter() { + customThemeSettingsItems = new ArrayList<>(); + } + + @Override + public int getItemViewType(int position) { + if (position < customThemeSettingsItems.size() - 3) { + return VIEW_TYPE_COLOR; + } + + return VIEW_TYPE_SWITCH; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + if (viewType == VIEW_TYPE_SWITCH) { + return new ThemeSwitchItemViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_theme_color_item, parent, false)); + } + + return new ThemeColorItemViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_theme_color_item, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof ThemeColorItemViewHolder) { + CustomThemeSettingsItem customThemeSettingsItem = customThemeSettingsItems.get(position); + ((ThemeColorItemViewHolder) holder).themeItemNameTextView.setText(customThemeSettingsItem.itemName); + ((ThemeColorItemViewHolder) holder).themeItemInfoTextView.setText(customThemeSettingsItem.itemDetails); + ((ThemeColorItemViewHolder) holder).colorImageView.setBackgroundTintList(ColorStateList.valueOf(customThemeSettingsItem.colorValue)); + holder.itemView.setOnClickListener(view -> { + + }); + } else if (holder instanceof ThemeSwitchItemViewHolder) { + CustomThemeSettingsItem customThemeSettingsItem = customThemeSettingsItems.get(position); + ((ThemeSwitchItemViewHolder) holder).themeItemNameTextView.setText(customThemeSettingsItem.itemName); + ((ThemeSwitchItemViewHolder) holder).themeItemInfoTextView.setText(customThemeSettingsItem.itemName); + ((ThemeSwitchItemViewHolder) holder).themeItemSwitch.setChecked(customThemeSettingsItem.isEnabled); + ((ThemeSwitchItemViewHolder) holder).themeItemSwitch.setOnClickListener(view -> customThemeSettingsItem.isEnabled = ((ThemeSwitchItemViewHolder) holder).themeItemSwitch.isChecked()); + holder.itemView.setOnClickListener(view -> ((ThemeSwitchItemViewHolder) holder).themeItemSwitch.performClick()); + } + } + + @Override + public int getItemCount() { + return customThemeSettingsItems.size(); + } + + public void setCustomThemeSettingsItem(ArrayList customThemeSettingsItems) { + this.customThemeSettingsItems.clear(); + notifyDataSetChanged(); + this.customThemeSettingsItems.addAll(customThemeSettingsItems); + notifyDataSetChanged(); + } + + class ThemeColorItemViewHolder extends RecyclerView.ViewHolder { + @BindView(R.id.color_image_view_item_theme_color_item) + View colorImageView; + @BindView(R.id.theme_item_name_text_view_item_theme_color_item) + TextView themeItemNameTextView; + @BindView(R.id.theme_item_info_text_view_item_theme_color_item) + TextView themeItemInfoTextView; + + ThemeColorItemViewHolder(@NonNull View itemView) { + super(itemView); + ButterKnife.bind(this, itemView); + } + } + + class ThemeSwitchItemViewHolder extends RecyclerView.ViewHolder { + @BindView(R.id.theme_item_name_text_view_item_theme_switch_item) + TextView themeItemNameTextView; + @BindView(R.id.theme_item_info_text_view_item_theme_switch_item) + TextView themeItemInfoTextView; + @BindView(R.id.theme_item_switch_item_theme_switch_item) + Switch themeItemSwitch; + + ThemeSwitchItemViewHolder(@NonNull View itemView) { + super(itemView); + ButterKnife.bind(this, itemView); + } + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java index c374282d..a5504f4a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/PostRecyclerViewAdapter.java @@ -180,13 +180,13 @@ public class PostRecyclerViewAdapter extends PagedListAdapter> getAllCustomThemes(); + @Query("SELECT * FROM custom_themes WHERE is_light_theme = 1 LIMIT 1") + LiveData getLightCustomTheme(); + + @Query("SELECT * FROM custom_themes WHERE is_dark_theme = 1 LIMIT 1") + LiveData getDarkCustomTheme(); + + @Query("SELECT * FROM custom_themes WHERE is_amoled_theme = 1 LIMIT 1") + LiveData getAmoledCustomTheme(); + @Query("SELECT * FROM custom_themes WHERE name = :name AND username = :username COLLATE NOCASE LIMIT 1") CustomTheme getCustomTheme(String name, String username); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java index e2c0b692..cedc4513 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeRepository.java @@ -8,12 +8,30 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; public class CustomThemeRepository { private LiveData> mAllCustomThemes; + private LiveData mLightCustomTheme; + private LiveData mDarkCustomTheme; + private LiveData mAmoledCustomTheme; CustomThemeRepository(RedditDataRoomDatabase redditDataRoomDatabase) { mAllCustomThemes = redditDataRoomDatabase.customThemeDao().getAllCustomThemes(); + mLightCustomTheme = redditDataRoomDatabase.customThemeDao().getLightCustomTheme(); + mDarkCustomTheme = redditDataRoomDatabase.customThemeDao().getDarkCustomTheme(); + mAmoledCustomTheme = redditDataRoomDatabase.customThemeDao().getAmoledCustomTheme(); } LiveData> getAllCustomThemes() { return mAllCustomThemes; } + + public LiveData getLightCustomTheme() { + return mLightCustomTheme; + } + + public LiveData getDarkCustomTheme() { + return mDarkCustomTheme; + } + + public LiveData getAmoledCustomTheme() { + return mAmoledCustomTheme; + } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeSettingsItem.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeSettingsItem.java new file mode 100644 index 00000000..1dfd7f59 --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeSettingsItem.java @@ -0,0 +1,292 @@ +package ml.docilealligator.infinityforreddit.CustomTheme; + +import android.content.Context; + +import java.util.ArrayList; + +import ml.docilealligator.infinityforreddit.R; + +public class CustomThemeSettingsItem { + public String itemName; + public String itemDetails; + public int colorValue; + public boolean isEnabled; + + private CustomThemeSettingsItem(String itemName, String itemDetails, int colorValue) { + this.itemName = itemName; + this.itemDetails = itemDetails; + this.colorValue = colorValue; + } + + private CustomThemeSettingsItem(String itemName, boolean isEnabled) { + this.itemName = itemName; + this.isEnabled = isEnabled; + } + + public static ArrayList convertCustomTheme(Context context, CustomTheme customTheme) { + ArrayList customThemeSettingsItems = new ArrayList<>(); + + if (customTheme == null) { + return customThemeSettingsItems; + } + + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_color_primary), + context.getString(R.string.theme_item_color_primary_detail), + customTheme.colorPrimary)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_color_primary_dark), + context.getString(R.string.theme_item_color_primary_dark_detail), + customTheme.colorPrimaryDark)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_color_accent), + context.getString(R.string.theme_item_color_accent_detail), + customTheme.colorAccent)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_color_primary_light_theme), + context.getString(R.string.theme_item_color_primary_light_theme_detail), + customTheme.colorPrimaryLightTheme)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_primary_text_color), + context.getString(R.string.theme_item_primary_text_color_detail), + customTheme.primaryTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_secondary_text_color), + context.getString(R.string.theme_item_secondary_text_color_detail), + customTheme.secondaryTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_post_title_color), + context.getString(R.string.theme_item_post_title_color_detail), + customTheme.postTitleColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_post_content_color), + context.getString(R.string.theme_item_post_content_color_detail), + customTheme.postContentColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_color), + context.getString(R.string.theme_item_comment_color_detail), + customTheme.commentColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_button_text_color), + context.getString(R.string.theme_item_button_text_color_detail), + customTheme.buttonTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_chip_text_color), + context.getString(R.string.theme_item_chip_text_color_detail), + customTheme.chipTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_background_color), + context.getString(R.string.theme_item_background_color_detail), + customTheme.backgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_card_view_background_color), + context.getString(R.string.theme_item_card_view_background_color_detail), + customTheme.cardViewBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_background_color), + context.getString(R.string.theme_item_comment_background_color_detail), + customTheme.commentBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_bottom_app_bar_background_color), + context.getString(R.string.theme_item_bottom_app_bar_background_color_detail), + customTheme.bottomAppBarBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_primary_icon_color), + context.getString(R.string.theme_item_primary_icon_color_detail), + customTheme.primaryIconColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_post_icon_and_info_color), + context.getString(R.string.theme_item_post_icon_and_info_color_detail), + customTheme.postIconAndInfoColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_icon_and_info_color), + context.getString(R.string.theme_item_comment_icon_and_info_color_detail), + customTheme.commentIconAndInfoColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_fab_icon_color), + context.getString(R.string.theme_item_fab_icon_color_detail), + customTheme.fabIconColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_toolbar_primary_text_and_icon_color), + context.getString(R.string.theme_item_toolbar_primary_text_and_icon_color_detail), + customTheme.toolbarPrimaryTextAndIconColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_toolbar_secondary_text_color), + context.getString(R.string.theme_item_toolbar_secondary_text_color_detail), + customTheme.toolbarSecondaryTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_circular_progress_bar_background_color), + context.getString(R.string.theme_item_circular_progress_bar_background_color_detail), + customTheme.circularProgressBarBackground)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background), + context.getString(R.string.theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_background_detail), + customTheme.tabLayoutWithExpandedCollapsingToolbarTabBackground)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color), + context.getString(R.string.theme_item_tab_layout_with_expanded_collapsing_toolbar_text_color_detail), + customTheme.tabLayoutWithExpandedCollapsingToolbarTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator), + context.getString(R.string.theme_item_tab_layout_with_expanded_collapsing_toolbar_tab_indicator_detail), + customTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background), + context.getString(R.string.theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_background_detail), + customTheme.tabLayoutWithCollapsedCollapsingToolbarTabBackground)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color), + context.getString(R.string.theme_item_tab_layout_with_collapsed_collapsing_toolbar_text_color_detail), + customTheme.tabLayoutWithCollapsedCollapsingToolbarTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator), + context.getString(R.string.theme_item_tab_layout_with_collapsed_collapsing_toolbar_tab_indicator_detail), + customTheme.tabLayoutWithCollapsedCollapsingToolbarTabIndicator)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_upvoted_color), + context.getString(R.string.theme_item_upvoted_color_detail), + customTheme.upvoted)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_downvoted_color), + context.getString(R.string.theme_item_downvoted_color_detail), + customTheme.downvoted)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_post_type_background_color), + context.getString(R.string.theme_item_post_type_background_color_detail), + customTheme.postTypeBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_post_type_text_color), + context.getString(R.string.theme_item_post_type_text_color_detail), + customTheme.postTypeTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_spoiler_background_color), + context.getString(R.string.theme_item_spoiler_background_color_detail), + customTheme.spoilerBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_spoiler_text_color), + context.getString(R.string.theme_item_spoiler_text_color_detail), + customTheme.spoilerTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_nsfw_background_color), + context.getString(R.string.theme_item_nsfw_background_color_detail), + customTheme.nsfwBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_nsfw_text_color), + context.getString(R.string.theme_item_nsfw_text_color_detail), + customTheme.nsfwTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_flair_background_color), + context.getString(R.string.theme_item_flair_background_color_detail), + customTheme.flairBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_flair_text_color), + context.getString(R.string.theme_item_flair_text_color_detail), + customTheme.flairTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_archived_tint), + context.getString(R.string.theme_item_archived_tint_detail), + customTheme.archivedTint)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_locked_icon_tint), + context.getString(R.string.theme_item_locked_icon_tint_detail), + customTheme.lockedIconTint)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_crosspost_icon_tint), + context.getString(R.string.theme_item_crosspost_icon_tint_detail), + customTheme.crosspostIconTint)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_stickied_post_icon_tint), + context.getString(R.string.theme_item_stickied_post_icon_tint_detail), + customTheme.stickiedPostIconTint)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_subscribed_color), + context.getString(R.string.theme_item_subscribed_color_detail), + customTheme.subscribed)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_unsubscribed_color), + context.getString(R.string.theme_item_unsubscribed_color_detail), + customTheme.unsubscribed)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_username_color), + context.getString(R.string.theme_item_username_color_detail), + customTheme.username)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_subreddit_color), + context.getString(R.string.theme_item_subreddit_color_detail), + customTheme.subreddit)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_author_flair_text_color), + context.getString(R.string.theme_item_author_flair_text_color_detail), + customTheme.authorFlairTextColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_submitter_color), + context.getString(R.string.theme_item_submitter_color_detail), + customTheme.submitter)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_moderator_color), + context.getString(R.string.theme_item_moderator_color_detail), + customTheme.moderator)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_single_comment_thread_background_color), + context.getString(R.string.theme_item_single_comment_thread_background_color_detail), + customTheme.singleCommentThreadBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_unread_message_background_color), + context.getString(R.string.theme_item_unread_message_background_color_detail), + customTheme.unreadMessageBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_divider_color), + context.getString(R.string.theme_item_divider_color_detail), + customTheme.dividerColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_no_preview_link_background_color), + context.getString(R.string.theme_item_no_preview_link_background_color_detail), + customTheme.noPreviewLinkBackgroundColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_vote_and_reply_unavailable_button_color), + context.getString(R.string.theme_item_vote_and_reply_unavailable_button_color_detail), + customTheme.voteAndReplyUnavailableButtonColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_1), + context.getString(R.string.theme_item_comment_vertical_bar_color_1_detail), + customTheme.commentVerticalBarColor1)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_2), + context.getString(R.string.theme_item_comment_vertical_bar_color_2_detail), + customTheme.commentVerticalBarColor2)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_3), + context.getString(R.string.theme_item_comment_vertical_bar_color_3_detail), + customTheme.commentVerticalBarColor3)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_4), + context.getString(R.string.theme_item_comment_vertical_bar_color_4_detail), + customTheme.commentVerticalBarColor4)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_5), + context.getString(R.string.theme_item_comment_vertical_bar_color_5_detail), + customTheme.commentVerticalBarColor5)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_6), + context.getString(R.string.theme_item_comment_vertical_bar_color_6_detail), + customTheme.commentVerticalBarColor6)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_comment_vertical_bar_color_7), + context.getString(R.string.theme_item_comment_vertical_bar_color_7_detail), + customTheme.commentVerticalBarColor7)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_nav_bar_color), + context.getString(R.string.theme_item_nav_bar_color_detail), + customTheme.navBarColor)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_light_status_bar), + customTheme.isLightStatusBar)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_light_nav_bar), + customTheme.isLightNavBar)); + customThemeSettingsItems.add(new CustomThemeSettingsItem( + context.getString(R.string.theme_item_change_status_bar_icon_color_after_toolbar_collapsed_in_immersive_interface), + customTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface)); + return customThemeSettingsItems; + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java index 44a43f23..227e641e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeViewModel.java @@ -11,15 +11,34 @@ import ml.docilealligator.infinityforreddit.RedditDataRoomDatabase; public class CustomThemeViewModel extends ViewModel { private LiveData> mAllCustomThemes; + private LiveData mLightCustomTheme; + private LiveData mDarkCustomTheme; + private LiveData mAmoledCustomTheme; public CustomThemeViewModel(RedditDataRoomDatabase redditDataRoomDatabase) { - mAllCustomThemes = new CustomThemeRepository(redditDataRoomDatabase).getAllCustomThemes(); + CustomThemeRepository customThemeRepository = new CustomThemeRepository(redditDataRoomDatabase); + mAllCustomThemes = customThemeRepository.getAllCustomThemes(); + mLightCustomTheme = customThemeRepository.getLightCustomTheme(); + mDarkCustomTheme = customThemeRepository.getDarkCustomTheme(); + mAmoledCustomTheme = customThemeRepository.getAmoledCustomTheme(); } public LiveData> getAllCustomThemes() { return mAllCustomThemes; } + public LiveData getLightCustomTheme() { + return mLightCustomTheme; + } + + public LiveData getDarkCustomTheme() { + return mDarkCustomTheme; + } + + public LiveData getAmoledCustomTheme() { + return mAmoledCustomTheme; + } + public static class Factory extends ViewModelProvider.NewInstanceFactory { private RedditDataRoomDatabase mRedditDataRoomDatabase; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java index bcb46f7e..2546c9f2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CustomTheme/CustomThemeWrapper.java @@ -138,9 +138,9 @@ public class CustomThemeWrapper { getDefaultColor("#FFFFFF", "#FFFFFF", "#FFFFFF")); } - public int getToolbarAndTabBackgroundColor() { - return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.TOOLBAR_AND_TAB_BACKGROUND_COLOR, - getDefaultColor("#1565C0", "#282828", "#000000")); + public int getToolbarSecondaryTextColor() { + return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.TOOLBAR_SECONDARY_TEXT_COLOR, + getDefaultColor("#FFFFFF", "#FFFFFF", "#FFFFFF")); } public int getCircularProgressBarBackground() { @@ -178,11 +178,6 @@ public class CustomThemeWrapper { getDefaultColor("#FFFFFF", "#FFFFFF", "#FFFFFF")); } - public int getNavBarColor() { - return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.NAV_BAR_COLOR, - getDefaultColor("#FFFFFF", "#121212", "#000000")); - } - public int getUpvoted() { return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.UPVOTED, getDefaultColor("#E91E63", "#E91E63", "#E91E63")); @@ -233,8 +228,8 @@ public class CustomThemeWrapper { getDefaultColor("#FFFFFF", "#FFFFFF", "#FFFFFF")); } - public int getArchivedTint() { - return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.ARCHIVED_TINT, + public int getArchivedIconTint() { + return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.ARCHIVED_ICON_TINT, getDefaultColor("#B4009F", "#B4009F", "#B4009F")); } @@ -308,8 +303,8 @@ public class CustomThemeWrapper { getDefaultColor("#E0E0E0", "#424242", "#424242")); } - public int getVoteAndReplyUnavailableVoteButtonColor() { - return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.VOTE_AND_REPLY_UNAVAILABLE_VOTE_BUTTON_COLOR, + public int getVoteAndReplyUnavailableButtonColor() { + return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.VOTE_AND_REPLY_UNAVAILABLE_BUTTON_COLOR, getDefaultColor("#F0F0F0", "#3C3C3C", "#3C3C3C")); } @@ -358,6 +353,11 @@ public class CustomThemeWrapper { getDefaultColor("#FFFFFF", "#FFFFFF", "#FFFFFF")); } + public int getNavBarColor() { + return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.NAV_BAR_COLOR, + getDefaultColor("#FFFFFF", "#121212", "#000000")); + } + public boolean isLightStatusBar() { return getThemeSharedPreferences().getBoolean(CustomThemeSharedPreferencesUtils.LIGHT_STATUS_BAR, false); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java index e6d31728..0225d14a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RedditDataRoomDatabase.java @@ -125,8 +125,9 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase { "button_text_color INTEGER NOT NULL, background_color INTEGER NOT NULL," + "card_view_background_color INTEGER NOT NULL, comment_background_color INTEGER NOT NULL," + "bottom_app_bar_background_color INTEGER NOT NULL, primary_icon_color INTEGER NOT NULL," + + "post_icon_and_info_color INTEGER NOT NULL," + "comment_icon_and_info_color INTEGER NOT NULL, toolbar_primary_text_and_icon_color INTEGER NOT NULL," + - "toolbar_and_tab_background_color INTEGER NOT NULL, circular_progress_bar_background INTEGER NOT NULL," + + "toolbar_secondary_text_color INTEGER NOT NULL, circular_progress_bar_background INTEGER NOT NULL," + "tab_layout_with_expanded_collapsing_toolbar_tab_background INTEGER NOT NULL," + "tab_layout_with_expanded_collapsing_toolbar_text_color INTEGER NOT NULL," + "tab_layout_with_expanded_collapsing_toolbar_tab_indicator INTEGER NOT NULL," + @@ -146,7 +147,7 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase { "single_comment_thread_background_color INTEGER NOT NULL," + "unread_message_background_color INTEGER NOT NULL, divider_color INTEGER NOT NULL," + "no_preview_link_background_color INTEGER NOT NULL," + - "vote_and_reply_unavailable_vote_button_color INTEGER NOT NULL," + + "vote_and_reply_unavailable_button_color INTEGER NOT NULL," + "comment_vertical_bar_color_1 INTEGER NOT NULL, comment_vertical_bar_color_2 INTEGER NOT NULL," + "comment_vertical_bar_color_3 INTEGER NOT NULL, comment_vertical_bar_color_4 INTEGER NOT NULL," + "comment_vertical_bar_color_5 INTEGER NOT NULL, comment_vertical_bar_color_6 INTEGER NOT NULL," + 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 516e3c93..58dbf619 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/ThemePreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/ThemePreferenceFragment.java @@ -1,15 +1,17 @@ package ml.docilealligator.infinityforreddit.Settings; -import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import androidx.annotation.NonNull; +import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; import androidx.fragment.app.Fragment; import androidx.preference.ListPreference; +import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; import androidx.preference.SwitchPreference; @@ -17,6 +19,7 @@ import org.greenrobot.eventbus.EventBus; import javax.inject.Inject; +import ml.docilealligator.infinityforreddit.Activity.CustomizeThemeActivity; import ml.docilealligator.infinityforreddit.CustomTheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.Event.RecreateActivityEvent; import ml.docilealligator.infinityforreddit.Infinity; @@ -34,7 +37,7 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES; */ public class ThemePreferenceFragment extends PreferenceFragmentCompat { - private Activity activity; + private AppCompatActivity activity; @Inject CustomThemeWrapper customThemeWrapper; @@ -46,6 +49,9 @@ public class ThemePreferenceFragment extends PreferenceFragmentCompat { ListPreference themePreference = findPreference(SharedPreferencesUtils.THEME_KEY); SwitchPreference amoledDarkSwitch = findPreference(SharedPreferencesUtils.AMOLED_DARK_KEY); + Preference customizeLightThemePreference = findPreference(SharedPreferencesUtils.CUSTOMIZE_LIGHT_THEME); + Preference customizeDarkThemePreference = findPreference(SharedPreferencesUtils.CUSTOMIZE_DARK_THEME); + Preference customizeAmoledThemePreference = findPreference(SharedPreferencesUtils.CUSTOMIZE_AMOLED_THEME); boolean systemDefault = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q; if (themePreference != null && amoledDarkSwitch != null) { @@ -100,11 +106,38 @@ public class ThemePreferenceFragment extends PreferenceFragmentCompat { return true; }); } + + if (customizeLightThemePreference != null) { + customizeLightThemePreference.setOnPreferenceClickListener(preference -> { + Intent intent = new Intent(activity, CustomizeThemeActivity.class); + intent.putExtra(CustomizeThemeActivity.EXTRA_THEME_TYPE, CustomizeThemeActivity.EXTRA_LIGHT_THEME); + startActivity(intent); + return false; + }); + } + + if (customizeDarkThemePreference != null) { + customizeDarkThemePreference.setOnPreferenceClickListener(preference -> { + Intent intent = new Intent(activity, CustomizeThemeActivity.class); + intent.putExtra(CustomizeThemeActivity.EXTRA_THEME_TYPE, CustomizeThemeActivity.EXTRA_DARK_THEME); + startActivity(intent); + return false; + }); + } + + if (customizeAmoledThemePreference != null) { + customizeAmoledThemePreference.setOnPreferenceClickListener(preference -> { + Intent intent = new Intent(activity, CustomizeThemeActivity.class); + intent.putExtra(CustomizeThemeActivity.EXTRA_THEME_TYPE, CustomizeThemeActivity.EXTRA_AMOLED_THEME); + startActivity(intent); + return false; + }); + } } @Override public void onAttach(@NonNull Context context) { super.onAttach(context); - activity = (Activity) context; + activity = (AppCompatActivity) context; } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/CustomThemeSharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/CustomThemeSharedPreferencesUtils.java index 44559721..a4631521 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/CustomThemeSharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/CustomThemeSharedPreferencesUtils.java @@ -28,7 +28,7 @@ public class CustomThemeSharedPreferencesUtils { public static final String POST_ICON_AND_INFO_COLOR = "postIconAndInfoColor"; public static final String COMMENT_ICON_AND_INFO_COLOR = "commentIconAndInfoColor"; public static final String TOOLBAR_PRIMARY_TEXT_AND_ICON_COLOR = "toolbarPrimaryTextAndIconColor"; - public static final String TOOLBAR_AND_TAB_BACKGROUND_COLOR = "toolbarAndTabBackgroundColor"; + public static final String TOOLBAR_SECONDARY_TEXT_COLOR = "toolbarSecondaryTextColor"; public static final String CIRCULAR_PROGRESS_BAR_BACKGROUND = "circularProgressBarBackground"; public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TAB_BACKGROUND = "tabLayoutWithExpandedCollapsingToolbarTabBackground"; public static final String TAB_LAYOUT_WITH_EXPANDED_COLLAPSING_TOOLBAR_TEXT_COLOR = "tabLayoutWithExpandedCollapsingToolbarTextColor"; @@ -47,7 +47,7 @@ public class CustomThemeSharedPreferencesUtils { public static final String NSFW_TEXT_COLOR = "nsfwTextColor"; public static final String FLAIR_BACKGROUND_COLOR = "flairBackgroundColor"; public static final String FLAIR_TEXT_COLOR = "flairTextColor"; - public static final String ARCHIVED_TINT = "archivedTint"; + public static final String ARCHIVED_ICON_TINT = "archivedIconTint"; public static final String LOCKED_ICON_TINT = "lockedIconTint"; public static final String CROSSPOST_ICON_TINT = "crosspostIconTint"; public static final String STICKIED_POST_ICON_TINT = "stickiedPost"; @@ -62,7 +62,7 @@ public class CustomThemeSharedPreferencesUtils { public static final String UNREAD_MESSAGE_BACKGROUND_COLOR = "unreadMessageBackgroundColor"; public static final String DIVIDER_COLOR = "dividerColor"; public static final String NO_PREVIEW_LINK_BACKGROUND_COLOR = "noPreviewLinkBackgroundColor"; - public static final String VOTE_AND_REPLY_UNAVAILABLE_VOTE_BUTTON_COLOR = "voteAndReplyUnavailableVoteButtonColor"; + public static final String VOTE_AND_REPLY_UNAVAILABLE_BUTTON_COLOR = "voteAndReplyUnavailableButtonColor"; public static final String COMMENT_VERTICAL_BAR_COLOR_1 = "commentVerticalBarColor1"; public static final String COMMENT_VERTICAL_BAR_COLOR_2 = "commentVerticalBarColor2"; public static final String COMMENT_VERTICAL_BAR_COLOR_3 = "commentVerticalBarColor3"; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java index 0ff474bd..ef15d5e6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java @@ -77,4 +77,7 @@ public class SharedPreferencesUtils { public static final String LOCK_BOTTOM_APP_BAR = "lock_bottom_app_bar"; public static final String SHOW_COMMENT_DIVIDER = "show_comment_divider"; public static final String SHOW_ABSOLUTE_NUMBER_OF_VOTES = "show_absolute_number_of_votes"; + public static final String CUSTOMIZE_LIGHT_THEME = "customize_light_theme"; + public static final String CUSTOMIZE_DARK_THEME = "customize_dark_theme"; + public static final String CUSTOMIZE_AMOLED_THEME = "customize_amoled_theme"; } diff --git a/app/src/main/res/drawable-night/ic_dark_theme_preference_24dp.xml b/app/src/main/res/drawable-night/ic_dark_theme_preference_24dp.xml new file mode 100644 index 00000000..3ea2743e --- /dev/null +++ b/app/src/main/res/drawable-night/ic_dark_theme_preference_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-night/ic_light_theme_preference_24dp.xml b/app/src/main/res/drawable-night/ic_light_theme_preference_24dp.xml new file mode 100644 index 00000000..8a7d0fe8 --- /dev/null +++ b/app/src/main/res/drawable-night/ic_light_theme_preference_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/circular_background.xml b/app/src/main/res/drawable/circular_background.xml new file mode 100644 index 00000000..5f6c58ee --- /dev/null +++ b/app/src/main/res/drawable/circular_background.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_dark_theme_preference_24dp.xml b/app/src/main/res/drawable/ic_dark_theme_preference_24dp.xml new file mode 100644 index 00000000..24ef45dd --- /dev/null +++ b/app/src/main/res/drawable/ic_dark_theme_preference_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_light_theme_preference_24dp.xml b/app/src/main/res/drawable/ic_light_theme_preference_24dp.xml new file mode 100644 index 00000000..5eb72292 --- /dev/null +++ b/app/src/main/res/drawable/ic_light_theme_preference_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/activity_customize_theme.xml b/app/src/main/res/layout/activity_customize_theme.xml new file mode 100644 index 00000000..362772a1 --- /dev/null +++ b/app/src/main/res/layout/activity_customize_theme.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 50dd0290..7e10c9ad 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -2,7 +2,6 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:id="@+id/coordinator_layout_settings_activity" android:background="?attr/backgroundColor"> + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_theme_switch_item.xml b/app/src/main/res/layout/item_theme_switch_item.xml new file mode 100644 index 00000000..4b337fc8 --- /dev/null +++ b/app/src/main/res/layout/item_theme_switch_item.xml @@ -0,0 +1,32 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 45f7b7e5..158495c7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -357,6 +357,10 @@ r/Infinity_For_Reddit Share Share this app to other people if you enjoy it + Customization + Light Theme + Dark Theme + Amoled Theme Cannot get the link @@ -460,6 +464,138 @@ Saving the image. Please wait. Saving the gif. Please wait. - - Hello blank fragment + Customize Light Theme + Customize Dark Theme + Customize Amoled Theme + + Color Primary + Applied to: Toolbar + Color Primary Dark + Applied to: Status Bar + Color Accent + Applied to: Progress Bar, etc + Color Primary Light Theme + Has effect only when this theme is set as light theme.\nApplied to: background of Floating Action Button and Button + Primary Text Color + Applied to: Primary text + Secondary Text Color + Applied to: Secondary text + Post Title Color + Applied to: Post title + Post Content Color + Applied to: Post content + Comment Color + Applied to: Comment + Button Text Color + Applied to: Text on button + Chip Text Color + Applied to: Subscribe Button + Background Color + Applied to: Background of every page and navigation drawer + Card View Background Color + Applied to: Post background and message background + Comment Background Color + Applied to: Comment background + Bottom Navigation Bar Color + Applied to: Bottom navigation bar + Primary Icon Color + Applied to: Icons in the bottom navigation bar and the navigation drawer. + Post Icon and Info Color + Applied to: Icons, score and the number of comments in posts + Comment Icon and Info Color + Applied to: Icons and score in comments + Floating Action Button Icon Color + Applied to: Floating action button icon + Toolbar Primary Text and Icon Color + Applied to: Primary texts and icons in toolbars + Toolbar Secondary Text Color + Applied to: Secondary texts in toolbars + Circular Progress Bar Background Color + Applied to: Background of Circular progress bar + Background Color of Tab Layout in Expanded Toolbar + Applied to: Tab layout background (expanded toolbar) + Text Color of Tab Layout in Expanded Toolbar + Applied to: Tab layout text color (expanded toolbar) + Tab Indicator Color of Tab Layout in Expanded Toolbar + Applied to: Tab indicator color in tab layout (expanded toolbar) + Background Color of Tab Layout in Collapsed Toolbar + Applied to: Tab layout background (collapsed toolbar) + Text Color of Tab Layout in Collapsed Toolbar + Applied to: Tab layout text color (collapsed toolbar) + Tab Indicator Color of Tab Layout in Collapsed Toolbar + Applied to: Tab indicator color in tab layout (collapsed toolbar) + Upvoted Color + Applied to: Vote buttons and scores (upvoted) + Downvoted Color + Applied to: Vote buttons and scores (downvoted) + Post Type Background Color + Applied to: Background of the post type (IMAGE, TEXT, VIDEO, GIF, LINK) + Post Type Text Color + Applied to: Text color of the post type (IMAGE, TEXT, VIDEO, GIF LINK) + Spoiler Background Color + Applied to: Background of the spoiler tag + Spoiler Text Color + Applied to: Text color in the spoiler tag + NSFW Background Color + Applied to: Background of the NSFW tag + NSFW text color + Applied to: Text color of the NSFW tag + Flair Background Color + Applied to: Background of the flair tag + Flair Text Color + Applied to: Text color of the flair tag + Archived Icon Color + Applied to: Archived icon + Locked Icon Color + Applied to: Locked icon + Crosspost Icon Color + Applied to: Crosspost icon + Stickied Post Icon Color + Applied to: Stickied post icon + Subscribed + Applied to: Unsubscribe button + Unsubscribed + Applied to: Sbscribe button + Username Color + Applied to: Username + Subreddit Color + Applied to: Subreddit name + Author Flair Color + Applied to: Author flair in comments + Submitter + Applied to: Submitter in comments + Moderator + Applied to: Moderator in comments + Single Comment Thread Background Color + Applied to: Single Comment + Unread Message Background Color + Applied to: Unread Message Background Color + Divider Color + Applied to: Comment divider, dividers in pages for submitting posts, etc. + No-Preview Link Background Color + Applied to: No-preview link placeholder + Vote and Reply Unavailable Button Color + Applied to: Vote and reply buttons (Unavailable) + Comment Vertical Bar Color 1 + Applied to: Comment Vertical Bar (Level 1) + Comment Vertical Bar Color 2 + Applied to: Comment Vertical Bar (Level 2) + Comment Vertical Bar Color 3 + Applied to: Comment Vertical Bar (Level 3) + Comment Vertical Bar Color 4 + Applied to: Comment Vertical Bar (Level 4) + Comment Vertical Bar Color 5 + Applied to: Comment Vertical Bar (Level 5) + Comment Vertical Bar Color 6 + Applied to: Comment Vertical Bar (Level 6) + Comment Vertical Bar Color 7 + Applied to: Comment Vertical Bar (Level 7) + Navigation Bar Color + Applied to: Navigation bar + Dark Status Bar Icon Color + Dark Navigation Bar Icon Color + Change Status Bar Icon Color After Toolbar Collapsed In Immersive Interface + Only available for Android 8.0 or above. + Only available for Android 6.0 or above. + diff --git a/app/src/main/res/xml/theme_preferences.xml b/app/src/main/res/xml/theme_preferences.xml index 038485e0..e7d9c13f 100644 --- a/app/src/main/res/xml/theme_preferences.xml +++ b/app/src/main/res/xml/theme_preferences.xml @@ -15,4 +15,22 @@ app:key="amoled_dark" app:title="@string/settings_amoled_dark_title" /> + + + + + + + + \ No newline at end of file