From 837ce62844ad287468deb15b5f33e73d0190d020 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 24 Oct 2020 13:31:29 -0400 Subject: [PATCH] Janky workaround for collapsed global search covers --- .../source/globalsearch/GlobalSearchCardHolder.kt | 12 ++++++------ app/src/main/res/layout/global_search_controller.xml | 4 ++-- .../res/layout/global_search_controller_card.xml | 2 -- .../layout/global_search_controller_card_item.xml | 10 +++++----- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt index 76fe9ae216..97d217b4c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/globalsearch/GlobalSearchCardHolder.kt @@ -8,9 +8,9 @@ import eu.kanade.tachiyomi.data.glide.toMangaThumbnail import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder import eu.kanade.tachiyomi.widget.StateImageViewTarget import kotlinx.android.synthetic.main.global_search_controller_card_item.card -import kotlinx.android.synthetic.main.global_search_controller_card_item.itemImage +import kotlinx.android.synthetic.main.global_search_controller_card_item.cover import kotlinx.android.synthetic.main.global_search_controller_card_item.progress -import kotlinx.android.synthetic.main.global_search_controller_card_item.tvTitle +import kotlinx.android.synthetic.main.global_search_controller_card_item.title class GlobalSearchCardHolder(view: View, adapter: GlobalSearchCardAdapter) : BaseFlexibleViewHolder(view, adapter) { @@ -35,15 +35,15 @@ class GlobalSearchCardHolder(view: View, adapter: GlobalSearchCardAdapter) : fun bind(manga: Manga) { card.clipToOutline = true - tvTitle.text = manga.title + title.text = manga.title // Set alpha of thumbnail. - itemImage.alpha = if (manga.favorite) 0.3f else 1.0f + cover.alpha = if (manga.favorite) 0.3f else 1.0f setImage(manga) } fun setImage(manga: Manga) { - GlideApp.with(itemView.context).clear(itemImage) + GlideApp.with(itemView.context).clear(cover) if (!manga.thumbnail_url.isNullOrEmpty()) { GlideApp.with(itemView.context) .load(manga.toMangaThumbnail()) @@ -51,7 +51,7 @@ class GlobalSearchCardHolder(view: View, adapter: GlobalSearchCardAdapter) : .centerCrop() .skipMemoryCache(true) .placeholder(android.R.color.transparent) - .into(StateImageViewTarget(itemImage, progress)) + .into(StateImageViewTarget(cover, progress)) } } } diff --git a/app/src/main/res/layout/global_search_controller.xml b/app/src/main/res/layout/global_search_controller.xml index 7a648e0935..85770ed92b 100644 --- a/app/src/main/res/layout/global_search_controller.xml +++ b/app/src/main/res/layout/global_search_controller.xml @@ -22,8 +22,8 @@ + android:alpha="0.75" + android:background="?attr/colorSurface" /> diff --git a/app/src/main/res/layout/global_search_controller_card_item.xml b/app/src/main/res/layout/global_search_controller_card_item.xml index 5c2dca95f8..142ae94b9f 100644 --- a/app/src/main/res/layout/global_search_controller_card_item.xml +++ b/app/src/main/res/layout/global_search_controller_card_item.xml @@ -4,16 +4,16 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/list_item_selector_background" android:layout_marginStart="4dp" android:layout_marginTop="8dp" android:layout_marginEnd="4dp" - android:layout_marginBottom="8dp"> + android:layout_marginBottom="8dp" + android:background="@drawable/list_item_selector_background">