From 95ba4c3a13add6cc1b2d4514a01b31006153a5de Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 31 Aug 2019 16:36:24 +0800 Subject: [PATCH] up --- .../io/legado/app/lib/theme/TintHelper.kt | 21 ++++++++----------- .../legado/app/lib/theme/view/ATECheckBox.kt | 4 ++-- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/TintHelper.kt b/app/src/main/java/io/legado/app/lib/theme/TintHelper.kt index b7b042ebc..8346e2525 100644 --- a/app/src/main/java/io/legado/app/lib/theme/TintHelper.kt +++ b/app/src/main/java/io/legado/app/lib/theme/TintHelper.kt @@ -317,18 +317,15 @@ object TintHelper { color ) ) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - box.buttonTintList = sl - } else { - val drawable = - createTintedDrawable( - ContextCompat.getDrawable( - box.context, - R.drawable.abc_btn_check_material - ), sl - ) - box.buttonDrawable = drawable - } + box.buttonTintList = sl + val drawable = + createTintedDrawable( + ContextCompat.getDrawable( + box.context, + R.drawable.abc_btn_check_material + ), sl + ) + box.buttonDrawable = drawable } fun setTint(image: ImageView, @ColorInt color: Int) { diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt index a9bef21b0..f910115df 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt @@ -4,7 +4,7 @@ import android.content.Context import android.util.AttributeSet import androidx.appcompat.widget.AppCompatCheckBox import io.legado.app.lib.theme.ATH -import io.legado.app.lib.theme.ThemeStore +import io.legado.app.lib.theme.accentColor /** * @author Aidan Follestad (afollestad) @@ -22,6 +22,6 @@ class ATECheckBox : AppCompatCheckBox { ) init { - ATH.setTint(this, ThemeStore.accentColor(context)) + ATH.setTint(this, context.accentColor) } }