pull/32/head
kunfei 5 years ago
parent 76d8e641c0
commit 95ba4c3a13
  1. 21
      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,18 +317,15 @@ object TintHelper {
color color
) )
) )
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { box.buttonTintList = sl
box.buttonTintList = sl val drawable =
} else { createTintedDrawable(
val drawable = ContextCompat.getDrawable(
createTintedDrawable( box.context,
ContextCompat.getDrawable( R.drawable.abc_btn_check_material
box.context, ), sl
R.drawable.abc_btn_check_material )
), sl box.buttonDrawable = drawable
)
box.buttonDrawable = drawable
}
} }
fun setTint(image: ImageView, @ColorInt color: Int) { fun setTint(image: ImageView, @ColorInt color: Int) {

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