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),
|
modifier = Modifier.fillMaxSize().padding(16.dp),
|
||||||
contentAlignment = Alignment.BottomEnd,
|
contentAlignment = Alignment.BottomEnd,
|
||||||
) {
|
) {
|
||||||
Box(contentAlignment = Alignment.Center) {
|
Box(
|
||||||
|
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
val animatedProgress by animateFloatMergePredictiveBackAsState(
|
val animatedProgress by animateFloatMergePredictiveBackAsState(
|
||||||
enable = expanded,
|
enable = expanded,
|
||||||
animationSpec = tween(FAB_ANIMATE_TIME, if (mHidden) FAB_ANIMATE_TIME else 0),
|
animationSpec = tween(FAB_ANIMATE_TIME, if (mHidden) FAB_ANIMATE_TIME else 0),
|
||||||
@@ -112,7 +115,6 @@ class FabLayout @JvmOverloads constructor(
|
|||||||
) { expanded = false }
|
) { expanded = false }
|
||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
onClick = { expanded = !expanded },
|
onClick = { expanded = !expanded },
|
||||||
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Close,
|
imageVector = Icons.Default.Close,
|
||||||
|
|||||||
@@ -72,14 +72,16 @@ fun FabLayout(
|
|||||||
modifier = Modifier.fillMaxSize().navigationBarsPadding().padding(16.dp),
|
modifier = Modifier.fillMaxSize().navigationBarsPadding().padding(16.dp),
|
||||||
contentAlignment = Alignment.BottomEnd,
|
contentAlignment = Alignment.BottomEnd,
|
||||||
) {
|
) {
|
||||||
Box(contentAlignment = Alignment.Center) {
|
Box(
|
||||||
|
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
val animatedProgress by animateFloatMergePredictiveBackAsState(
|
val animatedProgress by animateFloatMergePredictiveBackAsState(
|
||||||
enable = expanded,
|
enable = expanded,
|
||||||
animationSpec = tween(FAB_ANIMATE_TIME),
|
animationSpec = tween(FAB_ANIMATE_TIME),
|
||||||
) { onExpandChanged(false) }
|
) { onExpandChanged(false) }
|
||||||
FloatingActionButton(
|
FloatingActionButton(
|
||||||
onClick = { onExpandChanged(!expanded) },
|
onClick = { onExpandChanged(!expanded) },
|
||||||
modifier = Modifier.rotate(lerp(-90f, 0f, appearState)).scale(appearState),
|
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.Default.Close,
|
imageVector = Icons.Default.Close,
|
||||||
|
|||||||
Reference in new issue
Block a user