1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-04-20 09:43:12 +00:00

Add colors for Compose scrollbars

This commit is contained in:
Isira Seneviratne 2024-09-16 15:33:41 +05:30
parent 43bbddcc26
commit c0388d948b
2 changed files with 8 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem
import org.schabi.newpipe.info_list.ItemViewMode
import org.schabi.newpipe.ui.components.items.playlist.PlaylistListItem
import org.schabi.newpipe.ui.components.items.stream.StreamListItem
import org.schabi.newpipe.ui.theme.NewPipeScrollbarSettings
import org.schabi.newpipe.util.DependentPreferenceHelper
import org.schabi.newpipe.util.NavigationHelper
@ -72,7 +73,7 @@ fun ItemList(
} else {
val state = rememberLazyListState()
LazyColumnScrollbar(state = state) {
LazyColumnScrollbar(state = state, settings = NewPipeScrollbarSettings) {
LazyColumn(modifier = nestedScrollModifier, state = state) {
listHeader()

View File

@ -8,6 +8,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.preference.PreferenceManager
import my.nanihadesuka.compose.ScrollbarSettings
private val lightScheme = lightColorScheme(
primary = primaryLight,
@ -87,6 +88,11 @@ private val darkScheme = darkColorScheme(
private val blackScheme = darkScheme.copy(surface = Color.Black)
val NewPipeScrollbarSettings = ScrollbarSettings(
thumbSelectedColor = primaryDark,
thumbUnselectedColor = primaryLight
)
@Composable
fun AppTheme(useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(LocalContext.current)