-
Notifications
You must be signed in to change notification settings - Fork 26
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
[ios] non-notched layout #258
Conversation
// // Overlay safeArea | ||
// Rectangle().fill(.blue.opacity(0.5)).padding(overlaySafeAreaInsets) | ||
// } | ||
// ) |
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'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 | ||
Non-Notched Device |
apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift
Outdated
Show resolved
Hide resolved
60a251a
to
3899276
Compare
apple/Sources/FerrostarMapLibreUI/Views/Overylays/LandscapeNavigationOverlayView.swift
Show resolved
Hide resolved
3899276
to
58d4afc
Compare
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! |
...FerrostarSwiftUITests/Views/__Snapshots__/ArrivalViewTests/testArrivalViewDefaultTheme.1.png
Outdated
Show resolved
Hide resolved
4c35a29
to
8b22fd7
Compare
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.
…ton becomes two lines which looks bad
e.g. the iPhone SE 2 and 3
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.
8b22fd7
to
9034185
Compare
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 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.
apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift
Outdated
Show resolved
Hide resolved
apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift
Outdated
Show resolved
Hide resolved
apple/Sources/FerrostarMapLibreUI/Models/NavigationMapViewContentInsetMode.swift
Outdated
Show resolved
Hide resolved
Better names and docs
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.
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.
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).