Skip to content

Comments

Make distance label larger#217

Merged
bsudekum merged 11 commits intomasterfrom
header-updarte
May 15, 2017
Merged

Make distance label larger#217
bsudekum merged 11 commits intomasterfrom
header-updarte

Conversation

@bsudekum
Copy link
Contributor

This changes the instruction header to:

  • Puts the distance above the street name
  • If no highway is present, the text can be full width
  • Now the street name must be one line. Because of this, the font size shrinks. However, if there is no distance, it can be 2 lines (currently buggy)

simulator screen shot may 10 2017 1 29 22 pm

simulator screen shot may 10 2017 1 50 52 pm

To fix:

simulator screen shot may 10 2017 1 50 44 pm

Font size looks like it's the right size when there is no distance, however, it's clipped to a single line even though I'm saying it can have 2 lines

@frederoni could you take a look into the 2 line issues above?

@bsudekum bsudekum requested review from 1ec5 and frederoni May 10, 2017 21:01
Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

There seems to be too much whitespace at the bottom of the turn banner compared to the top (where the status bar takes up some of the space).

<constraint firstItem="c3B-6D-Ukh" firstAttribute="leading" secondItem="dhM-Ng-gx5" secondAttribute="leading" id="Dcy-eQ-VCk"/>
<constraint firstAttribute="bottom" secondItem="gkj-hG-NxS" secondAttribute="bottom" constant="19" id="EBu-yb-gc6"/>
<constraint firstAttribute="bottom" secondItem="c3B-6D-Ukh" secondAttribute="bottom" id="Ofy-g6-EBl"/>
<constraint firstItem="gkj-hG-NxS" firstAttribute="leading" secondItem="c3B-6D-Ukh" secondAttribute="trailing" id="mWA-J9-gaq"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

There needs to be a gap between the right edge of the street name label (and distance label) and the left edge of the shield view. The gap should be the same width as the right margin of the shield view and ideally the same width as the gap between the maneuver icon and the street name label.

Copy link
Contributor

@frederoni frederoni May 11, 2017

Choose a reason for hiding this comment

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

Added 8px spacing in the horizontal stack view.

@frederoni
Copy link
Contributor

Changed word wrap to truncate tail and 50% minimum font scale.

Also added FBSnapshotTestCase and fixtures to verify single and multiline. We should add a few more cases to cover w/ and w/o a visible shield.

@frederoni frederoni force-pushed the header-updarte branch 3 times, most recently from 64d5e9d to ba9ba2d Compare May 11, 2017 14:04
@bsudekum
Copy link
Contributor Author

@1ec5 I think this ready for review now

@bsudekum
Copy link
Contributor Author

Also noting, we were only showing lanes when paging through steps, added them back in 51f9e1a

Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

testManeuverViewSingleLine@2x.png doesn’t show much of a gap between the street name label and the shield view – do you know why that might be?


/// Returns the string abbreviated only as much as necessary to fit the given width and font.
func abbreviated(width: CGFloat, font: UIFont) -> String {
func abbreviated(bounds: CGRect, font: UIFont) -> String {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method should be called abbreviated(toFit:font:), not abbreviated(bounds:font:). The relationship between the method name and the argument value should be clear when reading the method call.

maneuverViewController.streetLabel.text = routeStepFormatter.string(for: step)?.abbreviated(bounds: streetLabelBounds, font: streetLabelFont)
}
maneuverViewController.distanceLabel.text = step!.distance > 0 ? distanceFormatter.string(from: step!.distance) : ""
maneuverViewController.distanceText = step!.distance > 0 ? distanceFormatter.string(from: step!.distance) : nil
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be cleaner to replace the distanceText property with a distance property whose didSet takes care of formatting the numeric distance into a string.

@frederoni
Copy link
Contributor

testManeuverViewSingleLine@2x.png doesn’t show much of a gap between the street name label and the shield view – do you know why that might be?

I recorded the 2x before I added the spacing but I removed the unused reference images ( d6b8090 ) since we only test on iPhone 6s Plus 3x on Bitrise. Let's add more devices when we've verified that the snapshot tests are reliable and easy to implement in our workflow.

@bsudekum bsudekum merged commit d68ae17 into master May 15, 2017
@bsudekum bsudekum deleted the header-updarte branch May 15, 2017 15:49
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