Fix cutoff ripple for extension install cancel button

This commit is contained in:
arkon 2021-11-07 09:49:40 -05:00
parent f28dd4f4de
commit abf31f4a79
3 changed files with 16 additions and 16 deletions

View File

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

View File

@ -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
}
/**

View File

@ -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">
<ImageView
android:id="@+id/image"
android:id="@+id/icon"
android:layout_width="0dp"
android:layout_height="0dp"
android:paddingStart="16dp"
@ -21,7 +21,7 @@
tools:src="@mipmap/ic_launcher_round" />
<TextView
android:id="@+id/ext_title"
android:id="@+id/name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
@ -30,7 +30,7 @@
android:textAppearance="?attr/textAppearanceBody2"
app:layout_constraintBottom_toTopOf="@id/lang"
app:layout_constraintEnd_toStartOf="@id/ext_button"
app:layout_constraintStart_toEndOf="@id/image"
app:layout_constraintStart_toEndOf="@id/icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:text="Batoto" />
@ -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" />
<TextView
@ -67,7 +67,7 @@
android:textAppearance="?attr/textAppearanceCaption"
android:textColor="?attr/colorError"
app:layout_constraintStart_toEndOf="@id/version"
app:layout_constraintTop_toBottomOf="@+id/ext_title"
app:layout_constraintTop_toBottomOf="@+id/name"
tools:text="Warning" />
<Button