From 81c259edcb557e231766e17980bf7a20906ee983 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 26 Sep 2019 21:57:51 +0800 Subject: Fixed UI issues in dark theme. --- .../AccountSavedThingActivity.java | 10 ++++---- .../infinityforreddit/PostRecyclerViewAdapter.java | 5 ++-- .../res/layout/activity_account_saved_thing.xml | 19 ++++++++------- app/src/main/res/layout/activity_search_result.xml | 28 ++++------------------ .../layout/activity_subscribed_thing_listing.xml | 8 +++---- app/src/main/res/layout/app_bar_main.xml | 8 ------- 6 files changed, 25 insertions(+), 53 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java index ccd56a77..a82a6f7a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AccountSavedThingActivity.java @@ -215,12 +215,11 @@ public class AccountSavedThingActivity extends AppCompatActivity { MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_account_saved_thing_activity); if (isInLazyMode) { lazyModeItem.setTitle(R.string.action_stop_lazy_mode); - params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED); + params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL); collapsingToolbarLayout.setLayoutParams(params); } else { lazyModeItem.setTitle(R.string.action_start_lazy_mode); - params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | - AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED); + params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS); collapsingToolbarLayout.setLayoutParams(params); } @@ -245,15 +244,14 @@ public class AccountSavedThingActivity extends AppCompatActivity { isInLazyMode = false; sectionsPagerAdapter.stopLazyMode(); lazyModeItem.setTitle(R.string.action_start_lazy_mode); - params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | - AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS_COLLAPSED); + params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS); collapsingToolbarLayout.setLayoutParams(params); } else { isInLazyMode = true; if(sectionsPagerAdapter.startLazyMode()) { lazyModeItem.setTitle(R.string.action_stop_lazy_mode); appBarLayout.setExpanded(false); - params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED); + params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL); collapsingToolbarLayout.setLayoutParams(params); } else { isInLazyMode = false; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java index d61e9630..c2b420ac 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java @@ -103,8 +103,9 @@ class PostRecyclerViewAdapter extends PagedListAdapter - - + app:layout_collapseMode="pin" + app:layout_scrollFlags="scroll|enterAlways" + app:popupTheme="@style/AppTheme.PopupOverlay" /> @@ -40,7 +35,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="@color/colorPrimary" + android:background="@color/greyTabBackgroundColor" app:layout_scrollFlags="scroll|enterAlways" app:tabGravity="fill" app:tabIndicatorColor="@android:color/white" @@ -53,4 +48,10 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_search_result.xml b/app/src/main/res/layout/activity_search_result.xml index 839820c6..32c4309c 100644 --- a/app/src/main/res/layout/activity_search_result.xml +++ b/app/src/main/res/layout/activity_search_result.xml @@ -18,31 +18,11 @@ app:titleEnabled="false" app:toolbarId="@+id/toolbar_search_result_activity"> - - - - - - - + android:layout_height="?attr/actionBarSize" + app:popupTheme="@style/AppTheme.PopupOverlay" /> diff --git a/app/src/main/res/layout/activity_subscribed_thing_listing.xml b/app/src/main/res/layout/activity_subscribed_thing_listing.xml index 6a48ec15..9198a636 100644 --- a/app/src/main/res/layout/activity_subscribed_thing_listing.xml +++ b/app/src/main/res/layout/activity_subscribed_thing_listing.xml @@ -23,7 +23,8 @@ android:id="@+id/toolbar_subscribed_thing_listing_activity" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" + app:layout_collapseMode="pin" + app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/AppTheme.PopupOverlay" /> @@ -32,7 +33,7 @@ android:id="@+id/tab_layout_subscribed_thing_listing_activity" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/colorPrimary" + android:background="@color/greyTabBackgroundColor" app:layout_scrollFlags="scroll|enterAlways" app:tabGravity="fill" app:tabMode="fixed" @@ -49,7 +50,6 @@ android:id="@+id/view_pager_subscribed_thing_listing_activity" android:layout_width="match_parent" android:layout_height="match_parent" - app:layout_behavior="@string/appbar_scrolling_view_behavior" - tools:application=".SubscribedThingListingActivity" /> + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> \ No newline at end of file diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index b834c1ff..7c4fd126 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -49,14 +49,6 @@ - -