Doris Liu
07/16/2020, 2:09 AMTimo Drick
07/16/2020, 9:34 AMval colorKey = ColorPropKey()
val widthKey = DpPropKey()
val heightKey = DpPropKey()
val definition = transitionDefinition {
state(State.First) {
this[colorKey] = Color.Red
this[widthKey] = 200.dp
this[heightKey] = 400.dp
}
state(State.Second) {
this[colorKey] = Color.Green
this[widthKey] = 300.dp
this[heightKey] = 300.dp
}
}
maybe it would be possible using delegates to get a DSL like this:
val colorKey by ColorPropKey()
val widthKey by DpPropKey()
val heightKey by DpPropKey()
val definition = transitionDefinition {
state(State.First) {
colorKey = Color.Red
widthKey = 200.dp
heightKey = 400.dp
}
state(State.Second) {
colorKey = Color.Green
widthKey = 300.dp
heightKey = 300.dp
}
}
Fudge
07/16/2020, 10:12 AMvar
Doris Liu
07/16/2020, 8:57 PMtransition (State.First to State.Second) {
colorKey using tween(..)
}