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

[ios] non-notched layout #258

Merged
merged 13 commits into from
Sep 24, 2024

Conversation

michaelkirk
Copy link
Contributor

@michaelkirk michaelkirk commented Sep 19, 2024

FIXES #242

This branch includes several commits. I can break them into separate PR's if you'd prefer, but they are intended to be both well factored (one issue addressed per commit) and related (layout is a bit whack-a-mole, so merging them independently might make some things worse before everything is better).

Before After
sanity check: the notched device layout was fine before. regression check: ArrivalView is intentionally shorter, but otherwise the layout looks the same.
Screenshot Screenshot
Screenshot Screenshot
But non-notched device layout was missing some padding. Now non-notched device layout looks reasonable! 🎉
Screenshot Screenshot
Screenshot Screenshot

// // Overlay safeArea
// Rectangle().fill(.blue.opacity(0.5)).padding(overlaySafeAreaInsets)
// }
// )
Copy link
Contributor Author

@michaelkirk michaelkirk Sep 19, 2024

Choose a reason for hiding this comment

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

I've since removed this commented out debug code, but it might help you review to see what it looked like:

The red part is the MapView, the yellow+red=orange part represents the safeAreaInsets added by this PR, and then the blue+yellow+red=grey middle part is where the Overlay's content goes.

Device Type Screenshot 1 Screenshot 2
Notched Device Screenshot 2024-09-18 at 20 09 00 Screenshot 2024-09-18 at 20 09 03
Non-Notched Device Screenshot 2024-09-18 at 20 09 18 Screenshot 2024-09-18 at 20 09 22

@michaelkirk michaelkirk force-pushed the mkirk/non-notched-layout branch from 60a251a to 3899276 Compare September 19, 2024 03:55
@michaelkirk michaelkirk force-pushed the mkirk/non-notched-layout branch from 3899276 to 58d4afc Compare September 19, 2024 04:10
@ianthetechie
Copy link
Contributor

Wow 😍 It might take me till early next week to get to this, but this is awesome! Thanks for all the comparison screenshots and thorough comments!

@michaelkirk michaelkirk force-pushed the mkirk/non-notched-layout branch 2 times, most recently from 4c35a29 to 8b22fd7 Compare September 19, 2024 22:11
This will not compound with safeAreaInsets, but ensure that devices
which don't have safeAreaInsets (like the iPhoneSE 3) will have some
padding between the overlay and the screen edge.

Now that the padding is applied to the Overlay view, some of the padding
previously added to views within the overlay view is now redundant.

remove double padding which is now redundant with safeAreaInsets
I think this is an improvement on all platforms, because it shows a tiny
bit more of the underlying map, while still being _enough_ padding, but
it's especially important for SE (non-notched devices), which is
otherwise very pressed for space near the puck.
The view already has the methods necessary to conform to the protocol,
and both of the similar PortraitNavigationView and
DynamicallyOrientingNavigationView have this conformance, so presumably
this was just an accidental omission.
These changes are expected - due to shrinking the height of the arrival
view a bit.
@michaelkirk michaelkirk force-pushed the mkirk/non-notched-layout branch from 8b22fd7 to 9034185 Compare September 19, 2024 22:36
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.

This is looking great! Thanks for cleaning up some of the loose ends here 😄

Have some discussion points on the padding and puck positioning since it's a general problem for all platforms.

Copy link
Contributor

@ianthetechie ianthetechie left a comment

Choose a reason for hiding this comment

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

Looks good now! I just went ahead and pushed the final few changes over the line, and ensured additionally that the parameter is exposed upstream now (no magic that users can't customize).

I'll merge assuming CI checks pass.

@ianthetechie ianthetechie merged commit f4429e3 into stadiamaps:main Sep 24, 2024
14 checks passed
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.

iOS - missing padding on non-notched (touch id) devices.
3 participants