Skip to content

Commit 75475da

Browse files
Improve StreamThumbnail composable
1 parent 2f9364a commit 75475da

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/ui/components/stream/StreamCardItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ fun StreamCardItem(
4141
.padding(top = 12.dp, start = 2.dp, end = 2.dp)
4242
) {
4343
StreamThumbnail(
44-
modifier = Modifier.fillMaxWidth(),
4544
stream = stream,
45+
modifier = Modifier.fillMaxWidth(),
4646
contentScale = ContentScale.FillWidth
4747
)
4848

app/src/main/java/org/schabi/newpipe/ui/components/stream/StreamGridItem.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fun StreamGridItem(
4141
) {
4242
val size = if (isMini) DpSize(150.dp, 85.dp) else DpSize(246.dp, 138.dp)
4343

44-
StreamThumbnail(modifier = Modifier.size(size), stream = stream)
44+
StreamThumbnail(stream = stream, modifier = Modifier.size(size))
4545

4646
Text(
4747
text = stream.name,

app/src/main/java/org/schabi/newpipe/ui/components/stream/StreamListItem.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ fun StreamListItem(
4545
verticalAlignment = Alignment.CenterVertically
4646
) {
4747
StreamThumbnail(
48-
modifier = Modifier.size(width = 98.dp, height = 55.dp),
49-
stream = stream
48+
stream = stream,
49+
modifier = Modifier.size(width = 98.dp, height = 55.dp)
5050
)
5151

5252
Column {

app/src/main/java/org/schabi/newpipe/ui/components/stream/StreamThumbnail.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import org.schabi.newpipe.util.image.ImageStrategy
2222

2323
@Composable
2424
fun StreamThumbnail(
25-
modifier: Modifier = Modifier,
2625
stream: StreamInfoItem,
26+
modifier: Modifier = Modifier,
2727
contentScale: ContentScale = ContentScale.Fit
2828
) {
2929
Box(modifier = modifier, contentAlignment = Alignment.BottomEnd) {
@@ -49,6 +49,7 @@ fun StreamThumbnail(
4949
modifier = Modifier
5050
.padding(2.dp)
5151
.background(background.copy(alpha = 0.5f))
52+
.padding(2.dp)
5253
)
5354
}
5455
}

0 commit comments

Comments
 (0)