mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-03-31 15:57:00 +00:00
Improve StreamThumbnail composable
This commit is contained in:
parent
2f9364a2cf
commit
75475da053
@ -41,8 +41,8 @@ fun StreamCardItem(
|
|||||||
.padding(top = 12.dp, start = 2.dp, end = 2.dp)
|
.padding(top = 12.dp, start = 2.dp, end = 2.dp)
|
||||||
) {
|
) {
|
||||||
StreamThumbnail(
|
StreamThumbnail(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
stream = stream,
|
stream = stream,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
contentScale = ContentScale.FillWidth
|
contentScale = ContentScale.FillWidth
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ fun StreamGridItem(
|
|||||||
) {
|
) {
|
||||||
val size = if (isMini) DpSize(150.dp, 85.dp) else DpSize(246.dp, 138.dp)
|
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(
|
||||||
text = stream.name,
|
text = stream.name,
|
||||||
|
@ -45,8 +45,8 @@ fun StreamListItem(
|
|||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
StreamThumbnail(
|
StreamThumbnail(
|
||||||
modifier = Modifier.size(width = 98.dp, height = 55.dp),
|
stream = stream,
|
||||||
stream = stream
|
modifier = Modifier.size(width = 98.dp, height = 55.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
@ -22,8 +22,8 @@ import org.schabi.newpipe.util.image.ImageStrategy
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun StreamThumbnail(
|
fun StreamThumbnail(
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
stream: StreamInfoItem,
|
stream: StreamInfoItem,
|
||||||
|
modifier: Modifier = Modifier,
|
||||||
contentScale: ContentScale = ContentScale.Fit
|
contentScale: ContentScale = ContentScale.Fit
|
||||||
) {
|
) {
|
||||||
Box(modifier = modifier, contentAlignment = Alignment.BottomEnd) {
|
Box(modifier = modifier, contentAlignment = Alignment.BottomEnd) {
|
||||||
@ -49,6 +49,7 @@ fun StreamThumbnail(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(2.dp)
|
.padding(2.dp)
|
||||||
.background(background.copy(alpha = 0.5f))
|
.background(background.copy(alpha = 0.5f))
|
||||||
|
.padding(2.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user