Skip to content

Improve landscape layout during active navigation. - #3643

Merged
MaximAlien merged 1 commit into
mainfrom
maxim/1347-change-ladscape-layout
Jan 20, 2022
Merged

MaximAlien merged 1 commit into
mainfrom
maxim/1347-change-ladscape-layout

Conversation

@MaximAlien

@MaximAlien MaximAlien commented Dec 9, 2021 •

Copy link
Copy Markdown
Contributor

PR improves layout in the landscape mode by minimizing space top and bottom banner use. Examples:

Simulator Screen Shot - iPod touch (7th generation) - 2022-01-19 at 21 46 02

Simulator Screen Shot - iPod touch (7th generation) - 2022-01-19 at 21 45 45

Simulator Screen Shot - iPhone 12 mini - 2022-01-19 at 21 43 21

Fixes #1139.

/cc @lawsonkight @abhishek1508

@MaximAlien MaximAlien added UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. drop-in labels Dec 9, 2021
@MaximAlien MaximAlien added this to the v2.2 milestone Dec 9, 2021
@MaximAlien
MaximAlien requested a review from a team December 9, 2021 00:20
@MaximAlien MaximAlien self-assigned this Dec 9, 2021
@MaximAlien
MaximAlien marked this pull request as draft December 9, 2021 00:21
@mapbox-github-ci-issues-5

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-5

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from b3c2fc5 to a70524b Compare December 16, 2021 18:18
@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@1ec5 1ec5 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an elegant solution to the map-crowding problem identified in #1139. A few things based on visual inspection of the screenshot in #3643 (comment).

Comment on lines +293 to +287
let compactBottomBannerContainerViewTrailingConstraint = bottomBannerContainerView.trailingAnchor.constraint(equalTo: trailingAnchor,
constant: -(screenWidth * 0.6))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the iPhone SE screenshot you provided, the distance and time labels collide into each other. CarPlay removes the possibility of collisions by wrapping units onto a second line, but that would be a more complex change. Perhaps we could hide the distance label when there isn’t enough room.

It’s a little unusual that the ✖️ close button hangs out on the right end, somewhere in the middle of the screen. Moving it out of the bottom banner would help make things fit better. Would it be straightforward to replace it with a floating button in the bottom-right corner of the map? That way the close button is in a predictable location on screen, and the ℹ️ attribution button doesn’t seem like it’s floating out in the middle of nowhere.

@MaximAlien MaximAlien Jan 13, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Regarding close button: it's a bit tricky to move it at this point without breaking several APIs. I can also see that most of the navigation apps on the market also show close button in bottom bar menu. I've changed position of attribution button to take into account orientation and notch presence.

I'll play around with a possibility of hiding secondary label in bottom menu, this is indeed an issue on devices with smaller screen sizes.

insets.top += topBannerContainerView.bounds.height
insets.bottom += bottomBannerContainerView.bounds.height + 10.0
case .compact:
insets.left += navigationViewData.navigationView.topBannerContainerView.frame.width + 10.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The leading and trailing constraints below are direction-independent, so the flip in a right-to-left language environment. Does that affect the insets required here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, improved current insets for the right-to-left languages. Interestingly enough Google Maps for iOS doesn't flip top and bottom banner views, whereas Apple Maps flip.

let screenWidth = UIScreen.main.bounds.width
let compactTopBannerContainerViewLeadingConstraint = topBannerContainerView.leadingAnchor.constraint(equalTo: leadingAnchor)
let compactTopBannerContainerViewTrailingConstraint = topBannerContainerView.trailingAnchor.constraint(equalTo: trailingAnchor,
constant: -(screenWidth * 0.6))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this look like when using guidance cards? That design has the upcoming card peek out from the trailing side, but now would it be clipped or float in the middle of the map somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, it's currently clipped. I'll have to improve layout there, but in general it also seem to look better (guidance card no longer fills the whole parent view width). For example:

Simulator Screen Shot - iPhone 12 Pro Max - 2022-01-07 at 15 06 57

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

guidance card no longer fills the whole parent view width

It’s certainly an improvement on an iPhone screen. Does this change affect the layout on iPad in either orientation? If I remember correctly, we had gotten it so that the subsequent cards would remain visible beside the current card, so that you’d see three up at a time in a sort of marquee layout. But maybe I’m confusing that with a custom integration with guidance cards at the application level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've made a change to only show new layout in landscape mode for devices with regular and compact size classes, this means that iPads are not affected for now. I'm not sure that we should integrate new layout on iPads, as there is enough space in portrait/landscape mode anyway. Guidance cards width is also not affected, so only one guidance card is currently shown, next one is only partly visible. Current look:

Simulator Screen Shot - iPad Pro (12 9-inch) (5th generation) - 2022-01-20 at 11 18 19

I'm thinking about doing some more tests to see whether we should perform any changes on iPad. Guidance cards improvements (which will be done in a separate ticket) might help with making a decision.

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from a70524b to 1752c50 Compare January 3, 2022 19:39
@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from 46dc808 to 1d9ab67 Compare January 11, 2022 01:07
@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from 1d9ab67 to a561e47 Compare January 11, 2022 22:22
@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from c6166e0 to 3cd7a4f Compare January 18, 2022 18:17
@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from bab86e0 to 5ab9a2e Compare January 19, 2022 17:54
@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@1ec5 1ec5 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested changelog entry:

  • In landscape orientation, NavigationViewController’s top and bottom banners take up less space, leaving more room for the map. (#3643)

Before merging, double-check that the behavior on iPad is reasonable in both orientations: #3643 (comment).

/**
`StepsViewControllerDelegate` provides methods for user interactions in a `StepsViewController`.
*/
public protocol StepsViewControllerDelegate: AnyObject {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Speaking of the step table, what does it look like when you tap or swipe down on the top banner? Does it still get slotted into the space between the top and bottom banners as it does now? If so, we can tackle improving that layout as tail work. There isn’t a very natural place for the step table in this landscape orientation, but maybe presenting it as a modal view controller would be an improvement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, it's currently fit between leading and trailing anchors of top and bottom banners:

Simulator Screen Shot - iPod touch (7th generation) - 2022-01-20 at 11 22 31

It doesn't look too bad, but more space would improve things, I'll think about possible improvements.

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxCoreNavigation

@mapbox-github-ci-issues-public-1

Copy link
Copy Markdown

No breaking changes detected in MapboxNavigation

@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from 944774d to ba62d46 Compare January 20, 2022 22:23
@MaximAlien
MaximAlien force-pushed the maxim/1347-change-ladscape-layout branch from ba62d46 to c2c233b Compare January 20, 2022 22:24
@MaximAlien
MaximAlien merged commit 0a6a792 into main Jan 20, 2022
@MaximAlien
MaximAlien deleted the maxim/1347-change-ladscape-layout branch January 20, 2022 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drop-in UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve layout in landscape orientation

2 participants