Colton Idle
09/18/2020, 5:44 AM@Composable
fun MyInput() {
Column(Modifier.padding(16.dp)) {
val textState by remember { mutableStateOf(TextFieldValue()) }
TextField(
value = textState.text,
onValueChange = { textState = it) }
)
Text("The textfield says: " + textState.text)
}
}
note: I'm trying to learn via little samples from https://foso.github.io/Jetpack-Compose-Playground/cookbook/textfield_changes/ but let me know if there is another resource or some more official docs with these sorts of samples. I understand theres a bunch of sample apps, but I'm just trying to learn component by component first, and not jumping into an entire application.Marcin Środa
09/18/2020, 6:00 AM@Composable
fun MyInput() {
Column(Modifier.padding(16.dp)) {
val textState = remember { mutableStateOf(TextFieldValue()) }
TextField(
value = textState.value,
onValueChange = { textState.value = it }
)
Text("The textfield says: " + textState.value.text)
}
}
Timo Drick
09/18/2020, 11:24 AMColumn(Modifier.padding(16.dp)) {
var textState by remember { mutableStateOf(TextFieldValue()) }
BaseTextField(
value = textState,
onValueChange = { textState = it }
)
Text("The textfield says: " + textState.text)
}
Foso
09/18/2020, 9:13 PMColton Idle
09/24/2020, 3:11 AM