-
Notifications
You must be signed in to change notification settings - Fork 282
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-318] Fix fading issue in media attachment content items #5631
Conversation
SDK Size Comparison 📏
|
cc52f97
to
308ebd6
Compare
308ebd6
to
e0e361d
Compare
5872224
to
db8b077
Compare
d24026b
to
3753cf8
Compare
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.
Overall, it looks good to me! Out of curiosity, are there any critical issues with the previous StreamImage
, or specific benefits to migrating to StreamAsyncImage
? Since I've been maintaining Landscapist myself, I'd be happy to address any issues or improvements if needed.
Thanks for reviewing it, @skydoves We have seen issues like that, which also happens with the avatars because they use the The idea with moving out from |
To be honest, I don’t see the advantages you mentioned—"simpler to maintain and provides more flexibility for building content based on image loading states"—since Landscapist already offers richer APIs that support these functionalities. Such as, |
The Landscapist is a great library, indeed. It has innumerable possibilities for customization. |
3753cf8
to
ccf4cd8
Compare
df28da5
to
96aa2bf
Compare
I understand your concerns, and that’s a great point. The reason I introduced Landscapist was for its greater flexibility in state customization and additional features like crossfade, shimmering effects, placeholders, and seamless previews, which offload responsibilities to the library. However, as you mentioned, implementing all the things ourselves also has its advantages, such as reducing dependency on third-party libraries, and we can customize them under our control. Since we've already started the migration, we can consider removing all landscapist dependencies across the project to maintain consistency, not at once but gradually. What do you think? |
|
🎯 Goal
Address #5582
🛠 Implementation details
ShimmerProgressIndicator
component, which can be used to indicate loading states. It uses a defaultStreamShimmerTheme
provided as a local composition component through theChatTheme
.StreamImage
withStreamAsyncImage
inMediaAttachmentContent
and handles content for the each async image state using the foundationCrossfade
animation component.StreamImage
withStreamAsyncImage
inMediaGalleryPreviewActivity
andGiphyAttachmentContent
so that we can remove the dependency ofplaceholder.shimmer.ShimmerPlugin
from Compose SDK.🎨 UI Changes
MediaAttachmentContent
media.issue.webm
media.fix.webm
GiphyAttachmentContent
giphy.before.webm
giphy.media.after.webm
🎉 GIF