From 148f8e6d1182e75e08e8aebf943e60f15e43b324 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 16 Jul 2020 23:01:24 -0400 Subject: [PATCH] Tweak track search dialog list item paddings --- .../ui/manga/track/TrackSearchDialog.kt | 6 ++--- .../main/res/layout/track_search_dialog.xml | 7 ------ app/src/main/res/layout/track_search_item.xml | 24 ++++++------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt index 6a9f8ad8e7..1534f1cd63 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt @@ -17,10 +17,10 @@ import java.util.concurrent.TimeUnit import kotlinx.android.synthetic.main.track_search_dialog.view.progress import kotlinx.android.synthetic.main.track_search_dialog.view.track_search import kotlinx.android.synthetic.main.track_search_dialog.view.track_search_list +import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.launchIn -import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import reactivecircus.flowbinding.android.widget.itemClicks import reactivecircus.flowbinding.android.widget.textChanges @@ -96,13 +96,13 @@ class TrackSearchDialog : DialogController { adapter = null } + @FlowPreview override fun onAttach(view: View) { super.onAttach(view) dialogView!!.track_search.textChanges() .debounce(TimeUnit.SECONDS.toMillis(1)) - .map { it.toString() } .filter { it.isNotBlank() } - .onEach { search(it) } + .onEach { search(it.toString()) } .launchIn(trackController.scope) } diff --git a/app/src/main/res/layout/track_search_dialog.xml b/app/src/main/res/layout/track_search_dialog.xml index a2cfb8fc16..a46e08e141 100644 --- a/app/src/main/res/layout/track_search_dialog.xml +++ b/app/src/main/res/layout/track_search_dialog.xml @@ -52,8 +52,6 @@ android:footerDividersEnabled="true" android:headerDividersEnabled="true" android:listSelector="@drawable/list_item_selector" - android:paddingTop="4dp" - android:paddingBottom="4dp" android:scrollbars="none" android:visibility="invisible" tools:listitem="@layout/track_search_item" @@ -61,9 +59,4 @@ - - diff --git a/app/src/main/res/layout/track_search_item.xml b/app/src/main/res/layout/track_search_item.xml index 916dc5e29d..7daacc99eb 100644 --- a/app/src/main/res/layout/track_search_item.xml +++ b/app/src/main/res/layout/track_search_item.xml @@ -3,6 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" style="@style/Theme.Widget.CardView.Item" + android:layout_margin="0dp" android:padding="0dp"> - -