add proper checkbox- state coloring

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-07-27 00:10:17 +02:00
parent 7ec78e53f0
commit aef9b69175
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B

View File

@ -183,8 +183,13 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme) {
fun themeCheckbox(checkbox: CheckBox) {
withElementColor(checkbox) { color ->
checkbox.setTextColor(color)
checkbox.buttonTintList = ColorStateList.valueOf(color)
checkbox.buttonTintList = ColorStateList(
arrayOf(
intArrayOf(-android.R.attr.state_checked),
intArrayOf(android.R.attr.state_checked),
),
intArrayOf(Color.GRAY, color)
)
}
}