-
Notifications
You must be signed in to change notification settings - Fork 293
[AND-442] [AND-107] Improve the image loading #5724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDK Size Comparison 📏
|
42707ff
to
c3f4939
Compare
b6ad0df
to
a703060
Compare
...main/java/io/getstream/chat/android/compose/ui/components/attachments/images/ImagesPicker.kt
Show resolved
Hide resolved
...rc/main/java/io/getstream/chat/android/compose/ui/components/composer/ComposerLinkPreview.kt
Show resolved
Hide resolved
...m-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/ImageUtils.kt
Show resolved
Hide resolved
…ed on the rendering bounds - Skip empty state of first rememberAsyncImagePainter emission, so that we decrease the number of transitions between loading and loaded states
…so we prevent showing disconnected states.
- Removes `darkMode` parameters from preview functions. - Applies `ChatTheme` to preview functions to simplify the code and ensure consistent theming. - Removes unnecessary `darkMode` parameters from snapshot tests, as the theme is now handled correctly.
The changes consistently apply `ContentScale.Crop` to preview images in various components: - `ComposerLinkPreview`: Sets `ContentScale.Crop` for link preview images. - `MediaAttachmentPreviewContent`: Sets `ContentScale.Crop` for media attachment previews. - `ImagesPicker`: Sets `ContentScale.Crop` for images in the image picker. - `ImageAttachmentPreviewContent`: Sets `ContentScale.Crop` for image attachment previews. - `MediaAttachmentQuotedContent`: Sets `ContentScale.Crop` for media attachment previews in quoted messages. - Remove commented out code from FilesPicker
9d99fa8
to
1da7c46
Compare
Adds preview functions for `ImagesPicker` with different states. Creates new snapshot tests for `ImagesPicker` to ensure visual consistency.
VelikovPetar
approved these changes
Apr 17, 2025
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Fix the loading glitches of image components.
🛠 Implementation details
rememberAsyncImagePainter
emission, so that we reduce the number of transitions between loading and loaded states.StreamImage
withStreamAsyncImage
.MediaGalleryPreviewActivity
components, which require a big refactor first)🎨 UI Changes
Avatar components
avatar.before.webm
avatar.after.webm
Media components
media.attach.before.webm
Screen_recording_20250414_085345.webm
🧪 Testing
Explore every screen that shows images such as the channel list, message list, attachment picker, and gallery screens.
🎉 GIF