Skip to content

Commit

Permalink
fix(ui): NavigationBarItem color
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 committed Jan 31, 2024
1 parent 3598ca7 commit be72b4d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/src/main/java/me/ash/reader/ui/component/FilterBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit be72b4d

Please sign in to comment.