From 3f4140900d2b0a437ed6985d98502c1f5b720604 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 22 Mar 2020 18:43:16 -0400 Subject: [PATCH] Tweak button styles --- .../tachiyomi/ui/extension/ExtensionHolder.kt | 13 ++------ app/src/main/res/drawable/button_bg_error.xml | 26 ---------------- .../res/drawable/button_bg_transparent.xml | 26 ---------------- .../res/layout/catalogue_drawer_content.xml | 4 +-- .../catalogue_main_controller_card_item.xml | 8 +++-- .../main/res/layout/extension_card_item.xml | 10 ++----- .../layout/extension_detail_controller.xml | 2 +- app/src/main/res/layout/history_item.xml | 4 +-- app/src/main/res/values/styles.xml | 30 +++++++++---------- app/src/main/res/values/themes.xml | 4 +-- 10 files changed, 34 insertions(+), 93 deletions(-) delete mode 100644 app/src/main/res/drawable/button_bg_error.xml delete mode 100644 app/src/main/res/drawable/button_bg_transparent.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt index 817764f46..5fe0037a2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt @@ -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 -> { diff --git a/app/src/main/res/drawable/button_bg_error.xml b/app/src/main/res/drawable/button_bg_error.xml deleted file mode 100644 index 3edb3611b..000000000 --- a/app/src/main/res/drawable/button_bg_error.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/button_bg_transparent.xml b/app/src/main/res/drawable/button_bg_transparent.xml deleted file mode 100644 index d7924bf40..000000000 --- a/app/src/main/res/drawable/button_bg_transparent.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/catalogue_drawer_content.xml b/app/src/main/res/layout/catalogue_drawer_content.xml index 0a72f0693..931b8bb69 100644 --- a/app/src/main/res/layout/catalogue_drawer_content.xml +++ b/app/src/main/res/layout/catalogue_drawer_content.xml @@ -50,7 +50,7 @@