From aa6ddac9c5a1d0abc30a0bc73eb69de3754773f6 Mon Sep 17 00:00:00 2001 From: GG Bond Date: Sat, 20 Apr 2024 16:05:46 +0800 Subject: [PATCH] Avoid unnecessary zIndex --- .../com/hippo/ehviewer/ui/main/FabLayout.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/main/FabLayout.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/main/FabLayout.kt index 1198e8908..4c3f90ba2 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/main/FabLayout.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/main/FabLayout.kt @@ -169,15 +169,6 @@ fun FabLayout( } } } - FloatingActionButton(onClick = { onExpandChanged(!updatedExpanded) }) { - Icon( - imageVector = Icons.Default.Close, - contentDescription = null, - modifier = Modifier.graphicsLayer { - rotationZ = lerp(-135f, 0f, animatedProgress) - }, - ) - } secondaryFab.run { forEachIndexed { index, (imageVector, onClick) -> SmallFloatingActionButton( @@ -193,7 +184,7 @@ fun FabLayout( val placeable = measurable.measure(constraints) layout(placeable.width, placeable.height) { val distance = lerp(0, 150 * (size - index) + 50, animatedProgress) - placeable.placeRelative(0, -distance, -(size - index).toFloat()) + placeable.placeRelative(0, -distance) } }, ) { @@ -201,6 +192,15 @@ fun FabLayout( } } } + FloatingActionButton(onClick = { onExpandChanged(!updatedExpanded) }) { + Icon( + imageVector = Icons.Default.Close, + contentDescription = null, + modifier = Modifier.graphicsLayer { + rotationZ = lerp(-135f, 0f, animatedProgress) + }, + ) + } } } }