pull/32/head
kunfei 5 years ago
parent 76d8e641c0
commit 95ba4c3a13
  1. 3
      app/src/main/java/io/legado/app/lib/theme/TintHelper.kt
  2. 4
      app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt

@ -317,9 +317,7 @@ object TintHelper {
color color
) )
) )
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
box.buttonTintList = sl box.buttonTintList = sl
} else {
val drawable = val drawable =
createTintedDrawable( createTintedDrawable(
ContextCompat.getDrawable( ContextCompat.getDrawable(
@ -329,7 +327,6 @@ object TintHelper {
) )
box.buttonDrawable = drawable box.buttonDrawable = drawable
} }
}
fun setTint(image: ImageView, @ColorInt color: Int) { fun setTint(image: ImageView, @ColorInt color: Int) {
image.setColorFilter(color, PorterDuff.Mode.SRC_ATOP) image.setColorFilter(color, PorterDuff.Mode.SRC_ATOP)

@ -4,7 +4,7 @@ import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatCheckBox import androidx.appcompat.widget.AppCompatCheckBox
import io.legado.app.lib.theme.ATH 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) * @author Aidan Follestad (afollestad)
@ -22,6 +22,6 @@ class ATECheckBox : AppCompatCheckBox {
) )
init { init {
ATH.setTint(this, ThemeStore.accentColor(context)) ATH.setTint(this, context.accentColor)
} }
} }

Loading…
Cancel
Save