aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2024-09-04 21:19:20 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2024-09-04 21:19:20 +0000
commitca42beeb17cfd1dbc99535809001b0316b79dd62 (patch)
tree399b97d588c2028c99d3e22f8f2ebb7916bd231a /app
parent478b2db4e583ff4577e421f1f115ef8d4d7626ef (diff)
downloadinfinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.tar
infinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.tar.gz
infinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.tar.bz2
infinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.tar.lz
infinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.tar.xz
infinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.tar.zst
infinity-for-reddit-ca42beeb17cfd1dbc99535809001b0316b79dd62.zip
Show a divider in SearchActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchActivity.java8
-rw-r--r--app/src/main/res/layout/activity_search.xml6
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"