diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentInfo.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentInfo.kt index 6c81697fa..3bd3ec245 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentInfo.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentInfo.kt @@ -3,12 +3,13 @@ package org.schabi.newpipe.ui.components.video.comment import androidx.compose.runtime.Immutable import org.schabi.newpipe.extractor.Page import org.schabi.newpipe.extractor.comments.CommentsInfo +import org.schabi.newpipe.extractor.comments.CommentsInfoItem @Immutable class CommentInfo( val serviceId: Int, val url: String, - val comments: List, + val comments: List, val nextPage: Page?, val commentCount: Int, val isCommentsDisabled: Boolean diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt index 006a63897..970f50141 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentSection.kt @@ -30,6 +30,7 @@ import kotlinx.coroutines.flow.flowOf import org.schabi.newpipe.R import org.schabi.newpipe.error.ErrorInfo import org.schabi.newpipe.error.UserAction +import org.schabi.newpipe.extractor.Page import org.schabi.newpipe.extractor.comments.CommentsInfoItem import org.schabi.newpipe.extractor.stream.Description import org.schabi.newpipe.ui.components.common.ErrorPanel @@ -231,7 +232,7 @@ private fun CommentSectionSuccessPreview() { Description.Type.PLAIN_TEXT ), uploaderName = "Test", - replies = org.schabi.newpipe.extractor.Page(""), + replies = Page(""), replyCount = 10 ) ) + (2..10).map { diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/LiveChatSection.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/LiveChatSection.kt index 5446bace6..5e22d6b35 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/LiveChatSection.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/LiveChatSection.kt @@ -28,10 +28,12 @@ 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.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewmodel.compose.viewModel import kotlinx.coroutines.launch +import org.schabi.newpipe.R import org.schabi.newpipe.ui.components.common.LazyColumnThemedScrollbar import org.schabi.newpipe.ui.components.common.LoadingIndicator import org.schabi.newpipe.viewmodels.LiveChatViewModel @@ -65,7 +67,7 @@ fun LiveChatSection(liveChatViewModel: LiveChatViewModel = viewModel()) { item { Text( modifier = Modifier.padding(start = 12.dp, end = 12.dp, bottom = 4.dp), - text = "Live Chat", + text = stringResource(id = R.string.live_chat_tab_description), style = MaterialTheme.typography.titleMedium ) } diff --git a/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt b/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt index 7c5a7c643..03ab9c2b9 100644 --- a/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt +++ b/app/src/main/java/org/schabi/newpipe/viewmodels/CommentsViewModel.kt @@ -17,6 +17,7 @@ import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import org.schabi.newpipe.extractor.comments.CommentsInfo +import org.schabi.newpipe.extractor.comments.CommentsInfoItem import org.schabi.newpipe.paging.CommentsSource import org.schabi.newpipe.ui.components.video.comment.CommentInfo import org.schabi.newpipe.util.KEY_URL @@ -36,7 +37,7 @@ class CommentsViewModel(savedStateHandle: SavedStateHandle) : ViewModel() { .stateIn(viewModelScope, SharingStarted.WhileSubscribed(), Resource.Loading) @OptIn(ExperimentalCoroutinesApi::class) - val comments: Flow> = uiState + val comments: Flow> = uiState .filterIsInstance>() .flatMapLatest { Pager(PagingConfig(pageSize = 20, enablePlaceholders = false)) {