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 issue with expanded full screen layout for instructions #350

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

ianthetechie
Copy link
Contributor

I'm not quite sure how this got past my testing, but there was something wrong with the layout in the last release, either as a result of complex interaction or perhaps because of how I did the lazy column the first time around. I still don't fully understand why, but even debugging the layout inspector live, the previous iteration would "push" the pill offscreen at which point it was dropped from the composable completely if the list of instructions were long!

Colllapsed:

image

Expanded (large):

image

Detail showing the layout inspector to show how the pill is carefully aligned:

image

Comment on lines +131 to +140
modifier =
Modifier.offset {
IntOffset(
0,
if (isExpanded) {
(-4 * density).toInt()
} else {
(-8 * density).toInt()
})
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately the new layout structure required some changes here. Android Studio gave a lint warning that I should use this closure version of offset since it depends on state. TIL.

@ianthetechie ianthetechie requested a review from Archdoog November 5, 2024 18:13
Copy link
Collaborator

@Archdoog Archdoog left a comment

Choose a reason for hiding this comment

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

I noticed this issue as well 👍

@ianthetechie ianthetechie merged commit b0545b9 into main Nov 6, 2024
@ianthetechie ianthetechie deleted the expanded-instructions-fixes-android branch November 6, 2024 00:52
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.

2 participants