-
Notifications
You must be signed in to change notification settings - Fork 200
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
🔧 This addresses the case where the image of the ProfileCard used for sharing on SNS etc. is corrupted in some cases. #928
Merged
takahirom
merged 4 commits into
DroidKaigi:main
from
Corvus400:bug/fix_export_image_display_corruption_profile_card_when_small_phone
Sep 3, 2024
+47
−27
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4c1131c
:wrench: This addresses the case where the image of the ProfileCard u…
Corvus400 02d2608
:wrench: ./gradlew detekt --auto-correct
Corvus400 7314cf6
:wrench: There were still places in the ShareableCardContent that use…
Corvus400 b2e607b
Merge branch 'main' into bug/fix_export_image_display_corruption_prof…
Corvus400 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ import androidx.compose.ui.graphics.layer.GraphicsLayer | |
import androidx.compose.ui.graphics.layer.drawLayer | ||
import androidx.compose.ui.platform.LocalDensity | ||
import androidx.compose.ui.unit.IntSize | ||
import androidx.compose.ui.unit.dp | ||
import coil3.compose.AsyncImagePainter | ||
import com.preat.peekaboo.image.picker.toImageBitmap | ||
import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme | ||
|
@@ -96,6 +95,7 @@ private fun ShareableCardContent( | |
val offsetYBackPx = 76f | ||
val offsetXFrontPx = -136f | ||
val offsetYFrontPx = -61f | ||
val verticalPaddingPx = 30f | ||
|
||
val density = LocalDensity.current | ||
|
||
|
@@ -108,7 +108,7 @@ private fun ShareableCardContent( | |
) | ||
.background(LocalProfileCardTheme.current.primaryColor), | ||
) { | ||
Box(modifier = Modifier.padding(vertical = 30.dp)) { | ||
Box(modifier = Modifier.padding(vertical = with(density) { verticalPaddingPx.toDp() })) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part has been forgotten to be modified, and is one of the causes of the display corruption when in landscape mode. |
||
backImage?.let { | ||
Image( | ||
bitmap = it, | ||
|
Oops, something went wrong.
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.
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.
If fontScale is not set to a fixed value, the text will either overflow or become smaller if the device settings are changed.
So, I used the CompositionLocalProvider to fix the density and font scale of the composable for taking photos so that the display would not break.
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.
I have never thought of this before. This is super smart 👀