1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01:00

Fix text color in bottom sheet

This commit is contained in:
Isira Seneviratne 2024-08-28 17:59:38 +05:30
parent f9340ae604
commit 5fffee2c7d
2 changed files with 30 additions and 36 deletions

View File

@ -3,8 +3,6 @@ package org.schabi.newpipe.fragments.list.comments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import androidx.fragment.compose.content
@ -20,11 +18,9 @@ class CommentsFragment : Fragment() {
savedInstanceState: Bundle?
) = content {
AppTheme {
Surface(color = MaterialTheme.colorScheme.background) {
CommentSection()
}
}
}
companion object {
@JvmStatic

View File

@ -50,6 +50,7 @@ fun CommentSection(
val nestedScrollInterop = rememberNestedScrollInteropConnection()
val state = rememberLazyListState()
Surface(color = MaterialTheme.colorScheme.background) {
LazyColumnScrollbar(state = state) {
LazyColumn(modifier = Modifier.nestedScroll(nestedScrollInterop), state = state) {
if (parentComment != null) {
@ -82,6 +83,7 @@ fun CommentSection(
}
}
}
}
private class CommentDataProvider : PreviewParameterProvider<PagingData<CommentsInfoItem>> {
private val notLoading = LoadState.NotLoading(true)
@ -116,11 +118,9 @@ private fun CommentSectionPreview(
@PreviewParameter(CommentDataProvider::class) pagingData: PagingData<CommentsInfoItem>
) {
AppTheme {
Surface(color = MaterialTheme.colorScheme.background) {
CommentSection(commentsFlow = flowOf(pagingData))
}
}
}
@Preview(name = "Light mode", uiMode = Configuration.UI_MODE_NIGHT_NO)
@Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES)
@ -142,8 +142,6 @@ private fun CommentRepliesPreview() {
val flow = flowOf(PagingData.from(replies))
AppTheme {
Surface(color = MaterialTheme.colorScheme.background) {
CommentSection(parentComment = comment, commentsFlow = flow)
}
}
}