Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix background colors in App Bars #230 #236

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ val md_theme_light_primary = Color(0xFF934B00)
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
val md_theme_light_primaryContainer = Color(0xFFFFDCC5)
val md_theme_light_onPrimaryContainer = Color(0xFF301400)
val md_theme_light_secondary = Color(0xFF755945)
val md_theme_light_secondary = Color(0xFF755945)//
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been included in the commit by mistake?

val md_theme_light_onSecondary = Color(0xFFFFFFFF)
val md_theme_light_secondaryContainer = Color(0xFFFFDCC5)
val md_theme_light_onSecondaryContainer = Color(0xFF2A1708)
Expand All @@ -23,7 +23,7 @@ val md_theme_light_onBackground = Color(0xFF201A17)
val md_theme_light_surface = Color(0xFFFFFBFF)
val md_theme_light_onSurface = Color(0xFF201A17)
val md_theme_light_surfaceVariant = Color(0xFFF3DFD2)
val md_theme_light_onSurfaceVariant = Color(0xFF52443B)
val md_theme_light_onSurfaceVariant = Color(0xFF52443B)//
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been included in the commit by mistake?

val md_theme_light_outline = Color(0xFF84746A)
val md_theme_light_inverseOnSurface = Color(0xFFFBEEE8)
val md_theme_light_inverseSurface = Color(0xFF362F2B)
Expand All @@ -38,7 +38,7 @@ val md_theme_dark_onPrimary = Color(0xFF4F2500)
val md_theme_dark_primaryContainer = Color(0xFF703800)
val md_theme_dark_onPrimaryContainer = Color(0xFFFFDCC5)
val md_theme_dark_secondary = Color(0xFFE4BFA7)
val md_theme_dark_onSecondary = Color(0xFF422B1A)
val md_theme_dark_onSecondary = Color(0xFF422B1A)//
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been included in the commit by mistake?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh yeah sorry it was by mistake

val md_theme_dark_secondaryContainer = Color(0xFF5B412F)
val md_theme_dark_onSecondaryContainer = Color(0xFFFFDCC5)
val md_theme_dark_tertiary = Color(0xFFC7CA95)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private val DarkColors = darkColorScheme(
surfaceVariant = md_theme_dark_surfaceVariant,
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
outline = md_theme_dark_outline,
inverseOnSurface = md_theme_dark_inverseOnSurface,
inverseOnSurface = md_theme_light_inverseSurface,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't modify this file. Also, this is incorrect: why assigning a light-themed color to a dark-themed variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh my bad I was changing the color to see the matching bottom bar color.

inverseSurface = md_theme_dark_inverseSurface,
inversePrimary = md_theme_dark_inversePrimary,
surfaceTint = md_theme_dark_surfaceTint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down