SrSouza
10/29/2019, 6:57 PM@Model
object MyHomeState {
var isDoingSomething = false
fun turnDoingSomething() {
isDoingSomething = !isDoingSomething
}
}
@Composable
private fun MyHomeContent() {
Padding(32.dp) {
Row {
Button(
style = if(!MyHomeState.isDoingSomething) ContainedButtonStyle() else OutlinedButtonStyle(),
onClick = if(MyHomeState.isDoingSomething) null else MyHomeState::turnDoingSomething
) {
Text("START")
}
WidthSpacer(width = 16.dp)
Button(
style = if(MyHomeState.isDoingSomething) ContainedButtonStyle() else OutlinedButtonStyle(),
onClick = if(!MyHomeState.isDoingSomething) null else MyHomeState::turnDoingSomething
) {
Text("STOP")
}
}
}
}
jim
10/29/2019, 7:01 PMChuck Jazdzewski [G]
10/29/2019, 7:58 PMmemo
as a different number of parameters) than the effect that was at this spot in the composition. Since they both use the same key sometimes the composer gets confused causing this issue.
Please report this as a bug and we can work around it in Ripple.kt
. Eventually, when we switch to using the unary +
to converting effects to be @Composable
functions, this type of issue will go away.SrSouza
10/29/2019, 8:16 PMChuck Jazdzewski [G]
10/29/2019, 9:00 PM