Skip to content

Commit 62d4044

Browse files
Make lazy column scrollbars red
1 parent 3785404 commit 62d4044

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/ui/components/items/ItemList.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import androidx.compose.runtime.mutableStateOf
1010
import androidx.compose.runtime.remember
1111
import androidx.compose.runtime.setValue
1212
import androidx.compose.ui.Modifier
13+
import androidx.compose.ui.graphics.Color
1314
import androidx.compose.ui.input.nestedscroll.nestedScroll
1415
import androidx.compose.ui.platform.LocalContext
1516
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
@@ -18,13 +19,15 @@ import androidx.fragment.app.FragmentActivity
1819
import androidx.preference.PreferenceManager
1920
import androidx.window.core.layout.WindowWidthSizeClass
2021
import my.nanihadesuka.compose.LazyColumnScrollbar
22+
import my.nanihadesuka.compose.ScrollbarSettings
2123
import org.schabi.newpipe.R
2224
import org.schabi.newpipe.extractor.InfoItem
2325
import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem
2426
import org.schabi.newpipe.extractor.stream.StreamInfoItem
2527
import org.schabi.newpipe.info_list.ItemViewMode
2628
import org.schabi.newpipe.ui.components.items.playlist.PlaylistListItem
2729
import org.schabi.newpipe.ui.components.items.stream.StreamListItem
30+
import org.schabi.newpipe.ui.theme.md_theme_dark_primary
2831
import org.schabi.newpipe.util.DependentPreferenceHelper
2932
import org.schabi.newpipe.util.NavigationHelper
3033

@@ -72,7 +75,13 @@ fun ItemList(
7275
} else {
7376
val state = rememberLazyListState()
7477

75-
LazyColumnScrollbar(state = state) {
78+
LazyColumnScrollbar(
79+
state = state,
80+
settings = ScrollbarSettings.Default.copy(
81+
thumbSelectedColor = md_theme_dark_primary,
82+
thumbUnselectedColor = Color.Red
83+
)
84+
) {
7685
LazyColumn(modifier = nestedScrollModifier, state = state) {
7786
listHeader()
7887

app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.material3.Text
1111
import androidx.compose.runtime.Composable
1212
import androidx.compose.runtime.getValue
1313
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.graphics.Color
1415
import androidx.compose.ui.input.nestedscroll.nestedScroll
1516
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
1617
import androidx.compose.ui.res.pluralStringResource
@@ -25,13 +26,15 @@ import androidx.paging.compose.collectAsLazyPagingItems
2526
import kotlinx.coroutines.flow.Flow
2627
import kotlinx.coroutines.flow.flowOf
2728
import my.nanihadesuka.compose.LazyColumnScrollbar
29+
import my.nanihadesuka.compose.ScrollbarSettings
2830
import org.schabi.newpipe.R
2931
import org.schabi.newpipe.extractor.Page
3032
import org.schabi.newpipe.extractor.comments.CommentsInfoItem
3133
import org.schabi.newpipe.extractor.stream.Description
3234
import org.schabi.newpipe.ui.components.common.LoadingIndicator
3335
import org.schabi.newpipe.ui.components.common.NoItemsMessage
3436
import org.schabi.newpipe.ui.theme.AppTheme
37+
import org.schabi.newpipe.ui.theme.md_theme_dark_primary
3538
import org.schabi.newpipe.viewmodels.CommentsViewModel
3639
import org.schabi.newpipe.viewmodels.util.Resource
3740

@@ -77,7 +80,13 @@ fun CommentSection(
7780
val nestedScrollInterop = rememberNestedScrollInteropConnection()
7881
val state = rememberLazyListState()
7982

80-
LazyColumnScrollbar(state = state) {
83+
LazyColumnScrollbar(
84+
state = state,
85+
settings = ScrollbarSettings.Default.copy(
86+
thumbSelectedColor = md_theme_dark_primary,
87+
thumbUnselectedColor = Color.Red
88+
)
89+
) {
8190
LazyColumn(
8291
modifier = Modifier.nestedScroll(nestedScrollInterop),
8392
state = state

0 commit comments

Comments
 (0)