Skip to content
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

fix(Android): hide onboarding images that are likely to collide with text #770

Merged
merged 3 commits into from
Feb 21, 2025

Conversation

boringcactus
Copy link
Member

Summary

Ticket: 🤖 | Fix dynamic text in onboarding

Given the variety of screen sizes on Android, these thresholds may only be correct at the size Android Studio rendered the preview at while I was working on this, and a more robust solution would be to use the layout subsystem that I don't really understand to actually use the size of the text to show or hide the images, but in the interest of shipping in the short term, this seems like it's better than nothing, which is the main objective.

I'm also opportunistically fixing the bug where the button heights are fixed at 52 and so a second line of text will get cut off - on iOS that's a minimum height, and on Android it seems like it should be too.

iOS

  • [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?
    • [ ] Add temporary machine translations, marked "Needs Review"

android

  • [ ] All user-facing strings added to strings resource in alphabetical order
  • [ ] Expensive calculations are run in withContext(Dispatchers.Default) where possible

Testing

Checked in the Android Studio preview (which is the easiest place to apply arbitrary text scale values) that the images are hidden before the text clips into them.

@boringcactus boringcactus requested a review from a team as a code owner February 21, 2025 14:58
Copy link
Contributor

@JackVCurtis JackVCurtis left a comment

Choose a reason for hiding this comment

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

👍

Modifier.fillMaxWidth()
.height(52.dp)
.padding(start = 32.dp, end = 32.dp),
modifier = buttonModifier.padding(start = 32.dp, end = 32.dp),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still want the 32 padding on all the buttons if that was the thing causing the line breaks that messed up formatting? 16 seems reasonable and safer, but not a huge deal either way, these all need to just be their own composable, which we shouldn't spend time on now 🤷

Copy link
Member Author

@boringcactus boringcactus Feb 21, 2025

Choose a reason for hiding this comment

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

I guess we don't; 16 across all buttons might be the better move there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I considered that, but wasn't sure if it was ok to be adding back some of the padding around the Text that was removed in #754 for the elevator accessibility buttons (not sure why just those had the padding on the text rather than the button, maybe that was part of the problem).

Copy link
Member Author

@boringcactus boringcactus Feb 21, 2025

Choose a reason for hiding this comment

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

Actually, no, the weird inconsistencies between these buttons are annoying to disentangle here, and the right fix is a more comprehensive refactor anyway. The one that's most likely to wrap is "Show elevator closures", and that one's getting its padding removed in #754 anyway.

@boringcactus boringcactus merged commit e261a26 into main Feb 21, 2025
4 checks passed
@boringcactus boringcactus deleted the mth-android-onboarding-type-scale branch February 21, 2025 17:33
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.

3 participants