From 21a8693a818674447a5e83a98c301e3764693370 Mon Sep 17 00:00:00 2001 From: ASHWANI KUMAR <85477554+ashwanil23@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:33:54 +0530 Subject: [PATCH 1/2] Update HomeScreen.kt Removed fillMaxWidth() from CenterAlignedTopAppBar's title because when switching between My garden and Plant list filter icon pops up and pushes CenterAlignedTopAppBar to the left. --- .../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 7a32e18d5..e5ba4edef 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 @@ -169,12 +169,12 @@ private fun HomeTopAppBar( CenterAlignedTopAppBar( title = { Row( - Modifier.fillMaxWidth(), + Modifier, horizontalArrangement = Arrangement.Center, ) { Text( text = stringResource(id = R.string.app_name), - style = MaterialTheme.typography.displaySmall + style = MaterialTheme.typography.headlineSmall ) } }, From ab5bda3b9adad600e0e767f8f21f4d28ebb1d6bb Mon Sep 17 00:00:00 2001 From: ASHWANI KUMAR <85477554+ashwanil23@users.noreply.github.com> Date: Thu, 25 Jul 2024 10:00:51 +0530 Subject: [PATCH 2/2] Update HomeScreen.kt Yes even after removing the Row composable its working good that means Row composable is useless we can remove it --- .../google/samples/apps/sunflower/compose/home/HomeScreen.kt | 5 ----- 1 file changed, 5 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 e5ba4edef..39cd70df7 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 @@ -168,15 +168,10 @@ private fun HomeTopAppBar( ) { CenterAlignedTopAppBar( title = { - Row( - Modifier, - horizontalArrangement = Arrangement.Center, - ) { Text( text = stringResource(id = R.string.app_name), style = MaterialTheme.typography.headlineSmall ) - } }, modifier = modifier, actions = {