From ca42beeb17cfd1dbc99535809001b0316b79dd62 Mon Sep 17 00:00:00 2001
From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>
Date: Wed, 4 Sep 2024 17:19:20 -0400
Subject: Show a divider in SearchActivity.
---
.../infinityforreddit/activities/SearchActivity.java | 8 ++++++--
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 @@
+
+