Skip to content

Commit

Permalink
Start implementing PostOptionsBottomSheetFragment. Rename some drawab…
Browse files Browse the repository at this point in the history
…les.
  • Loading branch information
Docile-Alligator committed Sep 11, 2024
1 parent fbc00b1 commit 747f5f1
Show file tree
Hide file tree
Showing 290 changed files with 756 additions and 553 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,22 +264,22 @@ protected void applyCustomTheme() {

binding.postTypeCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
binding.postTypeExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.postTypeTextTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_text_24dp, primaryIconColor), null, null, null);
binding.postTypeTextTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_text_day_night_24dp, primaryIconColor), null, null, null);
binding.postTypeTextTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.postTypeLinkTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_link, primaryIconColor), null, null, null);
binding.postTypeLinkTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_link_day_night_24dp, primaryIconColor), null, null, null);
binding.postTypeLinkTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.postTypeImageTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_image_24dp, primaryIconColor), null, null, null);
binding.postTypeImageTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_image_day_night_24dp, primaryIconColor), null, null, null);
binding.postTypeImageTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.postTypeGifTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_image_24dp, primaryIconColor), null, null, null);
binding.postTypeGifTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_image_day_night_24dp, primaryIconColor), null, null, null);
binding.postTypeGifTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.postTypeVideoTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_outline_video_24dp, primaryIconColor), null, null, null);
binding.postTypeVideoTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_video_day_night_24dp, primaryIconColor), null, null, null);
binding.postTypeVideoTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.postTypeGalleryTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_gallery_24dp, primaryIconColor), null, null, null);
binding.postTypeGalleryTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_gallery_day_night_24dp, primaryIconColor), null, null, null);
binding.postTypeGalleryTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);

binding.onlyNsfwSpoilerCardViewCustomizePostFilterActivity.setCardBackgroundColor(filledCardViewBackgroundColor);
binding.onlyNsfwSpoilerExplanationTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.onlyNsfwTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_nsfw_on_24dp, primaryIconColor), null, null, null);
binding.onlyNsfwTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_nsfw_on_day_night_24dp, primaryIconColor), null, null, null);
binding.onlyNsfwTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
binding.onlySpoilerTextViewCustomizePostFilterActivity.setCompoundDrawablesWithIntrinsicBounds(Utils.getTintedDrawable(this, R.drawable.ic_spoiler_black_24dp, primaryIconColor), null, null, null);
binding.onlySpoilerTextViewCustomizePostFilterActivity.setTextColor(primaryTextColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ protected void applyCustomTheme() {
binding.getRoot().setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(binding.appbarLayoutLoginActivity, null, binding.toolbarLoginActivity);
binding.twoFaInfOTextViewLoginActivity.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
Drawable infoDrawable = Utils.getTintedDrawable(this, R.drawable.ic_info_preference_24dp, mCustomThemeWrapper.getPrimaryIconColor());
Drawable infoDrawable = Utils.getTintedDrawable(this, R.drawable.ic_info_preference_day_night_24dp, mCustomThemeWrapper.getPrimaryIconColor());
binding.twoFaInfOTextViewLoginActivity.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null);
applyFABTheme(binding.fabLoginActivity);
if (typeface != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,43 +510,43 @@ private void bottomAppBarOptionAction(int option) {
private int getBottomAppBarOptionDrawableResource(int option) {
switch (option) {
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SUBSCRIPTIONS:
return R.drawable.ic_subscritptions_bottom_app_bar_24dp;
return R.drawable.ic_subscriptions_bottom_app_bar_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_MULTIREDDITS:
return R.drawable.ic_multi_reddit_24dp;
return R.drawable.ic_multi_reddit_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_INBOX:
return R.drawable.ic_inbox_24dp;
return R.drawable.ic_inbox_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SUBMIT_POSTS:
return R.drawable.ic_add_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_REFRESH:
return R.drawable.ic_refresh_24dp;
return R.drawable.ic_refresh_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_CHANGE_SORT_TYPE:
return R.drawable.ic_sort_toolbar_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_CHANGE_POST_LAYOUT:
return R.drawable.ic_post_layout_24dp;
return R.drawable.ic_post_layout_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SEARCH:
return R.drawable.ic_search_24dp;
return R.drawable.ic_search_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GO_TO_SUBREDDIT:
return R.drawable.ic_subreddit_24dp;
return R.drawable.ic_subreddit_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GO_TO_USER:
return R.drawable.ic_user_24dp;
return R.drawable.ic_user_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_RANDOM:
return R.drawable.ic_random_24dp;
return R.drawable.ic_random_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDE_READ_POSTS:
return R.drawable.ic_hide_read_posts_24dp;
return R.drawable.ic_hide_read_posts_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_FILTER_POSTS:
return R.drawable.ic_filter_24dp;
return R.drawable.ic_filter_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_UPVOTED:
return R.drawable.ic_arrow_upward_black_24dp;
return R.drawable.ic_arrow_upward_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_DOWNVOTED:
return R.drawable.ic_arrow_downward_black_24dp;
return R.drawable.ic_arrow_downward_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_HIDDEN:
return R.drawable.ic_outline_lock_24dp;
return R.drawable.ic_lock_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_SAVED:
return R.drawable.ic_outline_bookmarks_24dp;
return R.drawable.ic_bookmarks_day_night_24dp;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_OPTION_GO_TO_TOP:
return R.drawable.ic_keyboard_double_arrow_up_24;
return R.drawable.ic_keyboard_double_arrow_up_day_night_24dp;
default:
return R.drawable.ic_account_circle_24dp;
return R.drawable.ic_account_circle_day_night_24dp;
}
}

Expand Down Expand Up @@ -647,54 +647,54 @@ private void bindView() {
SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) {
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_REFRESH:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_refresh_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_refresh_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_refresh));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_sort_toolbar_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_change_sort_type));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_post_layout_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_post_layout_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_change_post_layout));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_SEARCH:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_search_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_search_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_search));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_GO_TO_SUBREDDIT:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_subreddit_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_subreddit_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_go_to_subreddit));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_GO_TO_USER:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_user_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_user_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_go_to_user));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_RANDOM:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_random_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_random_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_random));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS:
if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) {
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_day_night_24dp);
fabOption = SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_filter_posts));
} else {
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_hide_read_posts_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_hide_read_posts_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_hide_read_posts));
}
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_FILTER_POSTS:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_filter_posts));
break;
case SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_GO_TO_TOP:
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_keyboard_double_arrow_up_24);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_keyboard_double_arrow_up_day_night_24dp);
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_go_to_top));
break;
default:
if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) {
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_24dp);
navigationWrapper.floatingActionButton.setImageResource(R.drawable.ic_filter_day_night_24dp);
fabOption = SharedPreferencesUtils.MAIN_ACTIVITY_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
navigationWrapper.floatingActionButton.setContentDescription(getString(R.string.content_description_filter_posts));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,43 +279,43 @@ public void onPageSelected(int position) {
fabOption = bottomAppBarSharedPreference.getInt(SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB, SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SUBMIT_POSTS);
switch (fabOption) {
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_REFRESH:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_refresh_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_refresh_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_SORT_TYPE:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_sort_toolbar_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_CHANGE_POST_LAYOUT:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_post_layout_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_post_layout_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_SEARCH:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_search_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_search_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_SUBREDDIT:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_subreddit_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_subreddit_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_USER:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_user_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_user_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_RANDOM:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_random_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_random_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_HIDE_READ_POSTS:
if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_day_night_24dp);
fabOption = SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
} else {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_hide_read_posts_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_hide_read_posts_day_night_24dp);
}
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_day_night_24dp);
break;
case SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_GO_TO_TOP:
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_keyboard_double_arrow_up_24);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_keyboard_double_arrow_up_day_night_24dp);
break;
default:
if (accountName.equals(Account.ANONYMOUS_ACCOUNT)) {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_24dp);
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_filter_day_night_24dp);
fabOption = SharedPreferencesUtils.OTHER_ACTIVITIES_BOTTOM_APP_BAR_FAB_FILTER_POSTS;
} else {
binding.fabSearchResultActivity.setImageResource(R.drawable.ic_add_day_night_24dp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void onLoadCleared(@Nullable Drawable placeholder) {
binding.playButtonImageViewSubmitCrosspostActivity.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_play_circle_36dp));
} else if (post.getPostType() == Post.GALLERY_TYPE) {
binding.playButtonImageViewSubmitCrosspostActivity.setVisibility(View.VISIBLE);
binding.playButtonImageViewSubmitCrosspostActivity.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_gallery_24dp));
binding.playButtonImageViewSubmitCrosspostActivity.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_gallery_day_night_24dp));
}
}
}
Expand Down
Loading

0 comments on commit 747f5f1

Please sign in to comment.