From 35d0b3953113819f89dd211e2df15817994b0355 Mon Sep 17 00:00:00 2001 From: Sahil Khan <85223122+sahilsk3333@users.noreply.github.com> Date: Thu, 16 Nov 2023 05:35:29 +0530 Subject: [PATCH] Replaced TopAppBar with CenterAlignedTopAppBar, Fix issue #857 App title moves (#930) --- .../google/samples/apps/sunflower/compose/home/HomeScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt b/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt index d7b6400e2..5b274d74a 100644 --- a/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt +++ b/app/src/main/java/com/google/samples/apps/sunflower/compose/home/HomeScreen.kt @@ -30,6 +30,7 @@ import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.PagerState import androidx.compose.foundation.pager.rememberPagerState +import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton @@ -38,7 +39,6 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Tab import androidx.compose.material3.TabRow import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarScrollBehavior import androidx.compose.runtime.Composable @@ -169,7 +169,7 @@ private fun HomeTopAppBar( scrollBehavior: TopAppBarScrollBehavior, modifier: Modifier = Modifier ) { - TopAppBar( + CenterAlignedTopAppBar( title = { Row( Modifier.fillMaxWidth(),