Fixed share image card background#637
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the profile card's background became transparent when images were captured for sharing. The fix involves switching from asynchronous image loading to synchronous loading when creating shared images.
Key Changes
- Added a boolean flag
isAsyncLoadImageto control loading behavior - Modified
CardFrontBackgroundImageto usepainterResourcefor synchronous loading when flag is false - Switched from
AsyncImagetorememberAsyncImagePainterfor better control over async loading
Comments suppressed due to low confidence (1)
feature/profile/src/commonMain/kotlin/io/github/confsched/profile/components/ProfileCardFront.kt:1
- The logic for selecting the logo frame appears inverted. When
theme.isDarkis true, it should use the night frame, not the day frame.
package io.github.confsched.profile.components
3d4029f to
650400a
Compare
|
Snapshot diff report
|
| rememberAsyncImagePainter( | ||
| model = if (isDark) { | ||
| ProfileRes.getUri("drawable/card_front_background_night.webp") | ||
| } else { | ||
| ProfileRes.getUri("drawable/card_front_background_day.webp") | ||
| }, | ||
| ) |
There was a problem hiding this comment.
Since rememberAsyncImagePainter provides an onSuccess callback, I think it would be preferable to use that to detect when the image has finished loading and then enable the share feature.
Would you be able to update the implementation in that direction? 🙏
There was a problem hiding this comment.
I also think that with the current approach, the performance improvement introduced in #518 might regress a bit.

Issue
Overview (Required)
Links
Screenshot (Optional if screenshot test is present or unrelated to UI)
Movie (Optional)