Continue migrating to Material Design 3.

This commit is contained in:
Alex Ning 2021-10-30 22:12:30 +08:00
parent 4ab8f037f2
commit d6a66749d3
63 changed files with 142 additions and 75 deletions

View File

@ -50,10 +50,10 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
@BindView(R.id.coordinator_layout_account_posts_activity) @BindView(R.id.coordinator_layout_account_posts_activity)
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.collapsing_toolbar_layout_account_posts_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.appbar_layout_account_posts_activity) @BindView(R.id.appbar_layout_account_posts_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_account_posts_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_account_posts_activity) @BindView(R.id.toolbar_account_posts_activity)
Toolbar toolbar; Toolbar toolbar;
@Inject @Inject
@ -160,7 +160,7 @@ public class AccountPostsActivity extends BaseActivity implements SortTypeSelect
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
private void initializeFragment() { private void initializeFragment() {

View File

@ -59,10 +59,10 @@ public class AccountSavedThingActivity extends BaseActivity implements ActivityT
@BindView(R.id.coordinator_layout_account_saved_thing_activity) @BindView(R.id.coordinator_layout_account_saved_thing_activity)
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.collapsing_toolbar_layout_account_saved_thing_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.appbar_layout_account_saved_thing_activity) @BindView(R.id.appbar_layout_account_saved_thing_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_account_saved_thing_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_account_saved_thing_activity) @BindView(R.id.toolbar_account_saved_thing_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.tab_layout_tab_layout_account_saved_thing_activity_activity) @BindView(R.id.tab_layout_tab_layout_account_saved_thing_activity_activity)
@ -167,7 +167,7 @@ public class AccountSavedThingActivity extends BaseActivity implements ActivityT
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
applyTabLayoutTheme(tabLayout); applyTabLayoutTheme(tabLayout);
} }

View File

@ -13,6 +13,7 @@ import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import javax.inject.Inject; import javax.inject.Inject;
@ -32,6 +33,8 @@ public class AnonymousSubscriptionsActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_anonymous_subscriptions_activity) @BindView(R.id.appbar_layout_anonymous_subscriptions_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_anonymous_subscriptions_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_anonymous_subscriptions_activity) @BindView(R.id.toolbar_anonymous_subscriptions_activity)
Toolbar toolbar; Toolbar toolbar;
@Inject @Inject
@ -99,7 +102,7 @@ public class AnonymousSubscriptionsActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
@Override @Override

View File

@ -30,6 +30,7 @@ import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2; import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
@ -296,12 +297,15 @@ public abstract class BaseActivity extends AppCompatActivity {
isImmersiveInterfaceApplicable = false; isImmersiveInterfaceApplicable = false;
} }
protected void applyAppBarLayoutAndToolbarTheme(AppBarLayout appBarLayout, Toolbar toolbar) { protected void applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(AppBarLayout appBarLayout, @Nullable CollapsingToolbarLayout collapsingToolbarLayout, Toolbar toolbar) {
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar, true); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar, true);
} }
protected void applyAppBarLayoutAndToolbarTheme(AppBarLayout appBarLayout, Toolbar toolbar, boolean setToolbarBackgroundColor) { protected void applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(AppBarLayout appBarLayout, @Nullable CollapsingToolbarLayout collapsingToolbarLayout, Toolbar toolbar, boolean setToolbarBackgroundColor) {
appBarLayout.setBackgroundColor(customThemeWrapper.getColorPrimary()); appBarLayout.setBackgroundColor(customThemeWrapper.getColorPrimary());
if (collapsingToolbarLayout != null) {
collapsingToolbarLayout.setContentScrimColor(customThemeWrapper.getColorPrimary());
}
if (setToolbarBackgroundColor) { if (setToolbarBackgroundColor) {
toolbar.setBackgroundColor(customThemeWrapper.getColorPrimary()); toolbar.setBackgroundColor(customThemeWrapper.getColorPrimary());
} }

View File

@ -310,7 +310,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
commentParentMarkwonView.setTextColor(mCustomThemeWrapper.getCommentColor()); commentParentMarkwonView.setTextColor(mCustomThemeWrapper.getCommentColor());
divider.setBackgroundColor(mCustomThemeWrapper.getDividerColor()); divider.setBackgroundColor(mCustomThemeWrapper.getDividerColor());
commentEditText.setTextColor(mCustomThemeWrapper.getCommentColor()); commentEditText.setTextColor(mCustomThemeWrapper.getCommentColor());

View File

@ -19,6 +19,7 @@ import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
@ -47,6 +48,8 @@ public class CreateMultiRedditActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_create_multi_reddit_activity) @BindView(R.id.appbar_layout_create_multi_reddit_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_create_multi_reddit_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_create_multi_reddit_activity) @BindView(R.id.toolbar_create_multi_reddit_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.multi_reddit_name_edit_text_create_multi_reddit_activity) @BindView(R.id.multi_reddit_name_edit_text_create_multi_reddit_activity)
@ -220,7 +223,7 @@ public class CreateMultiRedditActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
nameEditText.setTextColor(primaryTextColor); nameEditText.setTextColor(primaryTextColor);

View File

@ -22,6 +22,7 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
@ -62,6 +63,8 @@ public class CustomThemeListingActivity extends BaseActivity implements
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_customize_theme_listing_activity) @BindView(R.id.appbar_layout_customize_theme_listing_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_customize_theme_listing_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_customize_theme_listing_activity) @BindView(R.id.toolbar_customize_theme_listing_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.recycler_view_customize_theme_listing_activity) @BindView(R.id.recycler_view_customize_theme_listing_activity)
@ -152,7 +155,7 @@ public class CustomThemeListingActivity extends BaseActivity implements
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
@Override @Override

View File

@ -395,7 +395,7 @@ public class CustomizePostFilterActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
int primaryIconColor = mCustomThemeWrapper.getPrimaryIconColor(); int primaryIconColor = mCustomThemeWrapper.getPrimaryIconColor();
Drawable cursorDrawable = Utils.getTintedDrawable(this, R.drawable.edit_text_cursor, primaryTextColor); Drawable cursorDrawable = Utils.getTintedDrawable(this, R.drawable.edit_text_cursor, primaryTextColor);

View File

@ -15,6 +15,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
@ -56,6 +57,8 @@ public class CustomizeThemeActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_customize_theme_activity) @BindView(R.id.appbar_layout_customize_theme_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_customize_theme_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_customize_theme_activity) @BindView(R.id.toolbar_customize_theme_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.recycler_view_customize_theme_activity) @BindView(R.id.recycler_view_customize_theme_activity)
@ -253,6 +256,6 @@ public class CustomizeThemeActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
} }

View File

@ -183,7 +183,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
contentEditText.setTextColor(mCustomThemeWrapper.getCommentColor()); contentEditText.setTextColor(mCustomThemeWrapper.getCommentColor());
} }

View File

@ -21,6 +21,7 @@ import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
@ -51,6 +52,8 @@ public class EditMultiRedditActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_edit_multi_reddit_activity) @BindView(R.id.appbar_layout_edit_multi_reddit_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_edit_multi_reddit_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_edit_multi_reddit_activity) @BindView(R.id.toolbar_edit_multi_reddit_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.progress_bar_edit_multi_reddit_activity) @BindView(R.id.progress_bar_edit_multi_reddit_activity)
@ -272,7 +275,7 @@ public class EditMultiRedditActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
progressBar.setIndeterminateTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorAccent())); progressBar.setIndeterminateTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorAccent()));
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();

View File

@ -192,7 +192,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
titleTextView.setTextColor(mCustomThemeWrapper.getPostTitleColor()); titleTextView.setTextColor(mCustomThemeWrapper.getPostTitleColor());
divider.setBackgroundColor(mCustomThemeWrapper.getPostTitleColor()); divider.setBackgroundColor(mCustomThemeWrapper.getPostTitleColor());
contentEditText.setTextColor(mCustomThemeWrapper.getPostContentColor()); contentEditText.setTextColor(mCustomThemeWrapper.getPostContentColor());

View File

@ -256,7 +256,7 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
applyFABTheme(fab); applyFABTheme(fab);
} }

View File

@ -25,6 +25,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import com.r0adkll.slidr.model.SlidrInterface; import com.r0adkll.slidr.model.SlidrInterface;
@ -68,6 +69,8 @@ public class FullMarkdownActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_comment_full_markdown_activity) @BindView(R.id.appbar_layout_comment_full_markdown_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_comment_full_markdown_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_comment_full_markdown_activity) @BindView(R.id.toolbar_comment_full_markdown_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.content_markdown_view_comment_full_markdown_activity) @BindView(R.id.content_markdown_view_comment_full_markdown_activity)
@ -277,7 +280,7 @@ public class FullMarkdownActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
@Override @Override

View File

@ -189,6 +189,6 @@ public class GiveAwardActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
} }
} }

View File

@ -73,10 +73,10 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf
@BindView(R.id.coordinator_layout_inbox_activity) @BindView(R.id.coordinator_layout_inbox_activity)
CoordinatorLayout mCoordinatorLayout; CoordinatorLayout mCoordinatorLayout;
@BindView(R.id.collapsing_toolbar_layout_inbox_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.appbar_layout_inbox_activity) @BindView(R.id.appbar_layout_inbox_activity)
AppBarLayout mAppBarLayout; AppBarLayout mAppBarLayout;
@BindView(R.id.collapsing_toolbar_layout_inbox_activity)
CollapsingToolbarLayout mCollapsingToolbarLayout;
@BindView(R.id.toolbar_inbox_activity) @BindView(R.id.toolbar_inbox_activity)
Toolbar mToolbar; Toolbar mToolbar;
@BindView(R.id.tab_layout_inbox_activity) @BindView(R.id.tab_layout_inbox_activity)
@ -238,7 +238,7 @@ public class InboxActivity extends BaseActivity implements ActivityToolbarInterf
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(mAppBarLayout, mToolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(mAppBarLayout, mCollapsingToolbarLayout, mToolbar);
applyTabLayoutTheme(tabLayout); applyTabLayoutTheme(tabLayout);
applyFABTheme(fab); applyFABTheme(fab);
} }

View File

@ -281,7 +281,7 @@ public class LoginActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
twoFAInfoTextView.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); twoFAInfoTextView.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_24dp, mCustomThemeWrapper.getPrimaryIconColor());
twoFAInfoTextView.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null); twoFAInfoTextView.setCompoundDrawablesWithIntrinsicBounds(infoDrawable, null, null, null);

View File

@ -356,8 +356,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
option3BottomAppBar.setColorFilter(bottomAppBarIconColor, android.graphics.PorterDuff.Mode.SRC_IN); option3BottomAppBar.setColorFilter(bottomAppBarIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
option4BottomAppBar.setColorFilter(bottomAppBarIconColor, android.graphics.PorterDuff.Mode.SRC_IN); option4BottomAppBar.setColorFilter(bottomAppBarIconColor, android.graphics.PorterDuff.Mode.SRC_IN);
navigationView.setBackgroundColor(backgroundColor); navigationView.setBackgroundColor(backgroundColor);
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
collapsingToolbarLayout.setContentScrimColor(mCustomThemeWrapper.getColorPrimary());
applyTabLayoutTheme(tabLayout); applyTabLayoutTheme(tabLayout);
bottomAppBar.setBackgroundTint(ColorStateList.valueOf(mCustomThemeWrapper.getBottomAppBarBackgroundColor())); bottomAppBar.setBackgroundTint(ColorStateList.valueOf(mCustomThemeWrapper.getBottomAppBarBackgroundColor()));
applyFABTheme(fab); applyFABTheme(fab);

View File

@ -18,6 +18,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
@ -55,6 +56,8 @@ public class MultiredditSelectionActivity extends BaseActivity implements Activi
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_multireddit_selection_activity) @BindView(R.id.appbar_layout_multireddit_selection_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_multireddit_selection_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_multireddit_selection_activity) @BindView(R.id.toolbar_multireddit_selection_activity)
Toolbar toolbar; Toolbar toolbar;
@Inject @Inject
@ -142,7 +145,7 @@ public class MultiredditSelectionActivity extends BaseActivity implements Activi
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
private void bindView(boolean initializeFragment) { private void bindView(boolean initializeFragment) {

View File

@ -12,6 +12,7 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
@ -43,6 +44,8 @@ public class PostFilterPreferenceActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_post_filter_preference_activity) @BindView(R.id.appbar_layout_post_filter_preference_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_post_filter_preference_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_post_filter_preference_activity) @BindView(R.id.toolbar_post_filter_preference_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.recycler_view_post_filter_preference_activity) @BindView(R.id.recycler_view_post_filter_preference_activity)
@ -207,7 +210,7 @@ public class PostFilterPreferenceActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
@Override @Override

View File

@ -15,6 +15,7 @@ import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputEditText;
@ -47,6 +48,8 @@ public class PostFilterUsageListingActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_post_filter_application_activity) @BindView(R.id.appbar_layout_post_filter_application_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_post_filter_application_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_post_filter_application_activity) @BindView(R.id.toolbar_post_filter_application_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.recycler_view_post_filter_application_activity) @BindView(R.id.recycler_view_post_filter_application_activity)
@ -209,6 +212,6 @@ public class PostFilterUsageListingActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
} }

View File

@ -407,7 +407,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
subredditNameTextView.setTextColor(secondaryTextColor); subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());

View File

@ -388,7 +388,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
subredditNameTextView.setTextColor(secondaryTextColor); subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());

View File

@ -362,7 +362,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
subredditNameTextView.setTextColor(secondaryTextColor); subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());

View File

@ -386,7 +386,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
subredditNameTextView.setTextColor(secondaryTextColor); subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());

View File

@ -399,7 +399,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
subredditNameTextView.setTextColor(secondaryTextColor); subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());

View File

@ -196,6 +196,6 @@ public class ReportActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
} }
} }

View File

@ -18,6 +18,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
@ -49,6 +50,8 @@ public class RulesActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_rules_activity) @BindView(R.id.appbar_layout_rules_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_rules_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_rules_activity) @BindView(R.id.toolbar_rules_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.progress_bar_rules_activity) @BindView(R.id.progress_bar_rules_activity)
@ -154,7 +157,7 @@ public class RulesActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
progressBar.setIndeterminateTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorAccent())); progressBar.setIndeterminateTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorAccent()));
errorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); errorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor());
} }

View File

@ -349,7 +349,7 @@ public class SearchActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
simpleSearchView.setSearchBackground(new ColorDrawable(mCustomThemeWrapper.getColorPrimary())); simpleSearchView.setSearchBackground(new ColorDrawable(mCustomThemeWrapper.getColorPrimary()));
int toolbarPrimaryTextAndIconColorColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor(); int toolbarPrimaryTextAndIconColorColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor();
simpleSearchView.setIconsColor(toolbarPrimaryTextAndIconColorColor); simpleSearchView.setIconsColor(toolbarPrimaryTextAndIconColorColor);

View File

@ -28,6 +28,7 @@ import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2; import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
@ -95,6 +96,8 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_search_result_activity) @BindView(R.id.appbar_layout_search_result_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_search_result_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_search_result_activity) @BindView(R.id.toolbar_search_result_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.tab_layout_search_result_activity) @BindView(R.id.tab_layout_search_result_activity)
@ -230,7 +233,7 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
applyTabLayoutTheme(tabLayout); applyTabLayoutTheme(tabLayout);
applyFABTheme(fab); applyFABTheme(fab);
} }

View File

@ -23,7 +23,6 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
@ -36,7 +35,6 @@ import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent; import ml.docilealligator.infinityforreddit.events.SwitchAccountEvent;
import ml.docilealligator.infinityforreddit.fragments.SubredditListingFragment; import ml.docilealligator.infinityforreddit.fragments.SubredditListingFragment;
import ml.docilealligator.infinityforreddit.subreddit.SubredditData;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
public class SearchSubredditsResultActivity extends BaseActivity implements ActivityToolbarInterface { public class SearchSubredditsResultActivity extends BaseActivity implements ActivityToolbarInterface {
@ -143,7 +141,7 @@ public class SearchSubredditsResultActivity extends BaseActivity implements Acti
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
} }
public void getSelectedSubreddit(String name, String iconUrl) { public void getSelectedSubreddit(String name, String iconUrl) {

View File

@ -140,7 +140,7 @@ public class SearchUsersResultActivity extends BaseActivity implements ActivityT
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
} }
public void getSelectedUser(String name, String iconUrl) { public void getSelectedUser(String name, String iconUrl) {

View File

@ -223,7 +223,7 @@ public class SelectUserFlairActivity extends BaseActivity implements ActivityToo
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
} }
@Override @Override

View File

@ -14,6 +14,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
@ -45,6 +46,8 @@ public class SelectedSubredditsAndUsersActivity extends BaseActivity implements
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_selected_subreddits_and_users_activity) @BindView(R.id.appbar_layout_selected_subreddits_and_users_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_selected_subreddits_and_users_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_selected_subreddits_and_users_activity) @BindView(R.id.toolbar_selected_subreddits_and_users_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.recycler_view_selected_subreddits_and_users_activity) @BindView(R.id.recycler_view_selected_subreddits_and_users_activity)
@ -187,7 +190,7 @@ public class SelectedSubredditsAndUsersActivity extends BaseActivity implements
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
applyFABTheme(fab); applyFABTheme(fab);
} }

View File

@ -174,7 +174,7 @@ public class SendPrivateMessageActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor(); int primaryTextColor = mCustomThemeWrapper.getPrimaryTextColor();
usernameEditText.setTextColor(primaryTextColor); usernameEditText.setTextColor(primaryTextColor);
subjectEditText.setTextColor(primaryTextColor); subjectEditText.setTextColor(primaryTextColor);

View File

@ -13,6 +13,7 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@ -46,6 +47,8 @@ public class SettingsActivity extends BaseActivity implements
@BindView(R.id.appbar_layout_settings_activity) @BindView(R.id.appbar_layout_settings_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_settings_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_settings_activity) @BindView(R.id.toolbar_settings_activity)
Toolbar toolbar; Toolbar toolbar;
private String mAccountName; private String mAccountName;
@ -126,7 +129,7 @@ public class SettingsActivity extends BaseActivity implements
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
@Override @Override

View File

@ -391,7 +391,7 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); int secondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();
subredditNameTextView.setTextColor(secondaryTextColor); subredditNameTextView.setTextColor(secondaryTextColor);
rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); rulesButton.setTextColor(mCustomThemeWrapper.getButtonTextColor());

View File

@ -24,6 +24,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager; import com.bumptech.glide.RequestManager;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import java.util.ArrayList; import java.util.ArrayList;
@ -54,6 +55,8 @@ public class SubredditMultiselectionActivity extends BaseActivity implements Act
CoordinatorLayout mCoordinatorLayout; CoordinatorLayout mCoordinatorLayout;
@BindView(R.id.appbar_layout_subreddits_multiselection_activity) @BindView(R.id.appbar_layout_subreddits_multiselection_activity)
AppBarLayout mAppBarLayout; AppBarLayout mAppBarLayout;
@BindView(R.id.collapsing_toolbar_layout_subscribed_subreddits_multiselection_activity)
CollapsingToolbarLayout mCollapsingToolbarLayout;
@BindView(R.id.toolbar_subscribed_subreddits_multiselection_activity) @BindView(R.id.toolbar_subscribed_subreddits_multiselection_activity)
Toolbar mToolbar; Toolbar mToolbar;
@BindView(R.id.swipe_refresh_layout_subscribed_subscribed_subreddits_multiselection_activity) @BindView(R.id.swipe_refresh_layout_subscribed_subscribed_subreddits_multiselection_activity)
@ -226,7 +229,7 @@ public class SubredditMultiselectionActivity extends BaseActivity implements Act
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(mAppBarLayout, mToolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(mAppBarLayout, mCollapsingToolbarLayout, mToolbar);
mErrorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); mErrorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor());
} }

View File

@ -19,6 +19,7 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
@ -62,6 +63,8 @@ public class SubredditSelectionActivity extends BaseActivity implements Activity
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_subreddit_selection_activity) @BindView(R.id.appbar_layout_subreddit_selection_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_subreddit_selection_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_subreddit_selection_activity) @BindView(R.id.toolbar_subreddit_selection_activity)
Toolbar toolbar; Toolbar toolbar;
@Inject @Inject
@ -153,7 +156,7 @@ public class SubredditSelectionActivity extends BaseActivity implements Activity
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
private void bindView(boolean initializeFragment) { private void bindView(boolean initializeFragment) {

View File

@ -21,6 +21,7 @@ import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout;
@ -74,6 +75,8 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_subscribed_thing_listing_activity) @BindView(R.id.appbar_layout_subscribed_thing_listing_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_subscribed_thing_listing_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_subscribed_thing_listing_activity) @BindView(R.id.toolbar_subscribed_thing_listing_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.tab_layout_subscribed_thing_listing_activity) @BindView(R.id.tab_layout_subscribed_thing_listing_activity)
@ -178,7 +181,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
applyTabLayoutTheme(tabLayout); applyTabLayoutTheme(tabLayout);
applyFABTheme(fab); applyFABTheme(fab);
} }

View File

@ -64,10 +64,10 @@ public class TrendingActivity extends BaseActivity {
@BindView(R.id.coordinator_layout_trending_activity) @BindView(R.id.coordinator_layout_trending_activity)
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.collapsing_toolbar_layout_trending_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.appbar_layout_trending_activity) @BindView(R.id.appbar_layout_trending_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_trending_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_trending_activity) @BindView(R.id.toolbar_trending_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.swipe_refresh_layout_trending_activity) @BindView(R.id.swipe_refresh_layout_trending_activity)
@ -326,7 +326,7 @@ public class TrendingActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground()); swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground());
swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent()); swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent());
errorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); errorTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor());

View File

@ -298,7 +298,7 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
} }
@Override @Override

View File

@ -31,6 +31,7 @@ import com.evernote.android.state.State;
import com.github.piasy.biv.BigImageViewer; import com.github.piasy.biv.BigImageViewer;
import com.github.piasy.biv.loader.glide.GlideImageLoader; import com.github.piasy.biv.loader.glide.GlideImageLoader;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.card.MaterialCardView; import com.google.android.material.card.MaterialCardView;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
@ -88,6 +89,8 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
CoordinatorLayout mCoordinatorLayout; CoordinatorLayout mCoordinatorLayout;
@BindView(R.id.appbar_layout_view_post_detail_activity) @BindView(R.id.appbar_layout_view_post_detail_activity)
AppBarLayout mAppBarLayout; AppBarLayout mAppBarLayout;
@BindView(R.id.collapsing_toolbar_layout_view_post_detail_activity)
CollapsingToolbarLayout mCollapsingToolbarLayout;
@BindView(R.id.toolbar_view_post_detail_activity) @BindView(R.id.toolbar_view_post_detail_activity)
Toolbar mToolbar; Toolbar mToolbar;
@BindView(R.id.view_pager_2_view_post_detail_activity) @BindView(R.id.view_pager_2_view_post_detail_activity)
@ -276,7 +279,7 @@ public class ViewPostDetailActivity extends BaseActivity implements SortTypeSele
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); mCoordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(mAppBarLayout, mToolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(mAppBarLayout, mCollapsingToolbarLayout, mToolbar);
applyFABTheme(fab); applyFABTheme(fab);
searchPanelMaterialCardView.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimary())); searchPanelMaterialCardView.setBackgroundTintList(ColorStateList.valueOf(mCustomThemeWrapper.getColorPrimary()));
int searchPanelTextAndIconColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor(); int searchPanelTextAndIconColor = mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor();

View File

@ -290,7 +290,7 @@ public class ViewPrivateMessagesActivity extends BaseActivity implements Activit
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
mLinearLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); mLinearLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(mAppBarLayout, mToolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(mAppBarLayout, null, mToolbar);
mDivider.setBackgroundColor(mCustomThemeWrapper.getDividerColor()); mDivider.setBackgroundColor(mCustomThemeWrapper.getDividerColor());
mEditText.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); mEditText.setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
mSecondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor(); mSecondaryTextColor = mCustomThemeWrapper.getSecondaryTextColor();

View File

@ -516,7 +516,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
collapsingToolbarLayout.setContentScrimColor(mCustomThemeWrapper.getColorPrimary());
appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
@ -524,7 +523,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this); appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} }
}); });
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar, false); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar, false);
expandedTabTextColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTextColor(); expandedTabTextColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTextColor();
expandedTabIndicatorColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabIndicator(); expandedTabIndicatorColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabIndicator();
expandedTabBackgroundColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabBackground(); expandedTabBackgroundColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabBackground();

View File

@ -563,7 +563,6 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
collapsingToolbarLayout.setContentScrimColor(mCustomThemeWrapper.getColorPrimary());
appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { appBarLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
@ -571,7 +570,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this); appBarLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} }
}); });
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar, false); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar, false);
expandedTabTextColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTextColor(); expandedTabTextColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTextColor();
expandedTabIndicatorColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabIndicator(); expandedTabIndicatorColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabIndicator();
expandedTabBackgroundColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabBackground(); expandedTabBackgroundColor = mCustomThemeWrapper.getTabLayoutWithExpandedCollapsingToolbarTabBackground();

View File

@ -109,7 +109,7 @@ public class WebViewActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, null, toolbar);
Drawable closeIcon = Utils.getTintedDrawable(this, R.drawable.ic_close_black_24dp, mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor()); Drawable closeIcon = Utils.getTintedDrawable(this, R.drawable.ic_close_black_24dp, mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor());
toolbar.setNavigationIcon(closeIcon); toolbar.setNavigationIcon(closeIcon);
} }

View File

@ -27,6 +27,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.r0adkll.slidr.Slidr; import com.r0adkll.slidr.Slidr;
import com.r0adkll.slidr.model.SlidrInterface; import com.r0adkll.slidr.model.SlidrInterface;
@ -78,6 +79,8 @@ public class WikiActivity extends BaseActivity {
CoordinatorLayout coordinatorLayout; CoordinatorLayout coordinatorLayout;
@BindView(R.id.appbar_layout_comment_wiki_activity) @BindView(R.id.appbar_layout_comment_wiki_activity)
AppBarLayout appBarLayout; AppBarLayout appBarLayout;
@BindView(R.id.collapsing_toolbar_layout_wiki_activity)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R.id.toolbar_comment_wiki_activity) @BindView(R.id.toolbar_comment_wiki_activity)
Toolbar toolbar; Toolbar toolbar;
@BindView(R.id.swipe_refresh_layout_wiki_activity) @BindView(R.id.swipe_refresh_layout_wiki_activity)
@ -356,7 +359,7 @@ public class WikiActivity extends BaseActivity {
@Override @Override
protected void applyCustomTheme() { protected void applyCustomTheme() {
coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor()); coordinatorLayout.setBackgroundColor(mCustomThemeWrapper.getBackgroundColor());
applyAppBarLayoutAndToolbarTheme(appBarLayout, toolbar); applyAppBarLayoutAndCollapsingToolbarLayoutAndToolbarTheme(appBarLayout, collapsingToolbarLayout, toolbar);
swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground()); swipeRefreshLayout.setProgressBackgroundColorSchemeColor(mCustomThemeWrapper.getCircularProgressBarBackground());
swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent()); swipeRefreshLayout.setColorSchemeColors(mCustomThemeWrapper.getColorAccent());
mFetchWikiInfoTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor()); mFetchWikiInfoTextView.setTextColor(mCustomThemeWrapper.getSecondaryTextColor());

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_anonymous_subscriptions_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_comment_full_markdown_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_create_multi_reddit_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_edit_multi_reddit_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_multireddit_selection_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_rules_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -12,6 +12,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_search_result_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_selected_subreddits_and_users_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -10,6 +10,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_settings_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_subreddit_selection_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_subscribed_subreddits_multiselection_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_subscribed_thing_listing_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_view_post_detail_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"

View File

@ -119,6 +119,8 @@
</com.google.android.material.appbar.CollapsingToolbarLayout> </com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout_view_user_detail_activity" android:id="@+id/tab_layout_view_user_detail_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -131,8 +133,6 @@
app:tabRippleColor="?attr/colorControlHighlight" app:tabRippleColor="?attr/colorControlHighlight"
app:tabUnboundedRipple="false" /> app:tabUnboundedRipple="false" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager_view_user_detail_activity" android:id="@+id/view_pager_view_user_detail_activity"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -14,6 +14,7 @@
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout_wiki_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"