@complexify/expo-mapbox-navigation 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,43 +4,28 @@ import MapboxNavigationUIKit
|
|
4
4
|
import UIKit
|
5
5
|
|
6
6
|
class CustomDayStyle: StandardDayStyle {
|
7
|
-
// Speed Limit View
|
8
7
|
var customSpeedLimitTextColor: UIColor?
|
9
8
|
var customSpeedLimitBackgroundColor: UIColor?
|
10
9
|
var customSpeedLimitBorderColor: UIColor?
|
11
|
-
|
12
|
-
// Bottom Banner
|
13
10
|
var customBottomBannerBackgroundColor: UIColor?
|
14
11
|
var customBottomBannerTimeRemainingTextColor: UIColor?
|
15
12
|
var customBottomBannerDistanceRemainingTextColor: UIColor?
|
16
13
|
var customBottomBannerArrivalTimeTextColor: UIColor?
|
17
|
-
|
18
|
-
// Way Name View
|
19
14
|
var customWayNameBackgroundColor: UIColor?
|
20
|
-
var customWayNameTextColor: UIColor?
|
21
|
-
|
22
|
-
// Top Banner
|
23
15
|
var customTopBannerBackgroundColor: UIColor?
|
24
16
|
var customTopBannerPrimaryTextColor: UIColor?
|
25
17
|
var customTopBannerSecondaryTextColor: UIColor?
|
26
18
|
var customTopBannerDistanceTextColor: UIColor?
|
27
|
-
var customTopBannerSeparatorColor: UIColor?
|
28
|
-
|
29
|
-
// Resume Button
|
30
19
|
var customResumeButtonBackgroundColor: UIColor?
|
31
20
|
var customResumeButtonTextColor: UIColor?
|
32
21
|
var customResumeButtonBorderColor: UIColor?
|
33
|
-
|
34
|
-
// Floating Buttons
|
35
22
|
var customFloatingButtonsBackgroundColor: UIColor?
|
36
23
|
var customFloatingButtonsBorderColor: UIColor?
|
37
24
|
var customFloatingButtonsTextColor: UIColor?
|
38
25
|
|
39
|
-
//
|
40
|
-
var
|
41
|
-
var
|
42
|
-
var customManeuverViewPrimaryColorHighlighted: UIColor?
|
43
|
-
var customManeuverViewSecondaryColorHighlighted: UIColor?
|
26
|
+
// Information Stack (2)
|
27
|
+
var customInformationStackBackgroundColor: UIColor?
|
28
|
+
var customInformationStackTextColor: UIColor?
|
44
29
|
|
45
30
|
// Steps List
|
46
31
|
var customStepsBackgroundColor: UIColor?
|
@@ -65,104 +50,36 @@ class CustomDayStyle: StandardDayStyle {
|
|
65
50
|
var customProgressBarProgressColor: UIColor?
|
66
51
|
var customProgressBarBackgroundColor: UIColor?
|
67
52
|
|
53
|
+
// Maneuver View
|
54
|
+
var customManeuverViewPrimaryColor: UIColor?
|
55
|
+
var customManeuverViewSecondaryColor: UIColor?
|
56
|
+
var customManeuverViewPrimaryColorHighlighted: UIColor?
|
57
|
+
var customManeuverViewSecondaryColorHighlighted: UIColor?
|
58
|
+
|
59
|
+
// Instructions Card
|
60
|
+
var customInstructionsCardBackgroundColor: UIColor?
|
61
|
+
var customInstructionsCardSeparatorColor: UIColor?
|
62
|
+
var customInstructionsCardHighlightedSeparatorColor: UIColor?
|
63
|
+
|
68
64
|
// Exit View
|
69
65
|
var customExitViewForegroundColor: UIColor?
|
70
66
|
var customExitViewBorderColor: UIColor?
|
71
67
|
var customExitViewHighlightColor: UIColor?
|
72
|
-
|
68
|
+
|
73
69
|
// Route Shield
|
74
70
|
var customRouteShieldForegroundColor: UIColor?
|
75
71
|
var customRouteShieldBorderColor: UIColor?
|
76
72
|
var customRouteShieldHighlightColor: UIColor?
|
77
|
-
|
73
|
+
|
78
74
|
// Distance Labels
|
79
75
|
var customDistanceRemainingColor: UIColor?
|
80
76
|
var customDistanceUnitColor: UIColor?
|
81
77
|
var customDistanceValueColor: UIColor?
|
82
|
-
|
83
|
-
// Navigation Map
|
84
|
-
var customRouteAlternateColor: UIColor?
|
85
|
-
var customRouteAnnotationSelectedColor: UIColor?
|
86
|
-
var customRouteAnnotationColor: UIColor?
|
87
|
-
var customRouteAnnotationTextColor: UIColor?
|
88
|
-
var customRouteAnnotationSelectedTextColor: UIColor?
|
89
|
-
var customRouteAnnotationMoreTimeTextColor: UIColor?
|
90
|
-
var customRouteAnnotationLessTimeTextColor: UIColor?
|
91
|
-
var customWaypointColor: UIColor?
|
92
|
-
var customWaypointStrokeColor: UIColor?
|
93
|
-
|
94
|
-
// Instructions Card
|
95
|
-
var customInstructionsCardBackgroundColor: UIColor?
|
96
|
-
var customInstructionsCardSeparatorColor: UIColor?
|
97
|
-
var customInstructionsCardHighlightedSeparatorColor: UIColor?
|
98
|
-
|
99
|
-
// Feedback
|
100
|
-
var customFeedbackBackgroundColor: UIColor?
|
101
|
-
var customFeedbackTextColor: UIColor?
|
102
|
-
var customFeedbackCellColor: UIColor?
|
103
|
-
var customFeedbackSubtypeCircleColor: UIColor?
|
104
|
-
var customFeedbackSubtypeCircleOutlineColor: UIColor?
|
105
|
-
|
106
|
-
// End of Route
|
107
|
-
var customEndOfRouteButtonTextColor: UIColor?
|
108
|
-
var customEndOfRouteCommentBackgroundColor: UIColor?
|
109
|
-
var customEndOfRouteCommentTextColor: UIColor?
|
110
|
-
var customEndOfRouteContentBackgroundColor: UIColor?
|
111
|
-
var customEndOfRouteTitleTextColor: UIColor?
|
112
|
-
|
113
|
-
// Road Shield Colors
|
114
|
-
var customRoadShieldBlackColor: UIColor?
|
115
|
-
var customRoadShieldBlueColor: UIColor?
|
116
|
-
var customRoadShieldGreenColor: UIColor?
|
117
|
-
var customRoadShieldRedColor: UIColor?
|
118
|
-
var customRoadShieldWhiteColor: UIColor?
|
119
|
-
var customRoadShieldYellowColor: UIColor?
|
120
|
-
var customRoadShieldDefaultColor: UIColor?
|
121
|
-
|
122
|
-
// Button Properties
|
123
|
-
var customButtonTextColor: UIColor?
|
124
|
-
var customCancelButtonTintColor: UIColor?
|
125
|
-
var customPreviewButtonTintColor: UIColor?
|
126
|
-
var customStartButtonTintColor: UIColor?
|
127
|
-
var customDismissButtonBackgroundColor: UIColor?
|
128
|
-
var customDismissButtonTextColor: UIColor?
|
129
|
-
var customBackButtonBackgroundColor: UIColor?
|
130
|
-
var customBackButtonTintColor: UIColor?
|
131
|
-
var customBackButtonTextColor: UIColor?
|
132
|
-
var customBackButtonBorderColor: UIColor?
|
133
|
-
|
134
|
-
// Navigation View
|
135
|
-
var customNavigationViewBackgroundColor: UIColor?
|
136
|
-
|
137
|
-
// Distance Label Properties
|
138
|
-
var customDistanceLabelUnitTextColor: UIColor?
|
139
|
-
var customDistanceLabelValueTextColor: UIColor?
|
140
|
-
|
78
|
+
|
141
79
|
// Rating Control
|
142
80
|
var customRatingControlNormalColor: UIColor?
|
143
81
|
var customRatingControlSelectedColor: UIColor?
|
144
|
-
|
145
|
-
// Steps Properties
|
146
|
-
var customStepsBackgroundViewColor: UIColor?
|
147
|
-
var customStepsTableHeaderTintColor: UIColor?
|
148
|
-
var customStepsTableHeaderTextColor: UIColor?
|
149
|
-
var customStepInstructionsBackgroundColor: UIColor?
|
150
|
-
var customStepTableViewCellBackgroundColor: UIColor?
|
151
|
-
|
152
|
-
// Next Instruction
|
153
|
-
var customNextInstructionNormalTextColor: UIColor?
|
154
|
-
var customNextInstructionContainedTextColor: UIColor?
|
155
|
-
|
156
|
-
// Secondary Label Properties
|
157
|
-
var customSecondaryLabelNormalTextColor: UIColor?
|
158
|
-
var customSecondaryLabelFont: UIFont?
|
159
|
-
|
160
|
-
// Stylable Label
|
161
|
-
var customStylableLabelNormalTextColor: UIColor?
|
162
|
-
|
163
|
-
// CarPlay Properties
|
164
|
-
var customCarPlayCompassBackgroundColor: UIColor?
|
165
|
-
|
82
|
+
|
166
83
|
required init() {
|
167
84
|
super.init()
|
168
85
|
styleType = .day
|
@@ -173,7 +90,7 @@ class CustomDayStyle: StandardDayStyle {
|
|
173
90
|
|
174
91
|
let traitCollection = UIScreen.main.traitCollection
|
175
92
|
|
176
|
-
// Speed
|
93
|
+
// Speed limit customization
|
177
94
|
if let textColor = customSpeedLimitTextColor {
|
178
95
|
SpeedLimitView.appearance(for: traitCollection).textColor = textColor
|
179
96
|
}
|
@@ -184,10 +101,12 @@ class CustomDayStyle: StandardDayStyle {
|
|
184
101
|
SpeedLimitView.appearance(for: traitCollection).regulatoryBorderColor = borderColor
|
185
102
|
}
|
186
103
|
|
187
|
-
// Bottom
|
104
|
+
// Bottom banner customization
|
188
105
|
if let bottomBannerBg = customBottomBannerBackgroundColor {
|
189
106
|
BottomBannerView.appearance(for: traitCollection).backgroundColor = bottomBannerBg
|
190
107
|
}
|
108
|
+
|
109
|
+
// Bottom banner text colors
|
191
110
|
if let timeRemainingColor = customBottomBannerTimeRemainingTextColor {
|
192
111
|
TimeRemainingLabel.appearance(for: traitCollection).textColor = timeRemainingColor
|
193
112
|
}
|
@@ -198,15 +117,12 @@ class CustomDayStyle: StandardDayStyle {
|
|
198
117
|
ArrivalTimeLabel.appearance(for: traitCollection).textColor = arrivalTimeColor
|
199
118
|
}
|
200
119
|
|
201
|
-
// Way
|
120
|
+
// Way name customization
|
202
121
|
if let bgColor = customWayNameBackgroundColor {
|
203
|
-
|
204
|
-
}
|
205
|
-
if let textColor = customWayNameTextColor {
|
206
|
-
WayNameLabel.appearance(for: traitCollection).textColor = textColor
|
122
|
+
WayNameView.appearance(for: traitCollection).backgroundColor = bgColor.withAlphaComponent(0.8)
|
207
123
|
}
|
208
124
|
|
209
|
-
// Top
|
125
|
+
// Top banner customization
|
210
126
|
if let topBannerBg = customTopBannerBackgroundColor {
|
211
127
|
InstructionsBannerView.appearance(for: traitCollection).backgroundColor = topBannerBg
|
212
128
|
}
|
@@ -219,11 +135,8 @@ class CustomDayStyle: StandardDayStyle {
|
|
219
135
|
if let distanceTextColor = customTopBannerDistanceTextColor {
|
220
136
|
DistanceLabel.appearance(for: traitCollection).textColor = distanceTextColor
|
221
137
|
}
|
222
|
-
if let separatorColor = customTopBannerSeparatorColor {
|
223
|
-
SeparatorView.appearance(for: traitCollection).backgroundColor = separatorColor
|
224
|
-
}
|
225
138
|
|
226
|
-
// Resume
|
139
|
+
// Resume button customization
|
227
140
|
if let resumeBgColor = customResumeButtonBackgroundColor {
|
228
141
|
ResumeButton.appearance(for: traitCollection).backgroundColor = resumeBgColor
|
229
142
|
}
|
@@ -233,10 +146,12 @@ class CustomDayStyle: StandardDayStyle {
|
|
233
146
|
if let resumeBorderColor = customResumeButtonBorderColor {
|
234
147
|
ResumeButton.appearance(for: traitCollection).borderColor = resumeBorderColor
|
235
148
|
}
|
149
|
+
|
150
|
+
// Set default values for border width and corner radius
|
236
151
|
ResumeButton.appearance(for: traitCollection).borderWidth = 1.0
|
237
152
|
ResumeButton.appearance(for: traitCollection).cornerRadius = 4.0
|
238
153
|
|
239
|
-
// Floating
|
154
|
+
// Floating buttons customization
|
240
155
|
if let floatingBgColor = customFloatingButtonsBackgroundColor {
|
241
156
|
FloatingButton.appearance(for: traitCollection).backgroundColor = floatingBgColor
|
242
157
|
}
|
@@ -246,43 +161,52 @@ class CustomDayStyle: StandardDayStyle {
|
|
246
161
|
if let floatingBorderColor = customFloatingButtonsBorderColor {
|
247
162
|
FloatingButton.appearance(for: traitCollection).borderColor = floatingBorderColor
|
248
163
|
}
|
164
|
+
|
165
|
+
// Set default values for floating buttons
|
249
166
|
FloatingButton.appearance(for: traitCollection).borderWidth = 1.0
|
250
167
|
FloatingButton.appearance(for: traitCollection).cornerRadius = 4.0
|
251
168
|
|
252
|
-
//
|
253
|
-
if let
|
254
|
-
|
255
|
-
}
|
256
|
-
if let secondaryColor = customManeuverViewSecondaryColor {
|
257
|
-
ManeuverView.appearance(for: traitCollection).secondaryColor = secondaryColor
|
258
|
-
}
|
259
|
-
if let primaryHighlightedColor = customManeuverViewPrimaryColorHighlighted {
|
260
|
-
ManeuverView.appearance(for: traitCollection).primaryColorHighlighted = primaryHighlightedColor
|
169
|
+
// Information Stack
|
170
|
+
if let bgColor = customInformationStackBackgroundColor {
|
171
|
+
StepsBackgroundView.appearance(for: traitCollection).backgroundColor = bgColor
|
261
172
|
}
|
262
|
-
if let
|
263
|
-
|
173
|
+
if let textColor = customInformationStackTextColor {
|
174
|
+
StepsTableHeaderView.appearance(for: traitCollection).normalTextColor = textColor
|
264
175
|
}
|
265
176
|
|
266
177
|
// Steps List
|
267
178
|
if let bgColor = customStepsBackgroundColor {
|
268
|
-
|
179
|
+
StepInstructionsView.appearance(for: traitCollection).backgroundColor = bgColor
|
269
180
|
}
|
270
181
|
if let primaryTextColor = customStepsPrimaryTextColor {
|
271
|
-
|
182
|
+
PrimaryLabel.appearance(for: traitCollection, whenContainedInInstancesOf: [StepInstructionsView.self])
|
183
|
+
.normalTextColor = primaryTextColor
|
272
184
|
}
|
273
185
|
if let secondaryTextColor = customStepsSecondaryTextColor {
|
274
|
-
|
186
|
+
SecondaryLabel.appearance(for: traitCollection, whenContainedInInstancesOf: [StepInstructionsView.self])
|
187
|
+
.normalTextColor = secondaryTextColor
|
188
|
+
}
|
189
|
+
if let maneuverPrimaryColor = customStepsManeuverViewPrimaryColor {
|
190
|
+
ManeuverView.appearance(for: traitCollection, whenContainedInInstancesOf: [StepInstructionsView.self])
|
191
|
+
.primaryColor = maneuverPrimaryColor
|
192
|
+
}
|
193
|
+
if let maneuverSecondaryColor = customStepsManeuverViewSecondaryColor {
|
194
|
+
ManeuverView.appearance(for: traitCollection, whenContainedInInstancesOf: [StepInstructionsView.self])
|
195
|
+
.secondaryColor = maneuverSecondaryColor
|
196
|
+
}
|
197
|
+
if let separatorColor = customStepsSeparatorColor {
|
198
|
+
SeparatorView.appearance(for: traitCollection).backgroundColor = separatorColor
|
275
199
|
}
|
276
200
|
|
277
201
|
// Lane View
|
278
202
|
if let bgColor = customLaneViewBackgroundColor {
|
279
|
-
|
203
|
+
LanesView.appearance(for: traitCollection).backgroundColor = bgColor
|
280
204
|
}
|
281
205
|
if let fgColor = customLaneViewForegroundColor {
|
282
206
|
LaneView.appearance(for: traitCollection).primaryColor = fgColor
|
283
207
|
}
|
284
208
|
if let separatorColor = customLaneViewSeparatorColor {
|
285
|
-
|
209
|
+
// Apply to lane view separators if available
|
286
210
|
}
|
287
211
|
|
288
212
|
// Next Banner View
|
@@ -290,247 +214,89 @@ class CustomDayStyle: StandardDayStyle {
|
|
290
214
|
NextBannerView.appearance(for: traitCollection).backgroundColor = bgColor
|
291
215
|
}
|
292
216
|
if let primaryTextColor = customNextBannerPrimaryTextColor {
|
293
|
-
|
217
|
+
NextInstructionLabel.appearance(for: traitCollection, whenContainedInInstancesOf: [NextBannerView.self])
|
218
|
+
.normalTextColor = primaryTextColor
|
294
219
|
}
|
295
220
|
if let secondaryTextColor = customNextBannerSecondaryTextColor {
|
296
|
-
|
221
|
+
// Apply to secondary text in next banner
|
297
222
|
}
|
298
223
|
if let distanceTextColor = customNextBannerDistanceTextColor {
|
299
|
-
|
224
|
+
DistanceLabel.appearance(for: traitCollection, whenContainedInInstancesOf: [NextBannerView.self])
|
225
|
+
.valueTextColor = distanceTextColor
|
300
226
|
}
|
301
227
|
|
302
228
|
// Progress Bar
|
303
229
|
if let progressColor = customProgressBarProgressColor {
|
304
|
-
|
305
|
-
}
|
306
|
-
if let backgroundColor = customProgressBarBackgroundColor {
|
307
|
-
ProgressBar.appearance(for: traitCollection).backgroundColor = backgroundColor
|
308
|
-
}
|
309
|
-
|
310
|
-
// Exit View
|
311
|
-
if let foregroundColor = customExitViewForegroundColor {
|
312
|
-
ExitView.appearance(for: traitCollection).foregroundColor = foregroundColor
|
230
|
+
// Apply to progress bar progress color
|
313
231
|
}
|
314
|
-
if let
|
315
|
-
|
316
|
-
}
|
317
|
-
if let highlightColor = customExitViewHighlightColor {
|
318
|
-
ExitView.appearance(for: traitCollection).highlightColor = highlightColor
|
232
|
+
if let bgColor = customProgressBarBackgroundColor {
|
233
|
+
// Apply to progress bar background
|
319
234
|
}
|
320
|
-
|
321
|
-
//
|
322
|
-
if let
|
323
|
-
|
235
|
+
|
236
|
+
// Maneuver View
|
237
|
+
if let primaryColor = customManeuverViewPrimaryColor {
|
238
|
+
ManeuverView.appearance(for: traitCollection).primaryColor = primaryColor
|
324
239
|
}
|
325
|
-
if let
|
326
|
-
|
240
|
+
if let secondaryColor = customManeuverViewSecondaryColor {
|
241
|
+
ManeuverView.appearance(for: traitCollection).secondaryColor = secondaryColor
|
327
242
|
}
|
328
|
-
if let
|
329
|
-
|
243
|
+
if let primaryHighlightedColor = customManeuverViewPrimaryColorHighlighted {
|
244
|
+
ManeuverView.appearance(for: traitCollection).primaryColorHighlighted = primaryHighlightedColor
|
330
245
|
}
|
331
|
-
|
332
|
-
|
333
|
-
if let distanceColor = customDistanceRemainingColor {
|
334
|
-
DistanceRemainingLabel.appearance(for: traitCollection).normalTextColor = distanceColor
|
246
|
+
if let secondaryHighlightedColor = customManeuverViewSecondaryColorHighlighted {
|
247
|
+
ManeuverView.appearance(for: traitCollection).secondaryColorHighlighted = secondaryHighlightedColor
|
335
248
|
}
|
336
|
-
|
249
|
+
|
337
250
|
// Instructions Card
|
338
251
|
if let bgColor = customInstructionsCardBackgroundColor {
|
339
|
-
InstructionsCardContainerView.appearance(
|
340
|
-
for: traitCollection,
|
341
|
-
whenContainedInInstancesOf: [InstructionsCardCell.self]
|
342
|
-
).customBackgroundColor = bgColor
|
252
|
+
InstructionsCardContainerView.appearance(for: traitCollection).customBackgroundColor = bgColor
|
343
253
|
}
|
344
254
|
if let separatorColor = customInstructionsCardSeparatorColor {
|
345
|
-
InstructionsCardContainerView.appearance(
|
346
|
-
for: traitCollection,
|
347
|
-
whenContainedInInstancesOf: [InstructionsCardCell.self]
|
348
|
-
).separatorColor = separatorColor
|
255
|
+
InstructionsCardContainerView.appearance(for: traitCollection).separatorColor = separatorColor
|
349
256
|
}
|
350
257
|
if let highlightedSeparatorColor = customInstructionsCardHighlightedSeparatorColor {
|
351
|
-
InstructionsCardContainerView.appearance(
|
352
|
-
for: traitCollection,
|
353
|
-
whenContainedInInstancesOf: [InstructionsCardCell.self]
|
354
|
-
).highlightedSeparatorColor = highlightedSeparatorColor
|
355
|
-
}
|
356
|
-
|
357
|
-
// Feedback
|
358
|
-
if let feedbackBgColor = customFeedbackBackgroundColor {
|
359
|
-
FeedbackStyleView.appearance(for: traitCollection).backgroundColor = feedbackBgColor
|
360
|
-
FeedbackCollectionView.appearance(for: traitCollection).backgroundColor = feedbackBgColor
|
361
|
-
}
|
362
|
-
if let feedbackTextColor = customFeedbackTextColor {
|
363
|
-
UILabel.appearance(
|
364
|
-
for: traitCollection,
|
365
|
-
whenContainedInInstancesOf: [FeedbackViewController.self]
|
366
|
-
).textColor = feedbackTextColor
|
367
|
-
}
|
368
|
-
if let feedbackCellColor = customFeedbackCellColor {
|
369
|
-
FeedbackCollectionView.appearance(for: traitCollection).cellColor = feedbackCellColor
|
370
|
-
}
|
371
|
-
|
372
|
-
// Road Shield Colors
|
373
|
-
if let blackColor = customRoadShieldBlackColor {
|
374
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldBlackColor = blackColor
|
375
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldBlackColor = blackColor
|
376
|
-
}
|
377
|
-
if let blueColor = customRoadShieldBlueColor {
|
378
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldBlueColor = blueColor
|
379
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldBlueColor = blueColor
|
380
|
-
}
|
381
|
-
if let greenColor = customRoadShieldGreenColor {
|
382
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldGreenColor = greenColor
|
383
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldGreenColor = greenColor
|
384
|
-
}
|
385
|
-
if let redColor = customRoadShieldRedColor {
|
386
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldRedColor = redColor
|
387
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldRedColor = redColor
|
388
|
-
}
|
389
|
-
if let whiteColor = customRoadShieldWhiteColor {
|
390
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldWhiteColor = whiteColor
|
391
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldWhiteColor = whiteColor
|
392
|
-
}
|
393
|
-
if let yellowColor = customRoadShieldYellowColor {
|
394
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldYellowColor = yellowColor
|
395
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldYellowColor = yellowColor
|
396
|
-
}
|
397
|
-
if let defaultColor = customRoadShieldDefaultColor {
|
398
|
-
WayNameLabel.appearance(for: traitCollection).roadShieldDefaultColor = defaultColor
|
399
|
-
InstructionLabel.appearance(for: traitCollection).roadShieldDefaultColor = defaultColor
|
400
|
-
}
|
401
|
-
|
402
|
-
// Navigation Map
|
403
|
-
Task { @MainActor in
|
404
|
-
if let alternateColor = customRouteAlternateColor {
|
405
|
-
NavigationMapView.appearance(for: traitCollection).routeAlternateColor = alternateColor
|
406
|
-
}
|
407
|
-
if let selectedColor = customRouteAnnotationSelectedColor {
|
408
|
-
NavigationMapView.appearance(for: traitCollection).routeAnnotationSelectedColor = selectedColor
|
409
|
-
}
|
410
|
-
if let annotationColor = customRouteAnnotationColor {
|
411
|
-
NavigationMapView.appearance(for: traitCollection).routeAnnotationColor = annotationColor
|
412
|
-
}
|
413
|
-
if let annotationTextColor = customRouteAnnotationTextColor {
|
414
|
-
NavigationMapView.appearance(for: traitCollection).routeAnnotationTextColor = annotationTextColor
|
415
|
-
}
|
416
|
-
if let selectedTextColor = customRouteAnnotationSelectedTextColor {
|
417
|
-
NavigationMapView.appearance(for: traitCollection).routeAnnotationSelectedTextColor = selectedTextColor
|
418
|
-
}
|
419
|
-
if let moreTimeTextColor = customRouteAnnotationMoreTimeTextColor {
|
420
|
-
NavigationMapView.appearance(for: traitCollection).routeAnnotationMoreTimeTextColor = moreTimeTextColor
|
421
|
-
}
|
422
|
-
if let lessTimeTextColor = customRouteAnnotationLessTimeTextColor {
|
423
|
-
NavigationMapView.appearance(for: traitCollection).routeAnnotationLessTimeTextColor = lessTimeTextColor
|
424
|
-
}
|
425
|
-
if let waypointColor = customWaypointColor {
|
426
|
-
NavigationMapView.appearance(for: traitCollection).waypointColor = waypointColor
|
427
|
-
}
|
428
|
-
if let waypointStrokeColor = customWaypointStrokeColor {
|
429
|
-
NavigationMapView.appearance(for: traitCollection).waypointStrokeColor = waypointStrokeColor
|
430
|
-
}
|
431
|
-
}
|
432
|
-
|
433
|
-
// Button Properties
|
434
|
-
if let textColor = customButtonTextColor {
|
435
|
-
Button.appearance(for: traitCollection).textColor = textColor
|
436
|
-
}
|
437
|
-
|
438
|
-
if let cancelTintColor = customCancelButtonTintColor {
|
439
|
-
CancelButton.appearance(for: traitCollection).tintColor = cancelTintColor
|
258
|
+
InstructionsCardContainerView.appearance(for: traitCollection).highlightedSeparatorColor = highlightedSeparatorColor
|
440
259
|
}
|
441
260
|
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
if let startTintColor = customStartButtonTintColor {
|
447
|
-
StartButton.appearance(for: traitCollection).tintColor = startTintColor
|
448
|
-
}
|
449
|
-
|
450
|
-
if let dismissBgColor = customDismissButtonBackgroundColor {
|
451
|
-
DismissButton.appearance(for: traitCollection).backgroundColor = dismissBgColor
|
452
|
-
}
|
453
|
-
|
454
|
-
if let dismissTextColor = customDismissButtonTextColor {
|
455
|
-
DismissButton.appearance(for: traitCollection).textColor = dismissTextColor
|
456
|
-
}
|
457
|
-
|
458
|
-
if let backBgColor = customBackButtonBackgroundColor {
|
459
|
-
BackButton.appearance(for: traitCollection).backgroundColor = backBgColor
|
460
|
-
}
|
461
|
-
|
462
|
-
if let backTintColor = customBackButtonTintColor {
|
463
|
-
BackButton.appearance(for: traitCollection).tintColor = backTintColor
|
464
|
-
}
|
465
|
-
|
466
|
-
if let backTextColor = customBackButtonTextColor {
|
467
|
-
BackButton.appearance(for: traitCollection).textColor = backTextColor
|
468
|
-
}
|
469
|
-
|
470
|
-
if let backBorderColor = customBackButtonBorderColor {
|
471
|
-
BackButton.appearance(for: traitCollection).borderColor = backBorderColor
|
261
|
+
// Exit View
|
262
|
+
if let fgColor = customExitViewForegroundColor {
|
263
|
+
ExitView.appearance(for: traitCollection).foregroundColor = fgColor
|
472
264
|
}
|
473
|
-
|
474
|
-
|
475
|
-
if let navBgColor = customNavigationViewBackgroundColor {
|
476
|
-
NavigationView.appearance(for: traitCollection).backgroundColor = navBgColor
|
265
|
+
if let borderColor = customExitViewBorderColor {
|
266
|
+
ExitView.appearance(for: traitCollection).borderColor = borderColor
|
477
267
|
}
|
478
|
-
|
479
|
-
|
480
|
-
if let unitTextColor = customDistanceLabelUnitTextColor {
|
481
|
-
DistanceLabel.appearance(for: traitCollection).unitTextColor = unitTextColor
|
268
|
+
if let highlightColor = customExitViewHighlightColor {
|
269
|
+
ExitView.appearance(for: traitCollection).highlightColor = highlightColor
|
482
270
|
}
|
483
271
|
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
// Steps Properties
|
489
|
-
if let bgViewColor = customStepsBackgroundViewColor {
|
490
|
-
StepsBackgroundView.appearance(for: traitCollection).backgroundColor = bgViewColor
|
272
|
+
// Route Shield
|
273
|
+
if let fgColor = customRouteShieldForegroundColor {
|
274
|
+
GenericRouteShield.appearance(for: traitCollection).foregroundColor = fgColor
|
491
275
|
}
|
492
|
-
|
493
|
-
|
494
|
-
StepsViewController.appearance(for: traitCollection).tintColor = headerTintColor
|
276
|
+
if let borderColor = customRouteShieldBorderColor {
|
277
|
+
GenericRouteShield.appearance(for: traitCollection).borderColor = borderColor
|
495
278
|
}
|
496
|
-
|
497
|
-
|
498
|
-
StepsViewController.appearance(for: traitCollection).textColor = headerTextColor
|
279
|
+
if let highlightColor = customRouteShieldHighlightColor {
|
280
|
+
GenericRouteShield.appearance(for: traitCollection).highlightColor = highlightColor
|
499
281
|
}
|
500
282
|
|
501
|
-
|
502
|
-
|
283
|
+
// Distance Labels
|
284
|
+
if let remainingColor = customDistanceRemainingColor {
|
285
|
+
DistanceRemainingLabel.appearance(for: traitCollection).normalTextColor = remainingColor
|
503
286
|
}
|
504
|
-
|
505
|
-
|
506
|
-
StepTableViewCell.appearance(for: traitCollection).backgroundColor = cellBgColor
|
287
|
+
if let unitColor = customDistanceUnitColor {
|
288
|
+
DistanceLabel.appearance(for: traitCollection).unitTextColor = unitColor
|
507
289
|
}
|
508
|
-
|
509
|
-
|
510
|
-
if let normalTextColor = customNextInstructionNormalTextColor {
|
511
|
-
NextInstructionLabel.appearance(for: traitCollection).normalTextColor = normalTextColor
|
290
|
+
if let valueColor = customDistanceValueColor {
|
291
|
+
DistanceLabel.appearance(for: traitCollection).valueTextColor = valueColor
|
512
292
|
}
|
513
293
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
whenContainedInInstancesOf: [NextBannerView.self]
|
518
|
-
).normalTextColor = containedTextColor
|
294
|
+
// Rating Control
|
295
|
+
if let normalColor = customRatingControlNormalColor {
|
296
|
+
RatingControl.appearance(for: traitCollection).normalColor = normalColor
|
519
297
|
}
|
520
|
-
|
521
|
-
|
522
|
-
if let normalTextColor = customSecondaryLabelNormalTextColor {
|
523
|
-
SecondaryLabel.appearance(for: traitCollection).normalTextColor = normalTextColor
|
524
|
-
}
|
525
|
-
|
526
|
-
// Stylable Label
|
527
|
-
if let normalTextColor = customStylableLabelNormalTextColor {
|
528
|
-
StylableLabel.appearance(for: traitCollection).normalTextColor = normalTextColor
|
529
|
-
}
|
530
|
-
|
531
|
-
// CarPlay Properties
|
532
|
-
if let compassBgColor = customCarPlayCompassBackgroundColor {
|
533
|
-
CarPlayCompassView.appearance(for: traitCollection).backgroundColor = compassBgColor
|
298
|
+
if let selectedColor = customRatingControlSelectedColor {
|
299
|
+
RatingControl.appearance(for: traitCollection).selectedColor = selectedColor
|
534
300
|
}
|
535
301
|
}
|
536
|
-
}
|
302
|
+
}
|
@@ -210,50 +210,6 @@ public class ExpoMapboxNavigationModule: Module {
|
|
210
210
|
}
|
211
211
|
}
|
212
212
|
|
213
|
-
Prop("maneuverViewPrimaryColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
214
|
-
if let hexColor = color {
|
215
|
-
view.controller.setManeuverViewPrimaryColor(hexColor: hexColor)
|
216
|
-
}
|
217
|
-
}
|
218
|
-
|
219
|
-
Prop("maneuverViewSecondaryColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
220
|
-
if let hexColor = color {
|
221
|
-
view.controller.setManeuverViewSecondaryColor(hexColor: hexColor)
|
222
|
-
}
|
223
|
-
}
|
224
|
-
|
225
|
-
Prop("maneuverViewTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
226
|
-
if let hexColor = color {
|
227
|
-
view.controller.setManeuverViewTextColor(hexColor: hexColor)
|
228
|
-
}
|
229
|
-
}
|
230
|
-
|
231
|
-
Prop("maneuverViewBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
232
|
-
if let hexColor = color {
|
233
|
-
view.controller.setManeuverViewBackgroundColor(hexColor: hexColor)
|
234
|
-
}
|
235
|
-
}
|
236
|
-
|
237
|
-
Prop("maneuverViewPrimaryColorHighlighted") { (view: ExpoMapboxNavigationView, color: String?) in
|
238
|
-
if let hexColor = color {
|
239
|
-
view.controller.setManeuverViewPrimaryColorHighlighted(hexColor: hexColor)
|
240
|
-
}
|
241
|
-
}
|
242
|
-
|
243
|
-
Prop("maneuverViewSecondaryColorHighlighted") { (view: ExpoMapboxNavigationView, color: String?) in
|
244
|
-
if let hexColor = color {
|
245
|
-
view.controller.setManeuverViewSecondaryColorHighlighted(hexColor: hexColor)
|
246
|
-
}
|
247
|
-
}
|
248
|
-
|
249
|
-
// Way Name View
|
250
|
-
Prop("wayNameViewTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
251
|
-
if let hexColor = color {
|
252
|
-
view.controller.setWayNameViewTextColor(hexColor: hexColor)
|
253
|
-
}
|
254
|
-
}
|
255
|
-
|
256
|
-
// Steps List
|
257
213
|
Prop("stepsBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
258
214
|
if let hexColor = color {
|
259
215
|
view.controller.setStepsBackgroundColor(hexColor: hexColor)
|
@@ -278,312 +234,30 @@ public class ExpoMapboxNavigationModule: Module {
|
|
278
234
|
}
|
279
235
|
}
|
280
236
|
|
281
|
-
Prop("stepsManeuverViewSecondaryColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
282
|
-
if let hexColor = color {
|
283
|
-
view.controller.setStepsManeuverViewSecondaryColor(hexColor: hexColor)
|
284
|
-
}
|
285
|
-
}
|
286
|
-
|
287
|
-
Prop("stepsSeparatorColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
288
|
-
if let hexColor = color {
|
289
|
-
view.controller.setStepsSeparatorColor(hexColor: hexColor)
|
290
|
-
}
|
291
|
-
}
|
292
|
-
|
293
|
-
// Lane View
|
294
237
|
Prop("laneViewBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
295
238
|
if let hexColor = color {
|
296
239
|
view.controller.setLaneViewBackgroundColor(hexColor: hexColor)
|
297
240
|
}
|
298
241
|
}
|
299
242
|
|
300
|
-
Prop("
|
301
|
-
if let hexColor = color {
|
302
|
-
view.controller.setLaneViewForegroundColor(hexColor: hexColor)
|
303
|
-
}
|
304
|
-
}
|
305
|
-
|
306
|
-
Prop("laneViewSeparatorColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
307
|
-
if let hexColor = color {
|
308
|
-
view.controller.setLaneViewSeparatorColor(hexColor: hexColor)
|
309
|
-
}
|
310
|
-
}
|
311
|
-
|
312
|
-
// Next Banner View
|
313
|
-
Prop("nextBannerBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
314
|
-
if let hexColor = color {
|
315
|
-
view.controller.setNextBannerBackgroundColor(hexColor: hexColor)
|
316
|
-
}
|
317
|
-
}
|
318
|
-
|
319
|
-
Prop("nextBannerPrimaryTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
320
|
-
if let hexColor = color {
|
321
|
-
view.controller.setNextBannerPrimaryTextColor(hexColor: hexColor)
|
322
|
-
}
|
323
|
-
}
|
324
|
-
|
325
|
-
Prop("nextBannerSecondaryTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
326
|
-
if let hexColor = color {
|
327
|
-
view.controller.setNextBannerSecondaryTextColor(hexColor: hexColor)
|
328
|
-
}
|
329
|
-
}
|
330
|
-
|
331
|
-
Prop("nextBannerDistanceTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
332
|
-
if let hexColor = color {
|
333
|
-
view.controller.setNextBannerDistanceTextColor(hexColor: hexColor)
|
334
|
-
}
|
335
|
-
}
|
336
|
-
|
337
|
-
// Progress Bar
|
338
|
-
Prop("progressBarProgressColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
339
|
-
if let hexColor = color {
|
340
|
-
view.controller.setProgressBarProgressColor(hexColor: hexColor)
|
341
|
-
}
|
342
|
-
}
|
343
|
-
|
344
|
-
Prop("progressBarBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
345
|
-
if let hexColor = color {
|
346
|
-
view.controller.setProgressBarBackgroundColor(hexColor: hexColor)
|
347
|
-
}
|
348
|
-
}
|
349
|
-
|
350
|
-
// Instructions Card
|
351
|
-
Prop("instructionsCardBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
352
|
-
if let hexColor = color {
|
353
|
-
view.setInstructionsCardBackgroundColor(hexColor: hexColor)
|
354
|
-
}
|
355
|
-
}
|
356
|
-
|
357
|
-
Prop("instructionsCardSeparatorColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
358
|
-
if let hexColor = color {
|
359
|
-
view.setInstructionsCardSeparatorColor(hexColor: hexColor)
|
360
|
-
}
|
361
|
-
}
|
362
|
-
|
363
|
-
Prop("instructionsCardHighlightedSeparatorColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
364
|
-
if let hexColor = color {
|
365
|
-
view.setInstructionsCardHighlightedSeparatorColor(hexColor: hexColor)
|
366
|
-
}
|
367
|
-
}
|
368
|
-
|
369
|
-
// Exit View
|
370
|
-
Prop("exitViewForegroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
371
|
-
if let hexColor = color {
|
372
|
-
view.setExitViewForegroundColor(hexColor: hexColor)
|
373
|
-
}
|
374
|
-
}
|
375
|
-
|
376
|
-
Prop("exitViewBorderColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
377
|
-
if let hexColor = color {
|
378
|
-
view.setExitViewBorderColor(hexColor: hexColor)
|
379
|
-
}
|
380
|
-
}
|
381
|
-
|
382
|
-
Prop("exitViewHighlightColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
383
|
-
if let hexColor = color {
|
384
|
-
view.setExitViewHighlightColor(hexColor: hexColor)
|
385
|
-
}
|
386
|
-
}
|
387
|
-
|
388
|
-
// Route Shield Colors
|
389
|
-
Prop("roadShieldBlackColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
390
|
-
if let hexColor = color {
|
391
|
-
view.setRoadShieldBlackColor(hexColor: hexColor)
|
392
|
-
}
|
393
|
-
}
|
394
|
-
|
395
|
-
Prop("roadShieldBlueColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
396
|
-
if let hexColor = color {
|
397
|
-
view.setRoadShieldBlueColor(hexColor: hexColor)
|
398
|
-
}
|
399
|
-
}
|
400
|
-
|
401
|
-
Prop("roadShieldGreenColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
402
|
-
if let hexColor = color {
|
403
|
-
view.setRoadShieldGreenColor(hexColor: hexColor)
|
404
|
-
}
|
405
|
-
}
|
406
|
-
|
407
|
-
Prop("roadShieldRedColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
408
|
-
if let hexColor = color {
|
409
|
-
view.setRoadShieldRedColor(hexColor: hexColor)
|
410
|
-
}
|
411
|
-
}
|
412
|
-
|
413
|
-
Prop("roadShieldWhiteColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
414
|
-
if let hexColor = color {
|
415
|
-
view.setRoadShieldWhiteColor(hexColor: hexColor)
|
416
|
-
}
|
417
|
-
}
|
418
|
-
|
419
|
-
Prop("roadShieldYellowColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
420
|
-
if let hexColor = color {
|
421
|
-
view.setRoadShieldYellowColor(hexColor: hexColor)
|
422
|
-
}
|
423
|
-
}
|
424
|
-
|
425
|
-
Prop("roadShieldDefaultColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
426
|
-
if let hexColor = color {
|
427
|
-
view.setRoadShieldDefaultColor(hexColor: hexColor)
|
428
|
-
}
|
429
|
-
}
|
430
|
-
|
431
|
-
// Button Properties
|
432
|
-
Prop("buttonTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
433
|
-
if let hexColor = color {
|
434
|
-
view.setButtonTextColor(hexColor: hexColor)
|
435
|
-
}
|
436
|
-
}
|
437
|
-
|
438
|
-
Prop("cancelButtonTintColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
439
|
-
if let hexColor = color {
|
440
|
-
view.setCancelButtonTintColor(hexColor: hexColor)
|
441
|
-
}
|
442
|
-
}
|
443
|
-
|
444
|
-
Prop("previewButtonTintColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
445
|
-
if let hexColor = color {
|
446
|
-
view.setPreviewButtonTintColor(hexColor: hexColor)
|
447
|
-
}
|
448
|
-
}
|
449
|
-
|
450
|
-
Prop("startButtonTintColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
451
|
-
if let hexColor = color {
|
452
|
-
view.setStartButtonTintColor(hexColor: hexColor)
|
453
|
-
}
|
454
|
-
}
|
455
|
-
|
456
|
-
Prop("dismissButtonBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
457
|
-
if let hexColor = color {
|
458
|
-
view.setDismissButtonBackgroundColor(hexColor: hexColor)
|
459
|
-
}
|
460
|
-
}
|
461
|
-
|
462
|
-
Prop("dismissButtonTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
463
|
-
if let hexColor = color {
|
464
|
-
view.setDismissButtonTextColor(hexColor: hexColor)
|
465
|
-
}
|
466
|
-
}
|
467
|
-
|
468
|
-
Prop("backButtonBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
469
|
-
if let hexColor = color {
|
470
|
-
view.setBackButtonBackgroundColor(hexColor: hexColor)
|
471
|
-
}
|
472
|
-
}
|
473
|
-
|
474
|
-
Prop("backButtonTintColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
475
|
-
if let hexColor = color {
|
476
|
-
view.setBackButtonTintColor(hexColor: hexColor)
|
477
|
-
}
|
478
|
-
}
|
479
|
-
|
480
|
-
Prop("backButtonTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
481
|
-
if let hexColor = color {
|
482
|
-
view.setBackButtonTextColor(hexColor: hexColor)
|
483
|
-
}
|
484
|
-
}
|
485
|
-
|
486
|
-
Prop("backButtonBorderColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
487
|
-
if let hexColor = color {
|
488
|
-
view.setBackButtonBorderColor(hexColor: hexColor)
|
489
|
-
}
|
490
|
-
}
|
491
|
-
|
492
|
-
// Navigation View
|
493
|
-
Prop("navigationViewBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
494
|
-
if let hexColor = color {
|
495
|
-
view.setNavigationViewBackgroundColor(hexColor: hexColor)
|
496
|
-
}
|
497
|
-
}
|
498
|
-
|
499
|
-
// Distance Label Properties
|
500
|
-
Prop("distanceLabelUnitTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
501
|
-
if let hexColor = color {
|
502
|
-
view.setDistanceLabelUnitTextColor(hexColor: hexColor)
|
503
|
-
}
|
504
|
-
}
|
505
|
-
|
506
|
-
Prop("distanceLabelValueTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
507
|
-
if let hexColor = color {
|
508
|
-
view.setDistanceLabelValueTextColor(hexColor: hexColor)
|
509
|
-
}
|
510
|
-
}
|
511
|
-
|
512
|
-
// Rating Control
|
513
|
-
Prop("ratingControlNormalColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
514
|
-
if let hexColor = color {
|
515
|
-
view.setRatingControlNormalColor(hexColor: hexColor)
|
516
|
-
}
|
517
|
-
}
|
518
|
-
|
519
|
-
Prop("ratingControlSelectedColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
520
|
-
if let hexColor = color {
|
521
|
-
view.setRatingControlSelectedColor(hexColor: hexColor)
|
522
|
-
}
|
523
|
-
}
|
524
|
-
|
525
|
-
// Steps Properties
|
526
|
-
Prop("stepsBackgroundViewColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
527
|
-
if let hexColor = color {
|
528
|
-
view.setStepsBackgroundViewColor(hexColor: hexColor)
|
529
|
-
}
|
530
|
-
}
|
531
|
-
|
532
|
-
Prop("stepsTableHeaderTintColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
533
|
-
if let hexColor = color {
|
534
|
-
view.setStepsTableHeaderTintColor(hexColor: hexColor)
|
535
|
-
}
|
536
|
-
}
|
537
|
-
|
538
|
-
Prop("stepsTableHeaderTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
539
|
-
if let hexColor = color {
|
540
|
-
view.setStepsTableHeaderTextColor(hexColor: hexColor)
|
541
|
-
}
|
542
|
-
}
|
543
|
-
|
544
|
-
Prop("stepInstructionsBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
545
|
-
if let hexColor = color {
|
546
|
-
view.setStepInstructionsBackgroundColor(hexColor: hexColor)
|
547
|
-
}
|
548
|
-
}
|
549
|
-
|
550
|
-
Prop("stepTableViewCellBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
551
|
-
if let hexColor = color {
|
552
|
-
view.setStepTableViewCellBackgroundColor(hexColor: hexColor)
|
553
|
-
}
|
554
|
-
}
|
555
|
-
|
556
|
-
// Next Instruction
|
557
|
-
Prop("nextInstructionNormalTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
558
|
-
if let hexColor = color {
|
559
|
-
view.setNextInstructionNormalTextColor(hexColor: hexColor)
|
560
|
-
}
|
561
|
-
}
|
562
|
-
|
563
|
-
Prop("nextInstructionContainedTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
564
|
-
if let hexColor = color {
|
565
|
-
view.setNextInstructionContainedTextColor(hexColor: hexColor)
|
566
|
-
}
|
567
|
-
}
|
568
|
-
|
569
|
-
// Secondary Label Properties
|
570
|
-
Prop("secondaryLabelNormalTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
243
|
+
Prop("stepsManeuverViewSecondaryColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
571
244
|
if let hexColor = color {
|
572
|
-
view.
|
245
|
+
view.controller.customDayStyle.customStepsManeuverViewSecondaryColor = UIColor(hex: hexColor)
|
246
|
+
view.controller.update()
|
573
247
|
}
|
574
248
|
}
|
575
249
|
|
576
|
-
|
577
|
-
Prop("stylableLabelNormalTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
250
|
+
Prop("stepsSeparatorColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
578
251
|
if let hexColor = color {
|
579
|
-
view.
|
252
|
+
view.controller.customDayStyle.customStepsSeparatorColor = UIColor(hex: hexColor)
|
253
|
+
view.controller.update()
|
580
254
|
}
|
581
255
|
}
|
582
256
|
|
583
|
-
|
584
|
-
Prop("carPlayCompassBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
257
|
+
Prop("laneViewForegroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
|
585
258
|
if let hexColor = color {
|
586
|
-
view.
|
259
|
+
view.controller.customDayStyle.customLaneViewForegroundColor = UIColor(hex: hexColor)
|
260
|
+
view.controller.update()
|
587
261
|
}
|
588
262
|
}
|
589
263
|
}
|
@@ -34,330 +34,6 @@ class ExpoMapboxNavigationView: ExpoView {
|
|
34
34
|
override func layoutSubviews() {
|
35
35
|
controller.view.frame = bounds
|
36
36
|
}
|
37
|
-
|
38
|
-
// Steps List
|
39
|
-
func setStepsBackgroundColor(hexColor: String) {
|
40
|
-
controller.customDayStyle.customStepsBackgroundColor = UIColor(hex: hexColor)
|
41
|
-
controller.update()
|
42
|
-
}
|
43
|
-
|
44
|
-
func setStepsPrimaryTextColor(hexColor: String) {
|
45
|
-
controller.customDayStyle.customStepsPrimaryTextColor = UIColor(hex: hexColor)
|
46
|
-
controller.update()
|
47
|
-
}
|
48
|
-
|
49
|
-
func setStepsSecondaryTextColor(hexColor: String) {
|
50
|
-
controller.customDayStyle.customStepsSecondaryTextColor = UIColor(hex: hexColor)
|
51
|
-
controller.update()
|
52
|
-
}
|
53
|
-
|
54
|
-
func setStepsManeuverViewPrimaryColor(hexColor: String) {
|
55
|
-
controller.customDayStyle.customStepsManeuverViewPrimaryColor = UIColor(hex: hexColor)
|
56
|
-
controller.update()
|
57
|
-
}
|
58
|
-
|
59
|
-
func setStepsManeuverViewSecondaryColor(hexColor: String) {
|
60
|
-
controller.customDayStyle.customStepsManeuverViewSecondaryColor = UIColor(hex: hexColor)
|
61
|
-
controller.update()
|
62
|
-
}
|
63
|
-
|
64
|
-
func setStepsSeparatorColor(hexColor: String) {
|
65
|
-
controller.customDayStyle.customStepsSeparatorColor = UIColor(hex: hexColor)
|
66
|
-
controller.update()
|
67
|
-
}
|
68
|
-
|
69
|
-
// Lane View
|
70
|
-
func setLaneViewBackgroundColor(hexColor: String) {
|
71
|
-
controller.customDayStyle.customLaneViewBackgroundColor = UIColor(hex: hexColor)
|
72
|
-
controller.update()
|
73
|
-
}
|
74
|
-
|
75
|
-
func setLaneViewForegroundColor(hexColor: String) {
|
76
|
-
controller.customDayStyle.customLaneViewForegroundColor = UIColor(hex: hexColor)
|
77
|
-
controller.update()
|
78
|
-
}
|
79
|
-
|
80
|
-
func setLaneViewSeparatorColor(hexColor: String) {
|
81
|
-
controller.customDayStyle.customLaneViewSeparatorColor = UIColor(hex: hexColor)
|
82
|
-
controller.update()
|
83
|
-
}
|
84
|
-
|
85
|
-
// Next Banner View
|
86
|
-
func setNextBannerBackgroundColor(hexColor: String) {
|
87
|
-
controller.customDayStyle.customNextBannerBackgroundColor = UIColor(hex: hexColor)
|
88
|
-
controller.update()
|
89
|
-
}
|
90
|
-
|
91
|
-
func setNextBannerPrimaryTextColor(hexColor: String) {
|
92
|
-
controller.customDayStyle.customNextBannerPrimaryTextColor = UIColor(hex: hexColor)
|
93
|
-
controller.update()
|
94
|
-
}
|
95
|
-
|
96
|
-
func setNextBannerSecondaryTextColor(hexColor: String) {
|
97
|
-
controller.customDayStyle.customNextBannerSecondaryTextColor = UIColor(hex: hexColor)
|
98
|
-
controller.update()
|
99
|
-
}
|
100
|
-
|
101
|
-
func setNextBannerDistanceTextColor(hexColor: String) {
|
102
|
-
controller.customDayStyle.customNextBannerDistanceTextColor = UIColor(hex: hexColor)
|
103
|
-
controller.update()
|
104
|
-
}
|
105
|
-
|
106
|
-
// Progress Bar
|
107
|
-
func setProgressBarProgressColor(hexColor: String) {
|
108
|
-
controller.customDayStyle.customProgressBarProgressColor = UIColor(hex: hexColor)
|
109
|
-
controller.update()
|
110
|
-
}
|
111
|
-
|
112
|
-
func setProgressBarBackgroundColor(hexColor: String) {
|
113
|
-
controller.customDayStyle.customProgressBarBackgroundColor = UIColor(hex: hexColor)
|
114
|
-
controller.update()
|
115
|
-
}
|
116
|
-
|
117
|
-
// Instructions Card
|
118
|
-
func setInstructionsCardBackgroundColor(hexColor: String) {
|
119
|
-
controller.customDayStyle.customInstructionsCardBackgroundColor = UIColor(hex: hexColor)
|
120
|
-
controller.update()
|
121
|
-
}
|
122
|
-
|
123
|
-
func setInstructionsCardSeparatorColor(hexColor: String) {
|
124
|
-
controller.customDayStyle.customInstructionsCardSeparatorColor = UIColor(hex: hexColor)
|
125
|
-
controller.update()
|
126
|
-
}
|
127
|
-
|
128
|
-
func setInstructionsCardHighlightedSeparatorColor(hexColor: String) {
|
129
|
-
controller.customDayStyle.customInstructionsCardHighlightedSeparatorColor = UIColor(hex: hexColor)
|
130
|
-
controller.update()
|
131
|
-
}
|
132
|
-
|
133
|
-
// Exit View
|
134
|
-
func setExitViewForegroundColor(hexColor: String) {
|
135
|
-
controller.customDayStyle.customExitViewForegroundColor = UIColor(hex: hexColor)
|
136
|
-
controller.update()
|
137
|
-
}
|
138
|
-
|
139
|
-
func setExitViewBorderColor(hexColor: String) {
|
140
|
-
controller.customDayStyle.customExitViewBorderColor = UIColor(hex: hexColor)
|
141
|
-
controller.update()
|
142
|
-
}
|
143
|
-
|
144
|
-
func setExitViewHighlightColor(hexColor: String) {
|
145
|
-
controller.customDayStyle.customExitViewHighlightColor = UIColor(hex: hexColor)
|
146
|
-
controller.update()
|
147
|
-
}
|
148
|
-
|
149
|
-
// Route Shield
|
150
|
-
func setRouteShieldForegroundColor(hexColor: String) {
|
151
|
-
controller.customDayStyle.customRouteShieldForegroundColor = UIColor(hex: hexColor)
|
152
|
-
controller.update()
|
153
|
-
}
|
154
|
-
|
155
|
-
func setRouteShieldBorderColor(hexColor: String) {
|
156
|
-
controller.customDayStyle.customRouteShieldBorderColor = UIColor(hex: hexColor)
|
157
|
-
controller.update()
|
158
|
-
}
|
159
|
-
|
160
|
-
func setRouteShieldHighlightColor(hexColor: String) {
|
161
|
-
controller.customDayStyle.customRouteShieldHighlightColor = UIColor(hex: hexColor)
|
162
|
-
controller.update()
|
163
|
-
}
|
164
|
-
|
165
|
-
// Distance Labels
|
166
|
-
func setDistanceRemainingColor(hexColor: String) {
|
167
|
-
controller.customDayStyle.customDistanceRemainingColor = UIColor(hex: hexColor)
|
168
|
-
controller.update()
|
169
|
-
}
|
170
|
-
|
171
|
-
func setDistanceUnitColor(hexColor: String) {
|
172
|
-
controller.customDayStyle.customDistanceUnitColor = UIColor(hex: hexColor)
|
173
|
-
controller.update()
|
174
|
-
}
|
175
|
-
|
176
|
-
func setDistanceValueColor(hexColor: String) {
|
177
|
-
controller.customDayStyle.customDistanceValueColor = UIColor(hex: hexColor)
|
178
|
-
controller.update()
|
179
|
-
}
|
180
|
-
|
181
|
-
// Navigation Map
|
182
|
-
func setRouteAnnotationSelectedColor(hexColor: String) {
|
183
|
-
controller.customDayStyle.customRouteAnnotationSelectedColor = UIColor(hex: hexColor)
|
184
|
-
controller.update()
|
185
|
-
}
|
186
|
-
|
187
|
-
func setRouteAnnotationColor(hexColor: String) {
|
188
|
-
controller.customDayStyle.customRouteAnnotationColor = UIColor(hex: hexColor)
|
189
|
-
controller.update()
|
190
|
-
}
|
191
|
-
|
192
|
-
// Route Shield Colors
|
193
|
-
func setRoadShieldBlackColor(hexColor: String) {
|
194
|
-
controller.customDayStyle.customRoadShieldBlackColor = UIColor(hex: hexColor)
|
195
|
-
controller.update()
|
196
|
-
}
|
197
|
-
|
198
|
-
func setRoadShieldBlueColor(hexColor: String) {
|
199
|
-
controller.customDayStyle.customRoadShieldBlueColor = UIColor(hex: hexColor)
|
200
|
-
controller.update()
|
201
|
-
}
|
202
|
-
|
203
|
-
func setRoadShieldGreenColor(hexColor: String) {
|
204
|
-
controller.customDayStyle.customRoadShieldGreenColor = UIColor(hex: hexColor)
|
205
|
-
controller.update()
|
206
|
-
}
|
207
|
-
|
208
|
-
func setRoadShieldRedColor(hexColor: String) {
|
209
|
-
controller.customDayStyle.customRoadShieldRedColor = UIColor(hex: hexColor)
|
210
|
-
controller.update()
|
211
|
-
}
|
212
|
-
|
213
|
-
func setRoadShieldWhiteColor(hexColor: String) {
|
214
|
-
controller.customDayStyle.customRoadShieldWhiteColor = UIColor(hex: hexColor)
|
215
|
-
controller.update()
|
216
|
-
}
|
217
|
-
|
218
|
-
func setRoadShieldYellowColor(hexColor: String) {
|
219
|
-
controller.customDayStyle.customRoadShieldYellowColor = UIColor(hex: hexColor)
|
220
|
-
controller.update()
|
221
|
-
}
|
222
|
-
|
223
|
-
func setRoadShieldDefaultColor(hexColor: String) {
|
224
|
-
controller.customDayStyle.customRoadShieldDefaultColor = UIColor(hex: hexColor)
|
225
|
-
controller.update()
|
226
|
-
}
|
227
|
-
|
228
|
-
// Button Properties
|
229
|
-
func setButtonTextColor(hexColor: String) {
|
230
|
-
controller.customDayStyle.customButtonTextColor = UIColor(hex: hexColor)
|
231
|
-
controller.update()
|
232
|
-
}
|
233
|
-
|
234
|
-
func setCancelButtonTintColor(hexColor: String) {
|
235
|
-
controller.customDayStyle.customCancelButtonTintColor = UIColor(hex: hexColor)
|
236
|
-
controller.update()
|
237
|
-
}
|
238
|
-
|
239
|
-
func setPreviewButtonTintColor(hexColor: String) {
|
240
|
-
controller.customDayStyle.customPreviewButtonTintColor = UIColor(hex: hexColor)
|
241
|
-
controller.update()
|
242
|
-
}
|
243
|
-
|
244
|
-
func setStartButtonTintColor(hexColor: String) {
|
245
|
-
controller.customDayStyle.customStartButtonTintColor = UIColor(hex: hexColor)
|
246
|
-
controller.update()
|
247
|
-
}
|
248
|
-
|
249
|
-
func setDismissButtonBackgroundColor(hexColor: String) {
|
250
|
-
controller.customDayStyle.customDismissButtonBackgroundColor = UIColor(hex: hexColor)
|
251
|
-
controller.update()
|
252
|
-
}
|
253
|
-
|
254
|
-
func setDismissButtonTextColor(hexColor: String) {
|
255
|
-
controller.customDayStyle.customDismissButtonTextColor = UIColor(hex: hexColor)
|
256
|
-
controller.update()
|
257
|
-
}
|
258
|
-
|
259
|
-
func setBackButtonBackgroundColor(hexColor: String) {
|
260
|
-
controller.customDayStyle.customBackButtonBackgroundColor = UIColor(hex: hexColor)
|
261
|
-
controller.update()
|
262
|
-
}
|
263
|
-
|
264
|
-
func setBackButtonTintColor(hexColor: String) {
|
265
|
-
controller.customDayStyle.customBackButtonTintColor = UIColor(hex: hexColor)
|
266
|
-
controller.update()
|
267
|
-
}
|
268
|
-
|
269
|
-
func setBackButtonTextColor(hexColor: String) {
|
270
|
-
controller.customDayStyle.customBackButtonTextColor = UIColor(hex: hexColor)
|
271
|
-
controller.update()
|
272
|
-
}
|
273
|
-
|
274
|
-
func setBackButtonBorderColor(hexColor: String) {
|
275
|
-
controller.customDayStyle.customBackButtonBorderColor = UIColor(hex: hexColor)
|
276
|
-
controller.update()
|
277
|
-
}
|
278
|
-
|
279
|
-
// Navigation View
|
280
|
-
func setNavigationViewBackgroundColor(hexColor: String) {
|
281
|
-
controller.customDayStyle.customNavigationViewBackgroundColor = UIColor(hex: hexColor)
|
282
|
-
controller.update()
|
283
|
-
}
|
284
|
-
|
285
|
-
// Distance Label Properties
|
286
|
-
func setDistanceLabelUnitTextColor(hexColor: String) {
|
287
|
-
controller.customDayStyle.customDistanceLabelUnitTextColor = UIColor(hex: hexColor)
|
288
|
-
controller.update()
|
289
|
-
}
|
290
|
-
|
291
|
-
func setDistanceLabelValueTextColor(hexColor: String) {
|
292
|
-
controller.customDayStyle.customDistanceLabelValueTextColor = UIColor(hex: hexColor)
|
293
|
-
controller.update()
|
294
|
-
}
|
295
|
-
|
296
|
-
// Rating Control
|
297
|
-
func setRatingControlNormalColor(hexColor: String) {
|
298
|
-
controller.customDayStyle.customRatingControlNormalColor = UIColor(hex: hexColor)
|
299
|
-
controller.update()
|
300
|
-
}
|
301
|
-
|
302
|
-
func setRatingControlSelectedColor(hexColor: String) {
|
303
|
-
controller.customDayStyle.customRatingControlSelectedColor = UIColor(hex: hexColor)
|
304
|
-
controller.update()
|
305
|
-
}
|
306
|
-
|
307
|
-
// Steps Properties
|
308
|
-
func setStepsBackgroundViewColor(hexColor: String) {
|
309
|
-
controller.customDayStyle.customStepsBackgroundViewColor = UIColor(hex: hexColor)
|
310
|
-
controller.update()
|
311
|
-
}
|
312
|
-
|
313
|
-
func setStepsTableHeaderTintColor(hexColor: String) {
|
314
|
-
controller.customDayStyle.customStepsTableHeaderTintColor = UIColor(hex: hexColor)
|
315
|
-
controller.update()
|
316
|
-
}
|
317
|
-
|
318
|
-
func setStepsTableHeaderTextColor(hexColor: String) {
|
319
|
-
controller.customDayStyle.customStepsTableHeaderTextColor = UIColor(hex: hexColor)
|
320
|
-
controller.update()
|
321
|
-
}
|
322
|
-
|
323
|
-
func setStepInstructionsBackgroundColor(hexColor: String) {
|
324
|
-
controller.customDayStyle.customStepInstructionsBackgroundColor = UIColor(hex: hexColor)
|
325
|
-
controller.update()
|
326
|
-
}
|
327
|
-
|
328
|
-
func setStepTableViewCellBackgroundColor(hexColor: String) {
|
329
|
-
controller.customDayStyle.customStepTableViewCellBackgroundColor = UIColor(hex: hexColor)
|
330
|
-
controller.update()
|
331
|
-
}
|
332
|
-
|
333
|
-
// Next Instruction
|
334
|
-
func setNextInstructionNormalTextColor(hexColor: String) {
|
335
|
-
controller.customDayStyle.customNextInstructionNormalTextColor = UIColor(hex: hexColor)
|
336
|
-
controller.update()
|
337
|
-
}
|
338
|
-
|
339
|
-
func setNextInstructionContainedTextColor(hexColor: String) {
|
340
|
-
controller.customDayStyle.customNextInstructionContainedTextColor = UIColor(hex: hexColor)
|
341
|
-
controller.update()
|
342
|
-
}
|
343
|
-
|
344
|
-
// Secondary Label Properties
|
345
|
-
func setSecondaryLabelNormalTextColor(hexColor: String) {
|
346
|
-
controller.customDayStyle.customSecondaryLabelNormalTextColor = UIColor(hex: hexColor)
|
347
|
-
controller.update()
|
348
|
-
}
|
349
|
-
|
350
|
-
// Stylable Label
|
351
|
-
func setStylableLabelNormalTextColor(hexColor: String) {
|
352
|
-
controller.customDayStyle.customStylableLabelNormalTextColor = UIColor(hex: hexColor)
|
353
|
-
controller.update()
|
354
|
-
}
|
355
|
-
|
356
|
-
// CarPlay Properties
|
357
|
-
func setCarPlayCompassBackgroundColor(hexColor: String) {
|
358
|
-
controller.customDayStyle.customCarPlayCompassBackgroundColor = UIColor(hex: hexColor)
|
359
|
-
controller.update()
|
360
|
-
}
|
361
37
|
}
|
362
38
|
|
363
39
|
|
@@ -668,16 +344,6 @@ class ExpoMapboxNavigationViewController: UIViewController {
|
|
668
344
|
update()
|
669
345
|
}
|
670
346
|
|
671
|
-
func setManeuverViewPrimaryColorHighlighted(hexColor: String) {
|
672
|
-
customDayStyle.customManeuverViewPrimaryColorHighlighted = UIColor(hex: hexColor)
|
673
|
-
update()
|
674
|
-
}
|
675
|
-
|
676
|
-
func setManeuverViewSecondaryColorHighlighted(hexColor: String) {
|
677
|
-
customDayStyle.customManeuverViewSecondaryColorHighlighted = UIColor(hex: hexColor)
|
678
|
-
update()
|
679
|
-
}
|
680
|
-
|
681
347
|
func update(){
|
682
348
|
calculateRoutesTask?.cancel()
|
683
349
|
|
@@ -710,7 +376,7 @@ class ExpoMapboxNavigationViewController: UIViewController {
|
|
710
376
|
calculateRoutesTask = Task {
|
711
377
|
switch await self.routingProvider!.calculateRoutes(options: routeOptions).result {
|
712
378
|
case .failure(let error):
|
713
|
-
print(
|
379
|
+
print(error.localizedDescription)
|
714
380
|
case .success(let navigationRoutes):
|
715
381
|
onRoutesCalculated(navigationRoutes: navigationRoutes)
|
716
382
|
}
|
@@ -730,7 +396,7 @@ class ExpoMapboxNavigationViewController: UIViewController {
|
|
730
396
|
calculateRoutesTask = Task {
|
731
397
|
switch await self.routingProvider!.calculateRoutes(options: matchOptions).result {
|
732
398
|
case .failure(let error):
|
733
|
-
print(
|
399
|
+
print(error.localizedDescription)
|
734
400
|
case .success(let navigationRoutes):
|
735
401
|
onRoutesCalculated(navigationRoutes: navigationRoutes)
|
736
402
|
}
|