From d5c39a21b39e92b9f7451ace604fe97768ebe74f Mon Sep 17 00:00:00 2001 From: LagradOst <11805592+LagradOst@users.noreply.github.com> Date: Tue, 29 Mar 2022 22:17:42 +0200 Subject: [PATCH] fixed search history UI & UX --- .../com/lagradost/cloudstream3/ui/search/SearchFragment.kt | 6 ++++-- app/src/main/res/layout/search_history_item.xml | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt index 5ba23e11..e8351b34 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt @@ -353,8 +353,10 @@ class SearchFragment : Fragment() { override fun onQueryTextChange(newText: String): Boolean { //searchViewModel.quickSearch(newText) val showHistory = newText.isBlank() - searchViewModel.clearSearch() - searchViewModel.updateHistory() + if (showHistory) { + searchViewModel.clearSearch() + searchViewModel.updateHistory() + } search_history_recycler?.isVisible = showHistory diff --git a/app/src/main/res/layout/search_history_item.xml b/app/src/main/res/layout/search_history_item.xml index 4daf4c8c..34cd59bc 100644 --- a/app/src/main/res/layout/search_history_item.xml +++ b/app/src/main/res/layout/search_history_item.xml @@ -6,6 +6,7 @@ android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/home_history_tab" + android:foreground="?android:attr/selectableItemBackgroundBorderless" android:nextFocusRight="@id/home_history_remove">