Skip to content

Commit 7755d2a

Browse files
committed
Simplifying AppBar logic, it contained a defunct box and animation.
1 parent e7b49a6 commit 7755d2a

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

  • crossPlatform/src/commonMain/kotlin/fr/berliat/hskwidget/ui/application/content

crossPlatform/src/commonMain/kotlin/fr/berliat/hskwidget/ui/application/content/AppBar.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package fr.berliat.hskwidget.ui.application.content
22

3-
import androidx.compose.animation.animateContentSize
43
import androidx.compose.foundation.layout.Arrangement
5-
import androidx.compose.foundation.layout.Box
64
import androidx.compose.foundation.layout.Row
75
import androidx.compose.foundation.layout.fillMaxWidth
86
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -83,10 +81,13 @@ fun AppBar(
8381
title = {
8482
Row(verticalAlignment = Alignment.CenterVertically, // center children vertically
8583
horizontalArrangement = Arrangement.SpaceBetween,
86-
modifier = Modifier.animateContentSize()
8784
) {
8885
val focusRequester = remember { FocusRequester() }
8986

87+
LaunchedEffect(Unit) {
88+
focusRequester.requestFocus()
89+
}
90+
9091
PillSearchBar(
9192
query = localText,
9293
onQueryChange = { onValueChange(it) },
@@ -106,12 +107,6 @@ fun AppBar(
106107
onValueChange(localText.copy(""))
107108
}
108109
)
109-
110-
Box(modifier = Modifier.weight(1f), contentAlignment = Alignment.CenterEnd) {
111-
LaunchedEffect(Unit) {
112-
focusRequester.requestFocus()
113-
}
114-
}
115110
}
116111
},
117112
navigationIcon = {

0 commit comments

Comments
 (0)