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
Refactor styling #536
Refactor styling #536
Conversation
0afcd3b
to
5e1d7fb
Compare
DistanceLabel.appearance().textColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) | ||
DestinationLabel.appearance().textColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1) | ||
TimeRemainingLabel.appearance().textColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1) | ||
ArrivalTimeLabel.appearance().textColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1) |
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.
While we're at it, want to add a StyleType
enum to this style and also add a custom dark theme? Would be cool to show custom night/day switching styles in the example.
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.
Fixed in 29b1269
Examples/Swift/ViewController.swift
Outdated
@@ -162,10 +162,10 @@ class ViewController: UIViewController, MGLMapViewDelegate { | |||
|
|||
exampleMode = .default | |||
|
|||
let navigationViewController = NavigationViewController(for: route, locationManager: locationManager()) | |||
let navigationViewController = NavigationViewController(for: route, styles: [DefaultStyle()], locationManager: locationManager()) |
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 sort of a confusing case. It's sort of half the default case since we're not passing in the default dark style? Thoughts on reverting this change?
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.
Ah, yeah, this was just to force the light style while working on it.
f6d1846
to
1ca839e
Compare
1ca839e
to
74bef1f
Compare
This is looking good, however I'm getting the default dark style (during the day) in the demo app. |
74bef1f
to
9e8a03f
Compare
f0585be
to
5f41008
Compare
@bsudekum We should be good to ✅ here. |
MapboxNavigation/Style.swift
Outdated
@@ -564,7 +210,7 @@ public class ProgressBar: UIView { | |||
|
|||
let bar = UIView() | |||
|
|||
dynamic var barColor: UIColor = #colorLiteral(red: 0.1411764771, green: 0.3960784376, blue: 0.5647059083, alpha: 1) { | |||
dynamic public var barColor: UIColor = #colorLiteral(red: 0.1411764771, green: 0.3960784376, blue: 0.5647059083, alpha: 1) { |
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 needs documentation.
MapboxNavigation/UIFont.swift
Outdated
@@ -23,7 +23,7 @@ extension UIFont { | |||
} | |||
|
|||
// Adjusted for preferredContentSizeCategory (`adjustsFontForContentSizeCategory` is supported iOS >= 10.0) | |||
var adjustedFont: UIFont { | |||
public var adjustedFont: UIFont { |
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.
documentation needed.
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, added few doc comments.
Made a few changes here since trait collections are usually applied per property, not per style.
This also makes it a lot more convenient to style components that aren't explicitly exposed in the style.
A custom night style would look something like this:
@bsudekum 👀