diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java | 8 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_search.xml | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java index 3073979e..abc09091 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java @@ -335,6 +335,7 @@ public class SearchActivity extends BaseActivity { if (searchOnlySubreddits || searchOnlyUsers || searchSubredditsAndUsers) { binding.subredditNameRelativeLayoutSearchActivity.setVisibility(View.GONE); + binding.dividerSearchActivity.setVisibility(View.GONE); } else { binding.subredditNameRelativeLayoutSearchActivity.setOnClickListener(view -> { Intent intent = new Intent(this, SubscribedThingListingActivity.class); @@ -396,7 +397,7 @@ public class SearchActivity extends BaseActivity { outRect.left = halfSpacing; outRect.right = spacing; } - outRect.bottom = spacing; + outRect.top = spacing; } }); @@ -409,8 +410,10 @@ public class SearchActivity extends BaseActivity { mRecentSearchQueryViewModel.getAllRecentSearchQueries().observe(this, recentSearchQueries -> { if (recentSearchQueries != null && !recentSearchQueries.isEmpty()) { + binding.dividerSearchActivity.setVisibility(View.VISIBLE); binding.deleteAllRecentSearchesButtonSearchActivity.setVisibility(View.VISIBLE); } else { + binding.dividerSearchActivity.setVisibility(View.GONE); binding.deleteAllRecentSearchesButtonSearchActivity.setVisibility(View.GONE); } adapter.setRecentSearchQueries(recentSearchQueries); @@ -498,8 +501,9 @@ public class SearchActivity extends BaseActivity { binding.linkHandlerImageViewSearchActivity.setColorFilter(mCustomThemeWrapper.getToolbarPrimaryTextAndIconColor(), android.graphics.PorterDuff.Mode.SRC_IN); int colorAccent = mCustomThemeWrapper.getColorAccent(); binding.searchInTextViewSearchActivity.setTextColor(colorAccent); - binding.deleteAllRecentSearchesButtonSearchActivity.setIconTint(ColorStateList.valueOf(mCustomThemeWrapper.getPrimaryIconColor())); binding.subredditNameTextViewSearchActivity.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); + binding.deleteAllRecentSearchesButtonSearchActivity.setIconTint(ColorStateList.valueOf(mCustomThemeWrapper.getPrimaryIconColor())); + binding.dividerSearchActivity.setBackgroundColor(mCustomThemeWrapper.getDividerColor()); if (typeface != null) { Utils.setFontToAllTextViews(binding.getRoot(), typeface); } diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index ef6bee96..3d4d4738 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -122,6 +122,12 @@ </RelativeLayout> + <View + android:id="@+id/divider_search_activity" + android:layout_width="match_parent" + android:layout_height="1dp" + android:visibility="gone" /> + <androidx.recyclerview.widget.RecyclerView android:id="@+id/recent_search_query_recycler_view_search_activity" android:layout_width="match_parent" |