Use ContentScale.Crop instead ContentScale.FillBounds to avoid ugly thumbnail stretches

This commit is contained in:
vfsfitvnm 2022-06-08 13:20:50 +02:00
parent bf74be01db
commit 867642e0c4
5 changed files with 8 additions and 8 deletions

View file

@ -232,7 +232,7 @@ fun PlaylistOrAlbumScreen(
AsyncImage( AsyncImage(
model = playlistOrAlbum.thumbnail?.size(thumbnailSizePx), model = playlistOrAlbum.thumbnail?.size(thumbnailSizePx),
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.clip(ThumbnailRoundness.shape) .clip(ThumbnailRoundness.shape)
.size(thumbnailSizeDp) .size(thumbnailSizeDp)
@ -348,7 +348,7 @@ fun PlaylistOrAlbumScreen(
AsyncImage( AsyncImage(
model = song.thumbnail!!.size(songThumbnailSizePx), model = song.thumbnail!!.size(songThumbnailSizePx),
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.clip(ThumbnailRoundness.shape) .clip(ThumbnailRoundness.shape)
.size(songThumbnailSizeDp) .size(songThumbnailSizeDp)

View file

@ -461,7 +461,7 @@ fun SmallPlaylistItem(
AsyncImage( AsyncImage(
model = playlist.thumbnail.size(thumbnailSizePx), model = playlist.thumbnail.size(thumbnailSizePx),
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.clip(ThumbnailRoundness.shape) .clip(ThumbnailRoundness.shape)
.size(thumbnailSizeDp) .size(thumbnailSizeDp)
@ -510,7 +510,7 @@ fun SmallAlbumItem(
AsyncImage( AsyncImage(
model = album.thumbnail.size(thumbnailSizePx), model = album.thumbnail.size(thumbnailSizePx),
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.clip(ThumbnailRoundness.shape) .clip(ThumbnailRoundness.shape)
.size(thumbnailSizeDp) .size(thumbnailSizeDp)

View file

@ -115,7 +115,7 @@ fun PlayerView(
AsyncImage( AsyncImage(
model = "${player.mediaMetadata.artworkUri}-w$smallThumbnailSize-h$smallThumbnailSize", model = "${player.mediaMetadata.artworkUri}-w$smallThumbnailSize-h$smallThumbnailSize",
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.clip(ThumbnailRoundness.shape) .clip(ThumbnailRoundness.shape)
.size(64.dp) .size(64.dp)
@ -234,7 +234,7 @@ fun PlayerView(
AsyncImage( AsyncImage(
model = "$artworkUri-w$thumbnailSizePx-h$thumbnailSizePx", model = "$artworkUri-w$thumbnailSizePx-h$thumbnailSizePx",
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.padding(bottom = 32.dp) .padding(bottom = 32.dp)
.padding(horizontal = 32.dp) .padding(horizontal = 32.dp)

View file

@ -70,7 +70,7 @@ fun PlaylistPreviewItem(
AsyncImage( AsyncImage(
model = "${thumbnails.getOrNull(index)}-w$thumbnailSizePx-h$thumbnailSizePx", model = "${thumbnails.getOrNull(index)}-w$thumbnailSizePx-h$thumbnailSizePx",
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.align(alignment) .align(alignment)
.size(thumbnailSize) .size(thumbnailSize)

View file

@ -115,7 +115,7 @@ fun SongItem(
AsyncImage( AsyncImage(
model = thumbnailModel, model = thumbnailModel,
contentDescription = null, contentDescription = null,
contentScale = ContentScale.FillBounds, contentScale = ContentScale.Crop,
modifier = Modifier modifier = Modifier
.clip(ThumbnailRoundness.shape) .clip(ThumbnailRoundness.shape)
.fillMaxSize() .fillMaxSize()