ursus
02/22/2023, 11:49 PMAnimatedVisibility
to expand/collapse some content inside ModalBottomSheetLayout
the animation is odd when collapsing.
The sheet it appears to be "jumping", i.e. settings its height in such way that there is a hole at the bottom for a brief period, which doesn't feel correct for a bottom sheet
It feels like it's some sort of springy easing function, any idea what I have to tweak?efemoney
02/23/2023, 7:30 AMAnimatedVisibility(
visible = selections.isNotEmpty(),
enter = expandVertically(expandFrom = <http://Alignment.Top|Alignment.Top>),
exit = shrinkVertically(shrinkTowards = <http://Alignment.Top|Alignment.Top>),
) {
// We hold the state locally so that while the transition is 'Visible' we can still draw the chips.
var localSelections by remember { mutableStateOf(selections) }
// Only update the local state when we are not transitioning, ie when current & target are equal
if (transition.currentState == transition.targetState) localSelections = selections
SelectionChips(localSelections)
}
jossiwolf
02/23/2023, 8:29 AMursus
02/23/2023, 12:55 PMefemoney
02/23/2023, 12:56 PM