Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Hi,
It's about a some fix for FAB. The problem is AnimatedVisibility
default animation expandIn
include ChangeSize
and it's default value is IntSize(0, 0)
. When it size was Zero, the FAB doesn't draw when recomposition. If this bug comes from production, you can fix it like below.
var flag by remember { mutableStateOf(true) }
Scaffold(
floatingActionButton = {
AnimatedVisibility(
visible = flag,
enter = fadeIn() + expandIn { IntSize(width = 1, height = 1) })
{
FloatingActionButton(onClick = {}) {
Icon(Icons.Default.ArrowBack, null)
}
}
},
) {
Switch(flag, { flag = it })
}
Chage:
jb...@google.com <jb...@google.com>
ju...@google.com <ju...@google.com> #3
expandIn { IntSize ...
fix works, but has the same problem as with wrapping AnimatedVisibility
in fixed size Box
: the shadow is cropped during the transition, as can be seen in the withBox.gif
attached to original post.
Description
Compose libraries with a
Lifecycle
dependency mostly still depend on version2.3.1
. There have been 2 minor version releases that include lots of features and bug fixes.Would be nice if Compose upgraded its dependency to
2.5.1
to get all of the latest changes.