@complexify/expo-mapbox-navigation 1.0.8 → 1.0.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoMapboxNavigation.types.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewStyle, StyleProp } from \"react-native/types\";\n\ntype ProgressEvent = {\n distanceRemaining: number;\n distanceTraveled: number;\n durationRemaining: number;\n fractionTraveled: number;\n};\n\nexport type ExpoMapboxNavigationViewProps = {\n coordinates: Array<{ latitude: number; longitude: number }>;\n waypointIndices?: number[];\n useRouteMatchingApi?: boolean;\n locale?: string;\n routeProfile?: string;\n routeExcludeList?: string[];\n mapStyle?: string;\n mute?: boolean;\n routeColor?: string;\n routeAlternateColor?: string;\n routeCasingColor?: string;\n routeAlternateCasingColor?: string;\n traversedRouteColor?: string;\n maneuverArrowColor?: string;\n onRouteProgressChanged?: (event: { nativeEvent: ProgressEvent }) => void;\n onCancelNavigation?: () => void;\n onWaypointArrival?: (event: {\n nativeEvent: ProgressEvent | undefined;\n }) => void;\n onFinalDestinationArrival?: () => void;\n onRouteChanged?: () => void;\n onUserOffRoute?: () => void;\n onRoutesLoaded?: () => void;\n style?: StyleProp<ViewStyle>;\n \n // Top Banner (1)\n topBannerBackgroundColor?: string;\n topBannerPrimaryTextColor?: string;\n topBannerSecondaryTextColor?: string;\n topBannerDistanceTextColor?: string;\n topBannerSeparatorColor?: string;\n\n // Information Stack (2)\n informationStackBackgroundColor?: string;\n informationStackTextColor?: string;\n\n // Bottom Banner (3)\n bottomBannerBackgroundColor?: string;\n bottomBannerTimeRemainingTextColor?: string;\n bottomBannerDistanceRemainingTextColor?: string;\n bottomBannerArrivalTimeTextColor?: string;\n\n // Resume Button (4)\n resumeButtonBackgroundColor?: string;\n resumeButtonTextColor?: string;\n\n // Speed Limit View (5)\n speedLimitBackgroundColor?: string;\n speedLimitTextColor?: string;\n\n // Floating Stack (6)\n floatingStackBackgroundColor?: string;\n floatingButtonsBackgroundColor?: string;\n\n // Way Name Label (8)\n wayNameViewBackgroundColor?: string;\n wayNameViewTextColor?: string;\n};\n"]}
1
+ {"version":3,"file":"ExpoMapboxNavigation.types.js","sourceRoot":"","sources":["../src/ExpoMapboxNavigation.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ViewStyle, StyleProp } from \"react-native/types\";\n\ntype ProgressEvent = {\n distanceRemaining: number;\n distanceTraveled: number;\n durationRemaining: number;\n fractionTraveled: number;\n};\n\nexport type ExpoMapboxNavigationViewProps = {\n coordinates: Array<{ latitude: number; longitude: number }>;\n waypointIndices?: number[];\n useRouteMatchingApi?: boolean;\n locale?: string;\n routeProfile?: string;\n routeExcludeList?: string[];\n mapStyle?: string;\n mute?: boolean;\n routeColor?: string;\n routeAlternateColor?: string;\n routeCasingColor?: string;\n routeAlternateCasingColor?: string;\n traversedRouteColor?: string;\n maneuverArrowColor?: string;\n onRouteProgressChanged?: (event: { nativeEvent: ProgressEvent }) => void;\n onCancelNavigation?: () => void;\n onWaypointArrival?: (event: {\n nativeEvent: ProgressEvent | undefined;\n }) => void;\n onFinalDestinationArrival?: () => void;\n onRouteChanged?: () => void;\n onUserOffRoute?: () => void;\n onRoutesLoaded?: () => void;\n style?: StyleProp<ViewStyle>;\n\n // Top Banner (1)\n topBannerBackgroundColor?: string;\n topBannerPrimaryTextColor?: string;\n topBannerSecondaryTextColor?: string;\n topBannerDistanceTextColor?: string;\n topBannerSeparatorColor?: string;\n\n // Information Stack (2)\n informationStackBackgroundColor?: string;\n informationStackTextColor?: string;\n\n // Bottom Banner (3)\n bottomBannerBackgroundColor?: string;\n bottomBannerTimeRemainingTextColor?: string;\n bottomBannerDistanceRemainingTextColor?: string;\n bottomBannerArrivalTimeTextColor?: string;\n\n // Resume Button (4)\n resumeButtonBackgroundColor?: string;\n resumeButtonTextColor?: string;\n\n // Speed Limit View (5)\n speedLimitBackgroundColor?: string;\n speedLimitTextColor?: string;\n\n // Floating Stack (6)\n floatingStackBackgroundColor?: string;\n floatingButtonsBackgroundColor?: string;\n\n // Way Name Label (8)\n wayNameViewBackgroundColor?: string;\n wayNameViewTextColor?: string;\n};\n"]}
@@ -137,6 +137,66 @@ public class ExpoMapboxNavigationModule: Module {
137
137
  view.controller.setBottomBannerArrivalTimeTextColor(hexColor: hexColor)
138
138
  }
139
139
  }
140
+
141
+ Prop("informationStackBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
142
+ if let hexColor = color {
143
+ view.controller.setInformationStackBackgroundColor(hexColor: hexColor)
144
+ }
145
+ }
146
+
147
+ Prop("informationStackTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
148
+ if let hexColor = color {
149
+ view.controller.setInformationStackTextColor(hexColor: hexColor)
150
+ }
151
+ }
152
+
153
+ Prop("floatingStackBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
154
+ if let hexColor = color {
155
+ view.controller.setFloatingStackBackgroundColor(hexColor: hexColor)
156
+ }
157
+ }
158
+
159
+ Prop("floatingButtonsBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
160
+ if let hexColor = color {
161
+ view.controller.setFloatingButtonsBackgroundColor(hexColor: hexColor)
162
+ }
163
+ }
164
+
165
+ Prop("speedLimitBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
166
+ if let hexColor = color {
167
+ view.controller.setSpeedLimitBackgroundColor(hexColor: hexColor)
168
+ }
169
+ }
170
+
171
+ Prop("speedLimitTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
172
+ if let hexColor = color {
173
+ view.controller.setSpeedLimitTextColor(hexColor: hexColor)
174
+ }
175
+ }
176
+
177
+ Prop("wayNameViewBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
178
+ if let hexColor = color {
179
+ view.controller.setWayNameViewBackgroundColor(hexColor: hexColor)
180
+ }
181
+ }
182
+
183
+ Prop("wayNameViewTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
184
+ if let hexColor = color {
185
+ view.controller.setWayNameViewTextColor(hexColor: hexColor)
186
+ }
187
+ }
188
+
189
+ Prop("resumeButtonBackgroundColor") { (view: ExpoMapboxNavigationView, color: String?) in
190
+ if let hexColor = color {
191
+ view.controller.setResumeButtonBackgroundColor(hexColor: hexColor)
192
+ }
193
+ }
194
+
195
+ Prop("resumeButtonTextColor") { (view: ExpoMapboxNavigationView, color: String?) in
196
+ if let hexColor = color {
197
+ view.controller.setResumeButtonTextColor(hexColor: hexColor)
198
+ }
199
+ }
140
200
  }
141
201
  }
142
202
  }
@@ -84,6 +84,17 @@ class ExpoMapboxNavigationViewController: UIViewController {
84
84
  var currentBottomBannerDistanceRemainingTextColor: UIColor?
85
85
  var currentBottomBannerArrivalTimeTextColor: UIColor?
86
86
 
87
+ var currentInformationStackBackgroundColor: UIColor?
88
+ var currentInformationStackTextColor: UIColor?
89
+ var currentFloatingStackBackgroundColor: UIColor?
90
+ var currentFloatingButtonsBackgroundColor: UIColor?
91
+ var currentSpeedLimitBackgroundColor: UIColor?
92
+ var currentSpeedLimitTextColor: UIColor?
93
+ var currentWayNameViewBackgroundColor: UIColor?
94
+ var currentWayNameViewTextColor: UIColor?
95
+ var currentResumeButtonBackgroundColor: UIColor?
96
+ var currentResumeButtonTextColor: UIColor?
97
+
87
98
  init() {
88
99
  super.init(nibName: nil, bundle: nil)
89
100
  mapboxNavigation = ExpoMapboxNavigationViewController.navigationProvider.mapboxNavigation
@@ -259,6 +270,56 @@ class ExpoMapboxNavigationViewController: UIViewController {
259
270
  currentBottomBannerArrivalTimeTextColor = UIColor(hex: hexColor)
260
271
  }
261
272
 
273
+ func setInformationStackBackgroundColor(hexColor: String) {
274
+ currentInformationStackBackgroundColor = UIColor(hex: hexColor)
275
+ // Apply color in onRoutesCalculated
276
+ }
277
+
278
+ func setInformationStackTextColor(hexColor: String) {
279
+ currentInformationStackTextColor = UIColor(hex: hexColor)
280
+ // Apply color in onRoutesCalculated
281
+ }
282
+
283
+ func setFloatingStackBackgroundColor(hexColor: String) {
284
+ currentFloatingStackBackgroundColor = UIColor(hex: hexColor)
285
+ // Apply color in onRoutesCalculated
286
+ }
287
+
288
+ func setFloatingButtonsBackgroundColor(hexColor: String) {
289
+ currentFloatingButtonsBackgroundColor = UIColor(hex: hexColor)
290
+ // Apply color in onRoutesCalculated
291
+ }
292
+
293
+ func setSpeedLimitBackgroundColor(hexColor: String) {
294
+ currentSpeedLimitBackgroundColor = UIColor(hex: hexColor)
295
+ // Apply color in onRoutesCalculated
296
+ }
297
+
298
+ func setSpeedLimitTextColor(hexColor: String) {
299
+ currentSpeedLimitTextColor = UIColor(hex: hexColor)
300
+ // Apply color in onRoutesCalculated
301
+ }
302
+
303
+ func setWayNameViewBackgroundColor(hexColor: String) {
304
+ currentWayNameViewBackgroundColor = UIColor(hex: hexColor)
305
+ // Apply color in onRoutesCalculated
306
+ }
307
+
308
+ func setWayNameViewTextColor(hexColor: String) {
309
+ currentWayNameViewTextColor = UIColor(hex: hexColor)
310
+ // Apply color in onRoutesCalculated
311
+ }
312
+
313
+ func setResumeButtonBackgroundColor(hexColor: String) {
314
+ currentResumeButtonBackgroundColor = UIColor(hex: hexColor)
315
+ // Apply color in onRoutesCalculated
316
+ }
317
+
318
+ func setResumeButtonTextColor(hexColor: String) {
319
+ currentResumeButtonTextColor = UIColor(hex: hexColor)
320
+ // Apply color in onRoutesCalculated
321
+ }
322
+
262
323
  func update(){
263
324
  calculateRoutesTask?.cancel()
264
325
 
@@ -423,6 +484,19 @@ class ExpoMapboxNavigationViewController: UIViewController {
423
484
  if let arrowColor = currentManeuverArrowColor {
424
485
  navigationMapView?.maneuverArrowColor = arrowColor
425
486
  }
487
+
488
+ // Apply custom colors to UI elements
489
+ if let backgroundColor = currentInformationStackBackgroundColor {
490
+ // Apply to information stack background
491
+ navigationViewController.navigationView.informationStackView?.backgroundColor = backgroundColor
492
+ }
493
+
494
+ if let textColor = currentInformationStackTextColor {
495
+ // Apply to information stack text
496
+ navigationViewController.navigationView.informationStackView?.tintColor = textColor
497
+ }
498
+
499
+ // Apply other custom colors similarly...
426
500
  }
427
501
  }
428
502
  extension ExpoMapboxNavigationViewController: NavigationViewControllerDelegate {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@complexify/expo-mapbox-navigation",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Expo module for Mapbox's Navigation SDK",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -32,7 +32,7 @@ export type ExpoMapboxNavigationViewProps = {
32
32
  onUserOffRoute?: () => void;
33
33
  onRoutesLoaded?: () => void;
34
34
  style?: StyleProp<ViewStyle>;
35
-
35
+
36
36
  // Top Banner (1)
37
37
  topBannerBackgroundColor?: string;
38
38
  topBannerPrimaryTextColor?: string;