mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-21 03:35:15 +01:00
extend button theming for primary actions to respect states and also cover icons
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
e54abe63f1
commit
9aabb8804e
@ -136,7 +136,18 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme) {
|
||||
fun colorMaterialButtonBackground(button: MaterialButton) {
|
||||
withElementColor(button) { color ->
|
||||
button.setBackgroundColor(color)
|
||||
button.setTextColor(theme.colorText)
|
||||
|
||||
val disabledColor = ContextCompat.getColor(button.context, R.color.disabled_text)
|
||||
val colorStateList = ColorStateList(
|
||||
arrayOf(
|
||||
intArrayOf(android.R.attr.state_enabled),
|
||||
intArrayOf(-android.R.attr.state_enabled)
|
||||
),
|
||||
intArrayOf(theme.colorText, disabledColor)
|
||||
)
|
||||
|
||||
button.setTextColor(colorStateList)
|
||||
button.iconTint = colorStateList
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user