Skip to content

Commit

Permalink
Improve StreamThumbnail composable
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Jul 29, 2024
1 parent 2f9364a commit 75475da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ fun StreamCardItem(
.padding(top = 12.dp, start = 2.dp, end = 2.dp)
) {
StreamThumbnail(
modifier = Modifier.fillMaxWidth(),
stream = stream,
modifier = Modifier.fillMaxWidth(),
contentScale = ContentScale.FillWidth
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun StreamGridItem(
) {
val size = if (isMini) DpSize(150.dp, 85.dp) else DpSize(246.dp, 138.dp)

StreamThumbnail(modifier = Modifier.size(size), stream = stream)
StreamThumbnail(stream = stream, modifier = Modifier.size(size))

Text(
text = stream.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ fun StreamListItem(
verticalAlignment = Alignment.CenterVertically
) {
StreamThumbnail(
modifier = Modifier.size(width = 98.dp, height = 55.dp),
stream = stream
stream = stream,
modifier = Modifier.size(width = 98.dp, height = 55.dp)
)

Column {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import org.schabi.newpipe.util.image.ImageStrategy

@Composable
fun StreamThumbnail(
modifier: Modifier = Modifier,
stream: StreamInfoItem,
modifier: Modifier = Modifier,
contentScale: ContentScale = ContentScale.Fit
) {
Box(modifier = modifier, contentAlignment = Alignment.BottomEnd) {
Expand All @@ -49,6 +49,7 @@ fun StreamThumbnail(
modifier = Modifier
.padding(2.dp)
.background(background.copy(alpha = 0.5f))
.padding(2.dp)
)
}
}

0 comments on commit 75475da

Please sign in to comment.