From abf31f4a798f56b859b115cc8c9121e6bd4211a0 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 7 Nov 2021 09:49:40 -0500 Subject: [PATCH] Fix cutoff ripple for extension install cancel button --- .../ui/browse/extension/ExtensionHolder.kt | 12 ++++++------ .../ui/browse/extension/ExtensionItem.kt | 2 +- ...ension_card_item.xml => extension_item.xml} | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) rename app/src/main/res/layout/{extension_card_item.xml => extension_item.xml} (89%) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt index 9216c73e1..dde63907b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionHolder.kt @@ -6,7 +6,7 @@ import coil.clear import coil.load import eu.davidea.viewholders.FlexibleViewHolder import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.databinding.ExtensionCardItemBinding +import eu.kanade.tachiyomi.databinding.ExtensionItemBinding import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.util.system.LocaleHelper @@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.util.system.LocaleHelper class ExtensionHolder(view: View, val adapter: ExtensionAdapter) : FlexibleViewHolder(view, adapter) { - private val binding = ExtensionCardItemBinding.bind(view) + private val binding = ExtensionItemBinding.bind(view) init { binding.extButton.setOnClickListener { @@ -28,7 +28,7 @@ class ExtensionHolder(view: View, val adapter: ExtensionAdapter) : fun bind(item: ExtensionItem) { val extension = item.extension - binding.extTitle.text = extension.name + binding.name.text = extension.name binding.version.text = extension.versionName binding.lang.text = LocaleHelper.getSourceDisplayName(extension.lang, itemView.context) binding.warning.text = when { @@ -39,11 +39,11 @@ class ExtensionHolder(view: View, val adapter: ExtensionAdapter) : else -> "" }.uppercase() - binding.image.clear() + binding.icon.clear() if (extension is Extension.Available) { - binding.image.load(extension.iconUrl) + binding.icon.load(extension.iconUrl) } else { - extension.getApplicationIcon(itemView.context)?.let { binding.image.setImageDrawable(it) } + extension.getApplicationIcon(itemView.context)?.let { binding.icon.setImageDrawable(it) } } bindButtons(item) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt index 759880884..cd0059f5c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionItem.kt @@ -27,7 +27,7 @@ data class ExtensionItem( * Returns the layout resource of this item. */ override fun getLayoutRes(): Int { - return R.layout.extension_card_item + return R.layout.extension_item } /** diff --git a/app/src/main/res/layout/extension_card_item.xml b/app/src/main/res/layout/extension_item.xml similarity index 89% rename from app/src/main/res/layout/extension_card_item.xml rename to app/src/main/res/layout/extension_item.xml index 2849efd8a..83084190b 100644 --- a/app/src/main/res/layout/extension_card_item.xml +++ b/app/src/main/res/layout/extension_item.xml @@ -4,11 +4,11 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="64dp" - android:layout_marginEnd="16dp" - android:background="@drawable/list_item_selector_background"> + android:background="@drawable/list_item_selector_background" + android:paddingEnd="16dp"> @@ -42,8 +42,8 @@ android:maxLines="1" android:textAppearance="?attr/textAppearanceCaption" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/image" - app:layout_constraintTop_toBottomOf="@+id/ext_title" + app:layout_constraintStart_toEndOf="@id/icon" + app:layout_constraintTop_toBottomOf="@+id/name" tools:text="English" tools:visibility="visible" /> @@ -55,7 +55,7 @@ android:maxLines="1" android:textAppearance="?attr/textAppearanceCaption" app:layout_constraintStart_toEndOf="@id/lang" - app:layout_constraintTop_toBottomOf="@+id/ext_title" + app:layout_constraintTop_toBottomOf="@+id/name" tools:text="Version" />