I have a LazyRow and I wanted to have a slideInHorizontally effect with a bounce effect. But, the child on the right is always clipped. I remembered back in the XML, you can easily just clipToBounds = false.
But, can't seemed to able to achieve the same effect with Compose.
Segment
slideInHorizontally( initialOffsetX = { it }, animationSpec = spring( dampingRatio = Spring.DampingRatioMediumBouncy, stiffness = Spring.StiffnessLow ) ) Code
val cards = (1..52).map { it.toString() } val lazyListState = rememberLazyListState() Box( modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center ) { var visible by remember { mutableStateOf(false) } LaunchedEffect(Unit) { visible = true } AnimatedVisibility( visible = visible, enter = slideInHorizontally( initialOffsetX = { it }, animationSpec = spring( dampingRatio = Spring.DampingRatioMediumBouncy, stiffness = Spring.StiffnessLow ) ), ) { LazyRow( modifier = Modifier.align(Alignment.BottomCenter), state = lazyListState, contentPadding = PaddingValues(16.dp), horizontalArrangement = Arrangement.spacedBy(12.dp), flingBehavior = ScrollableDefaults.flingBehavior(), ) { items(cards) { card -> Card( modifier = Modifier.size(width = 150.dp, height = 210.dp), shape = RoundedCornerShape(8.dp), colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.onPrimaryContainer) ) { Box( modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center ) { Text(card, color = MaterialTheme.colorScheme.onPrimary) } } } } } } 
