|
@@ -1,8 +1,6 @@
|
|
|
package eu.kanade.tachiyomi.ui.extension
|
|
|
|
|
|
import android.view.View
|
|
|
-import androidx.core.content.ContextCompat
|
|
|
-import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
|
|
import eu.kanade.tachiyomi.R
|
|
|
import eu.kanade.tachiyomi.data.glide.GlideApp
|
|
|
import eu.kanade.tachiyomi.extension.model.Extension
|
|
@@ -10,6 +8,7 @@ import eu.kanade.tachiyomi.extension.model.InstallStep
|
|
|
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
|
|
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
|
|
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
|
|
+import eu.kanade.tachiyomi.util.system.getResourceColor
|
|
|
import io.github.mthli.slice.Slice
|
|
|
import kotlinx.android.synthetic.main.extension_card_item.card
|
|
|
import kotlinx.android.synthetic.main.extension_card_item.ext_button
|
|
@@ -63,10 +62,8 @@ class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :
|
|
|
fun bindButton(item: ExtensionItem) = with(ext_button) {
|
|
|
isEnabled = true
|
|
|
isClickable = true
|
|
|
- isActivated = false
|
|
|
|
|
|
- background = VectorDrawableCompat.create(resources!!, R.drawable.button_bg_transparent, null)
|
|
|
- setTextColor(ContextCompat.getColorStateList(context, R.drawable.button_bg_transparent))
|
|
|
+ setTextColor(context.getResourceColor(R.attr.colorAccent))
|
|
|
|
|
|
val extension = item.extension
|
|
|
|
|
@@ -86,14 +83,10 @@ class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :
|
|
|
} else if (extension is Extension.Installed) {
|
|
|
when {
|
|
|
extension.hasUpdate -> {
|
|
|
- isActivated = true
|
|
|
setText(R.string.ext_update)
|
|
|
}
|
|
|
extension.isObsolete -> {
|
|
|
- // Red outline
|
|
|
- background = VectorDrawableCompat.create(resources, R.drawable.button_bg_error, null)
|
|
|
- setTextColor(ContextCompat.getColorStateList(context, R.drawable.button_bg_error))
|
|
|
-
|
|
|
+ setTextColor(context.getResourceColor(R.attr.colorError))
|
|
|
setText(R.string.ext_obsolete)
|
|
|
}
|
|
|
else -> {
|