Skip to content

Fixed share image card background#637

Open
NUmeroAndDev wants to merge 1 commit intoDroidKaigi:mainfrom
NUmeroAndDev:fix_load_share_profile_card
Open

Fixed share image card background#637
NUmeroAndDev wants to merge 1 commit intoDroidKaigi:mainfrom
NUmeroAndDev:fix_load_share_profile_card

Conversation

@NUmeroAndDev
Copy link
Contributor

Issue

Overview (Required)

  • In Improve load card front background res #518, images were taken asynchronously, which caused the background of shared images to become transparent.
  • I fixed the shared image to take the background image synchronously.

Links

Screenshot (Optional if screenshot test is present or unrelated to UI)

Before After

Movie (Optional)

Before After

@NUmeroAndDev NUmeroAndDev marked this pull request as ready for review September 11, 2025 02:04
@NUmeroAndDev NUmeroAndDev requested a review from a team as a code owner September 11, 2025 02:04
@NUmeroAndDev NUmeroAndDev requested review from Copilot and kilalabu and removed request for a team September 11, 2025 02:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isAsyncLoadImage to control loading behavior
  • Modified CardFrontBackgroundImage to use painterResource for synchronous loading when flag is false
  • Switched from AsyncImage to rememberAsyncImagePainter for 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.isDark is true, it should use the night frame, not the day frame.
package io.github.confsched.profile.components

@NUmeroAndDev NUmeroAndDev force-pushed the fix_load_share_profile_card branch from 3d4029f to 650400a Compare September 11, 2025 02:04
@github-actions
Copy link

Snapshot diff report

File name Image
TimetableScreenPrevi
ew_Grid_compare.png

Comment on lines +109 to +115
rememberAsyncImagePainter(
model = if (isDark) {
ProfileRes.getUri("drawable/card_front_background_night.webp")
} else {
ProfileRes.getUri("drawable/card_front_background_day.webp")
},
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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? 🙏

Copy link
Contributor

@kitakkun kitakkun Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think that with the current approach, the performance improvement introduced in #518 might regress a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile card share image occasionally exports with transparent background

3 participants