diff --git a/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt b/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt index ffb84ac7..fb3e7f12 100644 --- a/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt +++ b/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt @@ -8,10 +8,12 @@ import androidx.compose.material.icons.outlined.Info import androidx.compose.material.icons.automirrored.outlined.List import androidx.compose.material.icons.outlined.Settings import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Surface import androidx.compose.material3.Text +import androidx.compose.material3.surfaceColorAtElevation import androidx.compose.runtime.Composable import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow @@ -20,6 +22,7 @@ import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController import com.lorenzovainigli.foodexpirationdates.R import com.lorenzovainigli.foodexpirationdates.ui.theme.FoodExpirationDatesTheme +import com.lorenzovainigli.foodexpirationdates.ui.theme.TonalElevation import com.lorenzovainigli.foodexpirationdates.view.composable.screen.Screen import com.lorenzovainigli.foodexpirationdates.view.preview.LanguagePreviews @@ -48,7 +51,7 @@ fun MyBottomAppBar( unselectedIcon = Icons.Outlined.Info ) ) - NavigationBar { + NavigationBar(containerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(TonalElevation.level2())) { var selectedItem = when (currentDestination) { Screen.AboutScreen.route -> 2 Screen.SettingsScreen.route -> 1 diff --git a/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyTopAppBar.kt b/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyTopAppBar.kt index 438b9aa3..69221695 100644 --- a/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyTopAppBar.kt +++ b/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyTopAppBar.kt @@ -9,7 +9,9 @@ import androidx.compose.material3.IconButton import androidx.compose.material3.LargeTopAppBar import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarScrollBehavior +import androidx.compose.material3.surfaceColorAtElevation import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.ui.platform.LocalContext @@ -19,6 +21,7 @@ import androidx.compose.ui.tooling.preview.PreviewLightDark import com.lorenzovainigli.foodexpirationdates.R import com.lorenzovainigli.foodexpirationdates.model.repository.PreferencesRepository import com.lorenzovainigli.foodexpirationdates.ui.theme.FoodExpirationDatesTheme +import com.lorenzovainigli.foodexpirationdates.ui.theme.TonalElevation import com.lorenzovainigli.foodexpirationdates.view.MainActivity @OptIn(ExperimentalMaterial3Api::class) @@ -49,7 +52,10 @@ fun MyTopAppBar( }, actions = actions, navigationIcon = navigationIcon, - scrollBehavior = scrollBehavior + scrollBehavior = scrollBehavior, + colors = TopAppBarDefaults.topAppBarColors( + scrolledContainerColor = MaterialTheme.colorScheme.surfaceColorAtElevation(TonalElevation.level2()) + ) ) }