use surfaceVariant color for top app bar container color

This commit is contained in:
Satindar Dhillon 2022-09-06 13:20:32 -07:00
parent e4e5afe072
commit d9b0dea0a9
2 changed files with 9 additions and 0 deletions

View file

@ -41,6 +41,9 @@ fun SearchBar(
Text("Home")
}
},
colors = TopAppBarDefaults.smallTopAppBarColors(
containerColor = MaterialTheme.colorScheme.surfaceVariant
),
actions = {
if (showSearchField) {
Text(

View file

@ -1,11 +1,14 @@
import android.annotation.SuppressLint
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Home
import androidx.compose.material3.*
import androidx.compose.material3.TopAppBarDefaults.smallTopAppBarColors
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
@ -25,6 +28,9 @@ fun SettingsView(
topBar = {
SmallTopAppBar(
title = { Text("Settings") },
colors = TopAppBarDefaults.smallTopAppBarColors(
containerColor = MaterialTheme.colorScheme.surfaceVariant
),
actions = {
IconButton(onClick = { navController.navigate(Routes.Home.route) }) {
Icon(