Ketan
09/04/2020, 6:36 AMTextField
compare to EditText
Material. Some basic things should be provided to style the look and feel.Zach Klippenstein (he/him) [MOD]
09/04/2020, 1:20 PMNeil
09/04/2020, 1:26 PMKetan
09/04/2020, 5:09 PMTextField
? Is it in roadmap? @Zach Klippenstein (he/him) [MOD]Zach Klippenstein (he/him) [MOD]
09/04/2020, 5:36 PMTextField
(text editing in general) is probably one of the most complicated parts of any UI framework and itâs been under very heavy development for months, and i expect will continue to be until it reaches feature parity with the existing text input stuff.
https://lord.io/blog/2019/text-editing-hates-you-too/Sean McQuillan [G]
09/06/2020, 9:06 PMKetan
09/07/2020, 9:06 AMError
and onError
colors in Theme but what if the error color in particular use case is different from that theme color.
Like in Material EditText, we have everything, we just need to pass correct reference [color] to customise the experience as per our needâŚ
I hope this will help youâŚSean McQuillan [G]
09/08/2020, 10:52 PMSiyamed
09/09/2020, 12:19 AMSiyamed
09/09/2020, 12:19 AMSiyamed
09/09/2020, 12:20 AMSiyamed
09/09/2020, 12:21 AMSiyamed
09/09/2020, 12:21 AMKetan
09/09/2020, 4:46 AMAnastasia [G]
09/10/2020, 6:52 PMKetan
09/11/2020, 4:43 AMTextField
bottom line color customisation⌠I hope it turns out well
Thank you so much
P.S: Here you can check the dark theme screenshot https://kotlinlang.slack.com/archives/CJLTWPH7S/p1599201216493500 to refer why I asked for that customisation? [Bottom line is not visible]coolchandrakumar
09/16/2020, 5:43 AMZach Klippenstein (he/him) [MOD]
09/16/2020, 5:46 AMMaterialTheme
, convert the colors to Android color ints, and set the appropriate color values on the EditText
.coolchandrakumar
09/16/2020, 5:49 AMcoolchandrakumar
09/16/2020, 5:49 AMZach Klippenstein (he/him) [MOD]
09/16/2020, 5:53 AMThough MaterialTheme.colors is a composable, I can not it use it directly.What do you mean by âuse it directlyâ? Thereâs no automatic wiring of android theme colors to compose theme colors or vice versa, no.
coolchandrakumar
09/16/2020, 5:53 AM@Composable
private fun androidViewColor() {
MaterialTheme(colors = themeColor) {
AndroidView(viewBlock = { context ->
android.widget.EditText(context).apply {
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
setText("HelloWorld")
//setBackgroundColor(android.graphics.Color.BLUE)
//ThisPart
//setBackgroundColor(android.graphics.Color.parseColor("#${MaterialTheme.colors.background.value}"))
}
})
}}
Zach Klippenstein (he/him) [MOD]
09/16/2020, 6:03 AMviewBlock
that are derived from data in the composition that could change. Thatâs what the update
block is for. The update
block will be re-invoked when the composable needs to be recomposed, e.g. if the theme changes, where as the viewBlock
will only be executed once to create the view.Zach Klippenstein (he/him) [MOD]
09/16/2020, 6:04 AMColor.toArgb()
returns a color int in the same format that Androidâs Color
class expects, you donât need to do the intermediate string.Zach Klippenstein (he/him) [MOD]
09/16/2020, 6:05 AMMaterialTheme {}
wrapper, since youâre not using any components that read the theme ambient.Zach Klippenstein (he/him) [MOD]
09/16/2020, 6:09 AM@Composable fun androidViewColor() {
val themeColors = MaterialTheme.colors
AndroidView({ EditText(it).apply {
layoutParams = âŚ
setText("HelloWorld")
}}) {
setText("HelloWorld")
setBackgroundColor(themeColors.background.toArgb())
}
}
coolchandrakumar
09/16/2020, 6:13 AMcoolchandrakumar
09/16/2020, 6:18 AMZach Klippenstein (he/him) [MOD]
09/16/2020, 4:14 PMcoolchandrakumar
09/17/2020, 4:39 AMcoolchandrakumar
09/17/2020, 4:43 AM