```floatingActionButton = { AnimatedVisibility( visible = !sheetState.isVisible, ...
e
Copy code
floatingActionButton = {
    AnimatedVisibility(
        visible = !sheetState.isVisible,
        enter = fadeIn(),
        exit = fadeOut(),
    ) {
        FloatingActionButton(
            onClick = {
                ...
            }
        ) {
            Icon(imageVector = Icons.Rounded.Edit, contentDescription = null)
        }
    }
},
I'm trying to add visibility animation using
AnimatedVisibility
on my FAB, but when the animation is running, the FAB shadow change into weird box shape. How can I fix this? Thanks in advance.
f
Try using transition that does not clip it's content. I am not really sure (since I've never used it) but I guess you'll have to use
AnimatedContent
and
ContentTransform
with
SizeTransform(clip = false)
.
e
I'll try it, thank you!
f
Be sure to write a solution if you find some for future reference 🙏
d
The clipping is unfortunately the result of using a layer for animating alpha. @Nader Jawad Is there a workaround for this?
n
Yes this looks like layer clipping. The recommended workaround is to increase the size of the Composable to account for the shadow.