From 9d8a79b0bd4d12376bf5ba1a930a6fae86be3113 Mon Sep 17 00:00:00 2001 From: Stypox Date: Mon, 11 Nov 2024 13:34:18 +0100 Subject: [PATCH] Slightly improve comment replies header spacing --- .../components/video/comment/CommentRepliesDialog.kt | 10 +++++++--- .../components/video/comment/CommentRepliesHeader.kt | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt index 94217e43f..8cff6b864 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesDialog.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.rememberNestedScrollInteropConnection import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.datasource.LoremIpsum import androidx.compose.ui.unit.dp import androidx.paging.LoadState import androidx.paging.Pager @@ -146,10 +147,13 @@ private fun CommentRepliesDialogPreview() { isPinned = true, isHeartedByUploader = true ) - val replies = (1..10).map { + val replies = (1..10).map { i -> CommentsInfoItem( - commentText = Description("Reply $it", Description.PLAIN_TEXT), - uploaderName = "Test" + commentText = Description( + "Reply $i: ${LoremIpsum(i * i).values.first()}", + Description.PLAIN_TEXT, + ), + uploaderName = LoremIpsum(11 - i).values.first() ) } val flow = flowOf(PagingData.from(replies)) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesHeader.kt b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesHeader.kt index c987a774d..97682561b 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesHeader.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/video/comment/CommentRepliesHeader.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.datasource.LoremIpsum import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import org.schabi.newpipe.R @@ -37,7 +38,7 @@ import org.schabi.newpipe.util.image.ImageStrategy fun CommentRepliesHeader(comment: CommentsInfoItem) { val context = LocalContext.current - Column(modifier = Modifier.padding(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { + Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, @@ -114,7 +115,6 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) { DescriptionText( description = comment.commentText, style = MaterialTheme.typography.bodyMedium, - modifier = Modifier.padding(8.dp) ) } } @@ -124,7 +124,7 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) { @Composable fun CommentRepliesHeaderPreview() { val comment = CommentsInfoItem( - commentText = Description("Hello world!", Description.PLAIN_TEXT), + commentText = Description(LoremIpsum(50).values.first(), Description.PLAIN_TEXT), uploaderName = "Test really long lorem ipsum dolor sit", likeCount = 1000, isPinned = true,