codeslubber
02/28/2020, 5:16 PM@Composable
fun TimerView() {
val timerState = state { TimerState(minutes = TimeDigit(8)) }
Column {
Align(Alignment.Center) {
Text(text = timerState.value.currentStatus, style = TextStyle(fontSize = 36.sp))
Text("What is going on here????")
TextField(value = "50", onValueChange = {})
}
}
}
renders as this:Louis Pullen-Freilich [G]
02/28/2020, 6:07 PMAlign
, it is a layout that only expects one child.
Instead I think you want to have:
@Composable
fun TimerView() {
val timerState = state { TimerState(minutes = TimeDigit(8)) }
Column(modifier = LayoutAlign.Center) {
Text(text = timerState.value.currentStatus, style = TextStyle(fontSize = 36.sp))
Text("What is going on here????")
TextField(value = "50", onValueChange = {})
}
}
Align
have mostly all been replaced by modifiers, so you should try to use them instead 🙂 they help avoid confusing behavior such as thisLeland Richardson [G]
02/28/2020, 6:25 PMLouis Pullen-Freilich [G]
02/28/2020, 6:26 PMLeland Richardson [G]
02/28/2020, 6:28 PMcodeslubber
02/28/2020, 6:40 PMLouis Pullen-Freilich [G]
02/28/2020, 6:42 PMLeland Richardson [G]
02/28/2020, 6:43 PMcodeslubber
02/28/2020, 7:12 PMLeland Richardson [G]
02/28/2020, 7:15 PMAdam Powell
02/28/2020, 10:55 PM@Composable
functions inside of a remember {}
block somewhere. It's supposed to be a compiler error but said error isn't hooked up yet and it tends to produce that exception or one like it.Leland Richardson [G]
02/28/2020, 11:06 PM