-
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
Conversation
… sharing on SNS etc. is corrupted in some cases. This was addressed by using the CompositionLocalProvider to ensure that the composable for taking photos has a fixed density and font scale.
Detekt check failed. Please run |
…rectly, so I applied the same fix as the others.
CompositionLocalProvider( | ||
LocalDensity provides Density( | ||
density = 1f, | ||
fontScale = 1f, | ||
), | ||
) { |
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 👀
@@ -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 comment
The 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.
…ile_card_when_small_phone
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.
Thank you for finding and fixing your contribution!
Issue
Overview (Required)
Links
Screenshot (Optional if screenshot test is present or unrelated to UI)