From c781d5eff757e0545d7aa7fcd5b7c18c5f76237d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 15 Mar 2023 11:21:53 -0400 Subject: [PATCH] Forces image size in profile pictures to reduce calculations before resizing the downloaded image. --- .../java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt | 6 ++++-- .../amethyst/ui/screen/loggedIn/ProfileScreen.kt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index 5cc5d91e0..83c537382 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -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 { diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt index b1a0ac89e..4c522668a 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/ProfileScreen.kt @@ -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 {