From ec7297f8c288984826773cfce24eae5538457a2e Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 5 Jun 2020 09:33:42 -0400 Subject: [PATCH] Add arrow to source search headers --- .../source/globalsearch/GlobalSearchHolder.kt | 9 +++--- .../res/drawable/ic_arrow_forward_24dp.xml | 7 +++-- .../layout/global_search_controller_card.xml | 30 +++++++++++++++---- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt index 7669c3245a..9981910f03 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchHolder.kt @@ -10,6 +10,7 @@ import kotlinx.android.synthetic.main.global_search_controller_card.progress import kotlinx.android.synthetic.main.global_search_controller_card.recycler import kotlinx.android.synthetic.main.global_search_controller_card.source_card import kotlinx.android.synthetic.main.global_search_controller_card.title +import kotlinx.android.synthetic.main.global_search_controller_card.title_wrapper /** * Holder that binds the [GlobalSearchItem] containing catalogue cards. @@ -32,7 +33,7 @@ class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) : recycler.layoutManager = LinearLayoutManager(view.context, LinearLayoutManager.HORIZONTAL, false) recycler.adapter = mangaAdapter - title.setOnClickListener { + title_wrapper.setOnClickListener { adapter.getItem(bindingAdapterPosition)?.let { adapter.titleClickListener.onTitleClick(it.source) } @@ -48,7 +49,7 @@ class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) : val source = item.source val results = item.results - val titlePrefix = if (item.highlighted) "▶" else "" + val titlePrefix = if (item.highlighted) "▶ " else "" val langSuffix = if (source.lang.isNotEmpty()) " (${source.lang})" else "" // Set Title with country code if available. @@ -101,12 +102,12 @@ class GlobalSearchHolder(view: View, val adapter: GlobalSearchAdapter) : } private fun showHolder() { - title.visible() + title_wrapper.visible() source_card.visible() } private fun hideHolder() { - title.gone() + title_wrapper.gone() source_card.gone() } } diff --git a/app/src/main/res/drawable/ic_arrow_forward_24dp.xml b/app/src/main/res/drawable/ic_arrow_forward_24dp.xml index 3473f8722e..bdbcb647b8 100644 --- a/app/src/main/res/drawable/ic_arrow_forward_24dp.xml +++ b/app/src/main/res/drawable/ic_arrow_forward_24dp.xml @@ -1,9 +1,10 @@ - + diff --git a/app/src/main/res/layout/global_search_controller_card.xml b/app/src/main/res/layout/global_search_controller_card.xml index 88852559ce..ed33dc8515 100644 --- a/app/src/main/res/layout/global_search_controller_card.xml +++ b/app/src/main/res/layout/global_search_controller_card.xml @@ -1,17 +1,35 @@ - + android:layout_height="wrap_content"> + + + + + +