Removing unnecessary layouts from the top bar

pull/819/head
Vitor Pamplona 2024-03-25 17:57:11 -04:00
rodzic 4274d2ddbd
commit aff6588791
1 zmienionych plików z 6 dodań i 24 usunięć

Wyświetl plik

@ -31,7 +31,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
@ -47,7 +47,6 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable import androidx.compose.runtime.Stable
@ -185,8 +184,7 @@ private fun RenderTopRouteBar(
Route.Video.base -> StoriesTopBar(followLists, drawerState, accountViewModel, nav) Route.Video.base -> StoriesTopBar(followLists, drawerState, accountViewModel, nav)
Route.Discover.base -> DiscoveryTopBar(followLists, drawerState, accountViewModel, nav) Route.Discover.base -> DiscoveryTopBar(followLists, drawerState, accountViewModel, nav)
Route.Notification.base -> NotificationTopBar(followLists, drawerState, accountViewModel, nav) Route.Notification.base -> NotificationTopBar(followLists, drawerState, accountViewModel, nav)
Route.Settings.base -> Route.Settings.base -> TopBarWithBackButton(stringResource(id = R.string.application_preferences), navPopBack)
TopBarWithBackButton(stringResource(id = R.string.application_preferences), navPopBack)
else -> { else -> {
if (id != null) { if (id != null) {
when (currentRoute) { when (currentRoute) {
@ -495,27 +493,13 @@ fun GenericMainTopBar(
) { ) {
Column(modifier = BottomTopHeight) { Column(modifier = BottomTopHeight) {
TopAppBar( TopAppBar(
colors =
TopAppBarDefaults.topAppBarColors(
containerColor = MaterialTheme.colorScheme.surface,
),
title = { title = {
Column( Column(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) { ) {
Box(Modifier) { content()
Column(
modifier =
Modifier
.fillMaxWidth()
.fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
content()
}
}
} }
}, },
navigationIcon = { navigationIcon = {
@ -545,9 +529,7 @@ private fun LoggedInUserPictureDrawer(
val profilePicture by val profilePicture by
accountViewModel.account.userProfile().live().profilePictureChanges.observeAsState() accountViewModel.account.userProfile().live().profilePictureChanges.observeAsState()
IconButton( IconButton(onClick = onClick) {
onClick = onClick,
) {
RobohashFallbackAsyncImage( RobohashFallbackAsyncImage(
robot = accountViewModel.userProfile().pubkeyHex, robot = accountViewModel.userProfile().pubkeyHex,
model = profilePicture, model = profilePicture,