Restore the legacy bottom navigation gradient styling.

Apply the old blue gradient treatment to the Compose bottom bar so it visually matches the previous project implementation.

Made-with: Cursor
This commit is contained in:
2026-02-28 16:20:13 +01:00
parent efcd140966
commit 9160edda33
2 changed files with 47 additions and 30 deletions

View File

@@ -1,6 +1,8 @@
package org.db3.airmq.features.navigation package org.db3.airmq.features.navigation
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@@ -10,7 +12,10 @@ import androidx.compose.material3.NavigationBarItemDefaults
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.navigation.NavType import androidx.navigation.NavType
import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.NavGraph.Companion.findStartDestination
import androidx.navigation.compose.NavHost import androidx.navigation.compose.NavHost
@@ -38,7 +43,8 @@ import org.db3.airmq.features.news.NewsDetailScreen
import org.db3.airmq.features.news.NewsScreen import org.db3.airmq.features.news.NewsScreen
import org.db3.airmq.features.settings.SettingsScreen import org.db3.airmq.features.settings.SettingsScreen
import org.db3.airmq.features.setup.SetupScreen import org.db3.airmq.features.setup.SetupScreen
import org.db3.airmq.ui.theme.LegacyNavContainer import org.db3.airmq.ui.theme.LegacyNavGradientEnd
import org.db3.airmq.ui.theme.LegacyNavGradientStart
import org.db3.airmq.ui.theme.LegacyNavSelected import org.db3.airmq.ui.theme.LegacyNavSelected
import org.db3.airmq.ui.theme.LegacyNavUnselected import org.db3.airmq.ui.theme.LegacyNavUnselected
@@ -59,8 +65,16 @@ fun AirMQNavGraph(modifier: Modifier = Modifier) {
modifier = modifier, modifier = modifier,
bottomBar = { bottomBar = {
if (showBottomBar) { if (showBottomBar) {
Box(
modifier = Modifier.background(
brush = Brush.linearGradient(
colors = listOf(LegacyNavGradientEnd, LegacyNavGradientStart)
)
)
) {
NavigationBar( NavigationBar(
containerColor = LegacyNavContainer containerColor = Color.Transparent,
tonalElevation = 0.dp
) { ) {
tabItems.forEach { tabItem -> tabItems.forEach { tabItem ->
NavigationBarItem( NavigationBarItem(
@@ -79,7 +93,7 @@ fun AirMQNavGraph(modifier: Modifier = Modifier) {
unselectedIconColor = LegacyNavUnselected, unselectedIconColor = LegacyNavUnselected,
selectedTextColor = LegacyNavSelected, selectedTextColor = LegacyNavSelected,
unselectedTextColor = LegacyNavUnselected, unselectedTextColor = LegacyNavUnselected,
indicatorColor = LegacyNavContainer indicatorColor = Color.Transparent
), ),
icon = { icon = {
Icon( Icon(
@@ -93,6 +107,7 @@ fun AirMQNavGraph(modifier: Modifier = Modifier) {
} }
} }
} }
}
) { innerPadding -> ) { innerPadding ->
NavHost( NavHost(
navController = navController, navController = navController,

View File

@@ -16,6 +16,8 @@ val LegacyOutlineLight = Color(0x3B000000)
val LegacyNavSelected = Color(0xFFFFFFFF) val LegacyNavSelected = Color(0xFFFFFFFF)
val LegacyNavUnselected = Color(0x8AFFFFFF) val LegacyNavUnselected = Color(0x8AFFFFFF)
val LegacyNavContainer = Color(0xFF295989) val LegacyNavContainer = Color(0xFF295989)
val LegacyNavGradientStart = Color(0xFF005BAB)
val LegacyNavGradientEnd = Color(0xFF4997D1)
val LegacyButtonContained = Color(0xFF135CA5) val LegacyButtonContained = Color(0xFF135CA5)
val LegacyButtonContainedDisabledOverlay = Color(0x1F000000) val LegacyButtonContainedDisabledOverlay = Color(0x1F000000)