Fix invisible FAB being clickable
This commit is contained in:
1 parent
7d74781f96
commit
ef8adb00f4
2 files changed
+8
-4
No files matched your search
@@ -104,7 +104,10 @@ class FabLayout @JvmOverloads constructor(
|
||||
modifier = Modifier.fillMaxSize().padding(16.dp),
|
||||
contentAlignment = Alignment.BottomEnd,
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center) {
|
||||
Box(
|
||||
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
val animatedProgress by animateFloatMergePredictiveBackAsState(
|
||||
enable = expanded,
|
||||
animationSpec = tween(FAB_ANIMATE_TIME, if (mHidden) FAB_ANIMATE_TIME else 0),
|
||||
@@ -112,7 +115,6 @@ class FabLayout @JvmOverloads constructor(
|
||||
) { expanded = false }
|
||||
FloatingActionButton(
|
||||
onClick = { expanded = !expanded },
|
||||
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Close,
|
||||
|
||||
@@ -72,14 +72,16 @@ fun FabLayout(
|
||||
modifier = Modifier.fillMaxSize().navigationBarsPadding().padding(16.dp),
|
||||
contentAlignment = Alignment.BottomEnd,
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center) {
|
||||
Box(
|
||||
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
val animatedProgress by animateFloatMergePredictiveBackAsState(
|
||||
enable = expanded,
|
||||
animationSpec = tween(FAB_ANIMATE_TIME),
|
||||
) { onExpandChanged(false) }
|
||||
FloatingActionButton(
|
||||
onClick = { onExpandChanged(!expanded) },
|
||||
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Close,
|
||||
|
||||
Reference in new issue
Block a user