mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-14 08:15:04 +01:00
TextInputLayout now supports Material 3
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
0c4513678d
commit
6075191bc5
@ -350,8 +350,7 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun colorEditText(editText: EditText) {
|
fun colorEditText(editText: EditText) {
|
||||||
withElementColor(editText) { color ->
|
withScheme(editText) { scheme ->
|
||||||
editText.setTextColor(color)
|
|
||||||
// TODO check API-level compatibility
|
// TODO check API-level compatibility
|
||||||
// editText.background.setColorFilter(color, PorterDuff.Mode.SRC_ATOP)
|
// editText.background.setColorFilter(color, PorterDuff.Mode.SRC_ATOP)
|
||||||
editText.backgroundTintList = ColorStateList(
|
editText.backgroundTintList = ColorStateList(
|
||||||
@ -360,16 +359,18 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
intArrayOf(android.R.attr.state_focused)
|
intArrayOf(android.R.attr.state_focused)
|
||||||
),
|
),
|
||||||
intArrayOf(
|
intArrayOf(
|
||||||
Color.GRAY,
|
scheme.outline,
|
||||||
color
|
scheme.primary
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
editText.setHintTextColor(scheme.onSurfaceVariant)
|
||||||
|
editText.setTextColor(scheme.onSurface)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun colorTextInputLayout(textInputLayout: TextInputLayout) {
|
fun colorTextInputLayout(textInputLayout: TextInputLayout) {
|
||||||
withElementColor(textInputLayout) { color ->
|
withScheme(textInputLayout) { scheme ->
|
||||||
val errorColor = Color.GRAY
|
val errorColor = scheme.onSurfaceVariant
|
||||||
|
|
||||||
val errorColorStateList = ColorStateList(
|
val errorColorStateList = ColorStateList(
|
||||||
arrayOf(
|
arrayOf(
|
||||||
@ -387,8 +388,8 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
|
|||||||
intArrayOf(android.R.attr.state_focused)
|
intArrayOf(android.R.attr.state_focused)
|
||||||
),
|
),
|
||||||
intArrayOf(
|
intArrayOf(
|
||||||
Color.GRAY,
|
scheme.outline,
|
||||||
color
|
scheme.primary
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user