Facundo Rodriguez Arceri
11/20/2019, 1:25 PMFacundo Rodriguez Arceri
11/20/2019, 1:26 PM@Composable
fun Input(value: Double, label: String, changeListener: ((Double) -> Unit)) {
Column {
Text(text = label)
TextField(value = EditorModel(text = value.toString()), keyboardType = KeyboardType.Number,
onValueChange = {
changeListener(it.text.toDouble())
})
}
}
Facundo Rodriguez Arceri
11/20/2019, 1:26 PMBruno_
11/20/2019, 1:27 PMFacundo Rodriguez Arceri
11/20/2019, 1:28 PMInput(model.initial, "Initial capital") {
model.initial = it
}
Facundo Rodriguez Arceri
11/20/2019, 1:29 PMFacundo Rodriguez Arceri
11/20/2019, 1:30 PMBruno_
11/20/2019, 1:31 PM@Composable
fun TextEdit(property: KMutableProperty0<String>) {
Container(padding = EdgeInsets(5.dp)) {
Surface(border = Border(Color.Black, 1.dp)) {
Padding(10.dp) {
TextField(value = property.get(), onValueChange = property.setter)
}
}
}
}
maybe it's a bug?Facundo Rodriguez Arceri
11/20/2019, 1:33 PMLeland Richardson [G]
11/20/2019, 5:06 PMLeland Richardson [G]
11/20/2019, 5:07 PMLeland Richardson [G]
11/20/2019, 5:08 PMFacundo Rodriguez Arceri
11/20/2019, 5:37 PMTextField
in a Row
, but it crashes (someone reported it previously), so a moved it inside a Column
. I think that bug is already sent and fixed in master, but I'm not sure about this one.Leland Richardson [G]
11/20/2019, 5:56 PMLeland Richardson [G]
11/20/2019, 5:57 PMkioba
11/21/2019, 10:24 AMrow
and TextField
, I believe he found issues after the fix too but he might be able to express it better 🙂Luca Nicoletti
11/21/2019, 10:25 AMTextField
in a row will occupy the entire parent, leading you to have elements outside the screen(or parent) if the Row
contains other elements https://issuetracker.google.com/issues/144301458Facundo Rodriguez Arceri
11/21/2019, 1:30 PMLeland Richardson [G]
11/21/2019, 5:54 PMFacundo Rodriguez Arceri
11/21/2019, 5:55 PM