From d8010b6adb721d71d6e3f992fe76bab3c4ec5878 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 12 Nov 2021 18:48:59 +0100 Subject: [PATCH] use the text color at inactive checkboxes --- .../commons/views/MyAppCompatCheckbox.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatCheckbox.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatCheckbox.kt index c20892f87..9fd33a2d0 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatCheckbox.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/views/MyAppCompatCheckbox.kt @@ -17,20 +17,20 @@ class MyAppCompatCheckbox : AppCompatCheckBox { fun setColors(textColor: Int, accentColor: Int, backgroundColor: Int) { setTextColor(textColor) - /*if (isMarshmallowPlus()) { - buttonDrawable?.applyColorFilter(accentColor) + if (isMarshmallowPlus()) { + buttonDrawable?.applyColorFilter(textColor) compoundDrawablesRelative.forEach { - it?.applyColorFilter(accentColor) + it?.applyColorFilter(textColor) } - } else {*/ - val colorStateList = ColorStateList( - arrayOf( - intArrayOf(-android.R.attr.state_checked), - intArrayOf(android.R.attr.state_checked) - ), - intArrayOf(context.resources.getColor(R.color.radiobutton_disabled), accentColor) - ) - supportButtonTintList = colorStateList - //} + } + + val colorStateList = ColorStateList( + arrayOf( + intArrayOf(-android.R.attr.state_checked), + intArrayOf(android.R.attr.state_checked) + ), + intArrayOf(context.resources.getColor(R.color.radiobutton_disabled), accentColor) + ) + supportButtonTintList = colorStateList } }