diff --git a/app/build.gradle b/app/build.gradle index 6bf7f8bab2..a01b8f7f69 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -218,7 +218,6 @@ dependencies { implementation libs.composeFoundation implementation libs.composeMaterial implementation libs.composeMaterial3 - implementation libs.composeToolingPreview implementation libs.composeAccompanistPager implementation libs.composeAccompanistThemeAdapter implementation libs.composeAccompanistPagerIndicators @@ -275,6 +274,7 @@ dependencies { debugImplementation libs.fragmentTesting debugImplementation libs.composeTooling + debugImplementation libs.composeToolingPreview } apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Attachments.kt b/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Attachments.kt index cb25c8eb22..8729656ebb 100644 --- a/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Attachments.kt +++ b/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Attachments.kt @@ -42,6 +42,8 @@ import com.anytypeio.anytype.feature_chats.presentation.ChatView import com.anytypeio.anytype.presentation.objects.ObjectIcon import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi import com.bumptech.glide.integration.compose.GlideImage +import com.bumptech.glide.load.DecodeFormat +import com.bumptech.glide.load.engine.DiskCacheStrategy @Composable @OptIn(ExperimentalGlideComposeApi::class) @@ -94,7 +96,13 @@ fun BubbleAttachments( .clickable { onAttachmentClicked(attachment) } - ) + ) { + it + .override(1024, 1024) + .centerCrop() + .diskCacheStrategy(DiskCacheStrategy.ALL) + .format(DecodeFormat.PREFER_RGB_565) + } } } is ChatView.Message.Attachment.Link -> { diff --git a/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Gallery.kt b/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Gallery.kt index 09e73083e7..1d0f858f20 100644 --- a/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Gallery.kt +++ b/feature-chats/src/main/java/com/anytypeio/anytype/feature_chats/ui/Gallery.kt @@ -23,6 +23,8 @@ import com.anytypeio.anytype.feature_chats.R import com.anytypeio.anytype.feature_chats.presentation.ChatView import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi import com.bumptech.glide.integration.compose.GlideImage +import com.bumptech.glide.load.DecodeFormat +import com.bumptech.glide.load.engine.DiskCacheStrategy @OptIn(ExperimentalGlideComposeApi::class) @Composable @@ -65,7 +67,13 @@ fun BubbleGalleryRowLayout( .clickable { onAttachmentClicked(image) } - ) + ) { + it + .override(512, 512) + .centerCrop() + .diskCacheStrategy(DiskCacheStrategy.ALL) + .format(DecodeFormat.PREFER_RGB_565) + } } } }