fixed search history UI & UX

This commit is contained in:
LagradOst 2022-03-29 22:17:42 +02:00
parent 8f4d60bd09
commit d5c39a21b3
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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">
<TextView
@ -24,6 +25,7 @@
android:padding="10dp"
android:id="@+id/home_history_remove"
android:nextFocusLeft="@id/home_history_tab"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_baseline_close_24"
android:layout_width="wrap_content"