-
Notifications
You must be signed in to change notification settings - Fork 281
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
[AND-313] Fix the Avatar loading #5625
Merged
Merged
+131
−98
Conversation
This file contains 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
- Fix the fading issue. - Stop using preview avatar so that we can have snapshot tests doing the same as in production.
…ad of preview avatars
SDK Size Comparison 📏
|
JcMinarro
reviewed
Feb 11, 2025
...droid-compose/src/main/java/io/getstream/chat/android/compose/ui/components/avatar/Avatar.kt
Outdated
Show resolved
Hide resolved
skydoves
approved these changes
Feb 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Out of my curiosity, what if we wrap the StreamImage
using Crossfade
without using CrossfadePlugin
? If this makes any problems, this issue should be fixed on the library site.
JcMinarro
approved these changes
Feb 16, 2025
...-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/StreamAsyncImage.kt
Outdated
Show resolved
Hide resolved
|
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
Increase the stability of fading/loading image of the user avatars.
🛠 Implementation details
It seems the
CrossfadePlugin
is causing this instability. After spending some time debugging, the best option might be to stop usingStreamImage
, handle the painter states, and useImageAvatar
orInitialsAvatar
according to the states.A positive side-effect of that refactoring is that now we don't need to use a preview avatar anymore. Hence, we can update the snapshots to have the user's initials instead of the preview avatar.
Another positive side-effect is that we could identify a bug in the avatars of Poll components, where the user's initials were not fully displayed due to the font size.
Also, another fix was on the click indicator of user avatars, as now we can see a proper ripple effect.
🎨 UI Changes
fading.issue.webm
avatar.fading.fix.webm
Avatar
click ripple fixclick.ripple.issue.webm
click.ripple.fix.webm
Poll
InitialsAvatar
fixpoll.issue.webm
poll.fix.webm
🎉 GIF