Javier
12/16/2021, 10:45 AM// Doesn't work, it keeps the size over the time.
SomeComponent(
shape = RoundedCornerShape(if (someState) 8.dp else 30.dp),
)
// Work, size is changing
SomeComponent(
shape = if (someState) RoundedCornerShape(8.dp) else RoundedCornerShape(30.dp),
)Tgo1014
12/16/2021, 10:46 AMmutableStateOf{} to trigger the corner recompositionJavier
12/16/2021, 10:48 AMsomeState is a by remember { mutableStateOf(...) }. Even using a dp size as state it doesnt work.
// Doesn't work, it keeps the size over the time.
SomeComponent(
shape = RoundedCornerShape(someSizeState),
)Zoltan Demant
12/16/2021, 10:55 AMTgo1014
12/16/2021, 10:57 AMif is triggered again inside the parameters of the shape, maybe you can use produceState to create a cornerSize var that will recompose SomeComponentJavier
12/16/2021, 11:04 AMJavier
12/16/2021, 11:05 AMAndrey Kulikov
12/16/2021, 2:22 PM