pull/1395/head
gedoor 4 years ago
parent 8cbca1ae06
commit efe99f2a5a
  1. 6
      app/src/main/java/io/legado/app/lib/theme/TintHelper.kt

@ -67,9 +67,10 @@ object TintHelper {
when (view) {
is Button -> {
sl = getDisabledColorStateList(color, disabled)
if (view.getBackground() is RippleDrawable) {
val rd = view.getBackground() as RippleDrawable
rd.setColor(ColorStateList.valueOf(rippleColor))
}
// Disabled text color state for buttons, may get overridden later by ATE tags
view.setTextColor(
getDisabledColorStateList(
@ -164,7 +165,7 @@ object TintHelper {
}
else -> isBg = true
}
if (!isBg && view.background is RippleDrawable) {
// Ripples for the above views (e.g. when you tap and hold a switch or checkbox)
val rd = view.background as RippleDrawable
@SuppressLint("PrivateResource") val unchecked = ContextCompat.getColor(
@ -182,6 +183,7 @@ object TintHelper {
)
rd.setColor(sl)
}
}
if (isBg) {
// Need to tint the isBackground of a view
if (view is FloatingActionButton || view is Button) {

Loading…
Cancel
Save