Skip to content

Commit 9d8a79b

Browse files
committed
Slightly improve comment replies header spacing
1 parent ef56dea commit 9d8a79b

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
2121
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
2222
import androidx.compose.ui.res.pluralStringResource
2323
import androidx.compose.ui.tooling.preview.Preview
24+
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
2425
import androidx.compose.ui.unit.dp
2526
import androidx.paging.LoadState
2627
import androidx.paging.Pager
@@ -146,10 +147,13 @@ private fun CommentRepliesDialogPreview() {
146147
isPinned = true,
147148
isHeartedByUploader = true
148149
)
149-
val replies = (1..10).map {
150+
val replies = (1..10).map { i ->
150151
CommentsInfoItem(
151-
commentText = Description("Reply $it", Description.PLAIN_TEXT),
152-
uploaderName = "Test"
152+
commentText = Description(
153+
"Reply $i: ${LoremIpsum(i * i).values.first()}",
154+
Description.PLAIN_TEXT,
155+
),
156+
uploaderName = LoremIpsum(11 - i).values.first()
153157
)
154158
}
155159
val flow = flowOf(PagingData.from(replies))

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import androidx.compose.ui.res.painterResource
2222
import androidx.compose.ui.res.stringResource
2323
import androidx.compose.ui.text.style.TextOverflow
2424
import androidx.compose.ui.tooling.preview.Preview
25+
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
2526
import androidx.compose.ui.unit.dp
2627
import coil.compose.AsyncImage
2728
import org.schabi.newpipe.R
@@ -37,7 +38,7 @@ import org.schabi.newpipe.util.image.ImageStrategy
3738
fun CommentRepliesHeader(comment: CommentsInfoItem) {
3839
val context = LocalContext.current
3940

40-
Column(modifier = Modifier.padding(8.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {
41+
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) {
4142
Row(
4243
modifier = Modifier.fillMaxWidth(),
4344
horizontalArrangement = Arrangement.SpaceBetween,
@@ -114,7 +115,6 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
114115
DescriptionText(
115116
description = comment.commentText,
116117
style = MaterialTheme.typography.bodyMedium,
117-
modifier = Modifier.padding(8.dp)
118118
)
119119
}
120120
}
@@ -124,7 +124,7 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
124124
@Composable
125125
fun CommentRepliesHeaderPreview() {
126126
val comment = CommentsInfoItem(
127-
commentText = Description("Hello world!", Description.PLAIN_TEXT),
127+
commentText = Description(LoremIpsum(50).values.first(), Description.PLAIN_TEXT),
128128
uploaderName = "Test really long lorem ipsum dolor sit",
129129
likeCount = 1000,
130130
isPinned = true,

0 commit comments

Comments
 (0)