Forces image size in profile pictures to reduce calculations before resizing the downloaded image.

This commit is contained in:
Vitor Pamplona
2023-03-15 11:21:53 -04:00
parent e8d84795d5
commit c781d5eff7
2 changed files with 8 additions and 4 deletions

View File

@@ -683,7 +683,8 @@ fun NoteAuthorPicture(
robot = "authornotfound",
contentDescription = stringResource(R.string.unknown_author),
modifier = modifier
.fillMaxSize(1f)
.width(size)
.height(size)
.clip(shape = CircleShape)
.background(MaterialTheme.colors.background)
)
@@ -729,7 +730,8 @@ fun UserPicture(
model = ResizeImage(user.profilePicture(), size),
contentDescription = stringResource(id = R.string.profile_image),
modifier = modifier
.fillMaxSize(1f)
.width(size)
.height(size)
.clip(shape = CircleShape)
.background(MaterialTheme.colors.background)
.run {

View File

@@ -585,7 +585,8 @@ fun BadgeThumb(
robot = "authornotfound",
contentDescription = stringResource(R.string.unknown_author),
modifier = pictureModifier
.fillMaxSize(1f)
.width(size)
.height(size)
.background(MaterialTheme.colors.background)
)
} else {
@@ -594,7 +595,8 @@ fun BadgeThumb(
model = image,
contentDescription = stringResource(id = R.string.profile_image),
modifier = pictureModifier
.fillMaxSize(1f)
.width(size)
.height(size)
.clip(shape = CircleShape)
.background(MaterialTheme.colors.background)
.run {