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) + }, + ) + } } } }