1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 04:22:30 +01:00

Use nested scroll modifier

This commit is contained in:
Isira Seneviratne 2024-08-10 06:14:36 +05:30
parent f9dae9078e
commit e082bca5e0

View File

@ -17,6 +17,8 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
@ -45,10 +47,11 @@ fun CommentSection(
Surface(color = MaterialTheme.colorScheme.background) {
val comments = commentsFlow.collectAsLazyPagingItems()
val itemCount by remember { derivedStateOf { comments.itemCount } }
val listState = rememberLazyListState()
val nestedScrollInterop = rememberNestedScrollInteropConnection()
val state = rememberLazyListState()
LazyColumnScrollbar(state = listState) {
LazyColumn(state = listState) {
LazyColumnScrollbar(state = state) {
LazyColumn(modifier = Modifier.nestedScroll(nestedScrollInterop), state = state) {
if (parentComment != null) {
item {
CommentRepliesHeader(comment = parentComment)