Skip to content

Commit 5fffee2

Browse files
Fix text color in bottom sheet
1 parent f9340ae commit 5fffee2

2 files changed

Lines changed: 27 additions & 33 deletions

File tree

app/src/main/java/org/schabi/newpipe/fragments/list/comments/CommentsFragment.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package org.schabi.newpipe.fragments.list.comments
33
import android.os.Bundle
44
import android.view.LayoutInflater
55
import android.view.ViewGroup
6-
import androidx.compose.material3.MaterialTheme
7-
import androidx.compose.material3.Surface
86
import androidx.core.os.bundleOf
97
import androidx.fragment.app.Fragment
108
import androidx.fragment.compose.content
@@ -20,9 +18,7 @@ class CommentsFragment : Fragment() {
2018
savedInstanceState: Bundle?
2119
) = content {
2220
AppTheme {
23-
Surface(color = MaterialTheme.colorScheme.background) {
24-
CommentSection()
25-
}
21+
CommentSection()
2622
}
2723
}
2824

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

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,33 +50,35 @@ fun CommentSection(
5050
val nestedScrollInterop = rememberNestedScrollInteropConnection()
5151
val state = rememberLazyListState()
5252

53-
LazyColumnScrollbar(state = state) {
54-
LazyColumn(modifier = Modifier.nestedScroll(nestedScrollInterop), state = state) {
55-
if (parentComment != null) {
56-
item {
57-
CommentRepliesHeader(comment = parentComment)
58-
HorizontalDivider(thickness = 1.dp)
53+
Surface(color = MaterialTheme.colorScheme.background) {
54+
LazyColumnScrollbar(state = state) {
55+
LazyColumn(modifier = Modifier.nestedScroll(nestedScrollInterop), state = state) {
56+
if (parentComment != null) {
57+
item {
58+
CommentRepliesHeader(comment = parentComment)
59+
HorizontalDivider(thickness = 1.dp)
60+
}
5961
}
60-
}
6162

62-
if (itemCount == 0) {
63-
item {
64-
val refresh = comments.loadState.refresh
65-
if (refresh is LoadState.Loading) {
66-
LoadingIndicator(modifier = Modifier.padding(top = 8.dp))
67-
} else {
68-
val error = (refresh as? LoadState.Error)?.error
69-
val message = if (error is CommentsDisabledException) {
70-
R.string.comments_are_disabled
63+
if (itemCount == 0) {
64+
item {
65+
val refresh = comments.loadState.refresh
66+
if (refresh is LoadState.Loading) {
67+
LoadingIndicator(modifier = Modifier.padding(top = 8.dp))
7168
} else {
72-
R.string.no_comments
69+
val error = (refresh as? LoadState.Error)?.error
70+
val message = if (error is CommentsDisabledException) {
71+
R.string.comments_are_disabled
72+
} else {
73+
R.string.no_comments
74+
}
75+
NoItemsMessage(message)
7376
}
74-
NoItemsMessage(message)
7577
}
76-
}
77-
} else {
78-
items(itemCount) {
79-
Comment(comment = comments[it]!!)
78+
} else {
79+
items(itemCount) {
80+
Comment(comment = comments[it]!!)
81+
}
8082
}
8183
}
8284
}
@@ -116,9 +118,7 @@ private fun CommentSectionPreview(
116118
@PreviewParameter(CommentDataProvider::class) pagingData: PagingData<CommentsInfoItem>
117119
) {
118120
AppTheme {
119-
Surface(color = MaterialTheme.colorScheme.background) {
120-
CommentSection(commentsFlow = flowOf(pagingData))
121-
}
121+
CommentSection(commentsFlow = flowOf(pagingData))
122122
}
123123
}
124124

@@ -142,8 +142,6 @@ private fun CommentRepliesPreview() {
142142
val flow = flowOf(PagingData.from(replies))
143143

144144
AppTheme {
145-
Surface(color = MaterialTheme.colorScheme.background) {
146-
CommentSection(parentComment = comment, commentsFlow = flow)
147-
}
145+
CommentSection(parentComment = comment, commentsFlow = flow)
148146
}
149147
}

0 commit comments

Comments
 (0)