mirror of https://github.com/Ashinch/ReadYou.git
fix(ui): NavigationBarItem color
This commit is contained in:
parent
a2f84965d3
commit
1dc906b84b
|
@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.width
|
|||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.unit.Dp
|
||||
|
@ -29,6 +30,11 @@ fun FilterBar(
|
|||
) {
|
||||
val view = LocalView.current
|
||||
val themeIndex = LocalThemeIndex.current
|
||||
val indicatorColor = if (themeIndex == 5 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
MaterialTheme.colorScheme.secondaryContainer
|
||||
} else {
|
||||
MaterialTheme.colorScheme.primaryContainer
|
||||
} onDark MaterialTheme.colorScheme.secondaryContainer
|
||||
|
||||
NavigationBar(
|
||||
modifier = Modifier
|
||||
|
@ -75,12 +81,10 @@ fun FilterBar(
|
|||
filterOnClick(item)
|
||||
},
|
||||
colors = NavigationBarItemDefaults.colors(
|
||||
indicatorColor = if (themeIndex == 5 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
MaterialTheme.colorScheme.secondaryContainer
|
||||
} else {
|
||||
MaterialTheme.colorScheme.primaryContainer
|
||||
} onDark MaterialTheme.colorScheme.secondaryContainer,
|
||||
),
|
||||
indicatorColor = indicatorColor,
|
||||
unselectedIconColor = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
selectedIconColor = MaterialTheme.colorScheme.contentColorFor(indicatorColor)
|
||||
)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(filterBarPadding))
|
||||
|
|
Loading…
Reference in New Issue