diff --git a/app/src/main/java/me/ash/reader/ui/component/FilterBar.kt b/app/src/main/java/me/ash/reader/ui/component/FilterBar.kt index 249d1f2a2..32b066bae 100644 --- a/app/src/main/java/me/ash/reader/ui/component/FilterBar.kt +++ b/app/src/main/java/me/ash/reader/ui/component/FilterBar.kt @@ -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))