fix: fixed top bar and added back handler for floating action button

This commit is contained in:
2026-06-23 12:03:13 +03:00
parent 13d6ba0b52
commit d3c194ce9c
@@ -77,6 +77,9 @@ fun Page(
content: @Composable () -> Unit
) {
Scaffold(
topBar = {
TopBar(name, innerPadding)
},
floatingActionButton = floatingActionButton
) { padding ->
Box(
@@ -105,6 +108,12 @@ fun ExpandableFab(
val rotation by animateFloatAsState(if (isExpanded) 45f else 0f)
BackHandler(
enabled = isExpanded
) {
isExpanded = false
}
Column(
horizontalAlignment = Alignment.End,
verticalArrangement = Arrangement.spacedBy(8.dp)
@@ -145,7 +154,7 @@ fun ExpandableFab(
}
@Composable
fun TopBar(text: String, innerPadding: PaddingValues, openMenuButton: (@Composable () -> Unit)? = null) {
fun TopBar(text: String, innerPadding: PaddingValues) {
Row(
modifier = Modifier
.fillMaxWidth()
@@ -155,10 +164,6 @@ fun TopBar(text: String, innerPadding: PaddingValues, openMenuButton: (@Composab
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
if (openMenuButton != null) {
openMenuButton()
}
Text(
text,
modifier = Modifier,