mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Slightly improve comment replies header spacing
This commit is contained in:
parent
ef56dea817
commit
9d8a79b0bd
@ -21,6 +21,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
|
|||||||
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
||||||
import androidx.compose.ui.res.pluralStringResource
|
import androidx.compose.ui.res.pluralStringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.paging.LoadState
|
import androidx.paging.LoadState
|
||||||
import androidx.paging.Pager
|
import androidx.paging.Pager
|
||||||
@ -146,10 +147,13 @@ private fun CommentRepliesDialogPreview() {
|
|||||||
isPinned = true,
|
isPinned = true,
|
||||||
isHeartedByUploader = true
|
isHeartedByUploader = true
|
||||||
)
|
)
|
||||||
val replies = (1..10).map {
|
val replies = (1..10).map { i ->
|
||||||
CommentsInfoItem(
|
CommentsInfoItem(
|
||||||
commentText = Description("Reply $it", Description.PLAIN_TEXT),
|
commentText = Description(
|
||||||
uploaderName = "Test"
|
"Reply $i: ${LoremIpsum(i * i).values.first()}",
|
||||||
|
Description.PLAIN_TEXT,
|
||||||
|
),
|
||||||
|
uploaderName = LoremIpsum(11 - i).values.first()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val flow = flowOf(PagingData.from(replies))
|
val flow = flowOf(PagingData.from(replies))
|
||||||
|
@ -22,6 +22,7 @@ import androidx.compose.ui.res.painterResource
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.tooling.preview.datasource.LoremIpsum
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import org.schabi.newpipe.R
|
import org.schabi.newpipe.R
|
||||||
@ -37,7 +38,7 @@ import org.schabi.newpipe.util.image.ImageStrategy
|
|||||||
fun CommentRepliesHeader(comment: CommentsInfoItem) {
|
fun CommentRepliesHeader(comment: CommentsInfoItem) {
|
||||||
val context = LocalContext.current
|
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(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
@ -114,7 +115,6 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
|
|||||||
DescriptionText(
|
DescriptionText(
|
||||||
description = comment.commentText,
|
description = comment.commentText,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
modifier = Modifier.padding(8.dp)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ fun CommentRepliesHeader(comment: CommentsInfoItem) {
|
|||||||
@Composable
|
@Composable
|
||||||
fun CommentRepliesHeaderPreview() {
|
fun CommentRepliesHeaderPreview() {
|
||||||
val comment = CommentsInfoItem(
|
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",
|
uploaderName = "Test really long lorem ipsum dolor sit",
|
||||||
likeCount = 1000,
|
likeCount = 1000,
|
||||||
isPinned = true,
|
isPinned = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user