diff --git a/src/main/kotlin/com/looker/droidify/ui/compose/components/TopBar.kt b/src/main/kotlin/com/looker/droidify/ui/compose/components/TopBar.kt index 833b64bb..febbd1a9 100644 --- a/src/main/kotlin/com/looker/droidify/ui/compose/components/TopBar.kt +++ b/src/main/kotlin/com/looker/droidify/ui/compose/components/TopBar.kt @@ -1,14 +1,31 @@ package com.looker.droidify.ui.compose.components import androidx.compose.foundation.background -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material.icons.rounded.Search -import androidx.compose.material3.* -import androidx.compose.runtime.* +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.LargeTopAppBar +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.material3.TextField +import androidx.compose.material3.TextFieldDefaults +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.material3.TopAppBarScrollBehavior +import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester @@ -27,17 +44,20 @@ import com.looker.droidify.ui.compose.utils.HorizontalExpandingVisibility @Composable fun TopBar( title: String, + scrollBehavior: TopAppBarScrollBehavior? = null, actions: @Composable (RowScope.() -> Unit) ) { - SmallTopAppBar( + LargeTopAppBar( modifier = Modifier.wrapContentHeight(), title = { Text(text = title, style = MaterialTheme.typography.headlineSmall) }, - colors = TopAppBarDefaults.smallTopAppBarColors( - containerColor = MaterialTheme.colorScheme.surface + colors = TopAppBarDefaults.largeTopAppBarColors( + containerColor = MaterialTheme.colorScheme.surface, + scrolledContainerColor = MaterialTheme.colorScheme.surface ), - actions = actions + actions = actions, + scrollBehavior = scrollBehavior ) }