@jadamsbit/react-native-mapbox-navigation 1.0.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.
Files changed (117) hide show
  1. package/.gitattributes +1 -0
  2. package/CONTRIBUTING.md +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +357 -0
  5. package/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
  6. package/android/.gradle/7.3.3/checksums/md5-checksums.bin +0 -0
  7. package/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
  8. package/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
  9. package/android/.gradle/7.3.3/dependencies-accessors/gc.properties +0 -0
  10. package/android/.gradle/7.3.3/executionHistory/executionHistory.lock +0 -0
  11. package/android/.gradle/7.3.3/fileChanges/last-build.bin +0 -0
  12. package/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/7.3.3/gc.properties +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  16. package/android/.gradle/vcs-1/gc.properties +0 -0
  17. package/android/README.md +14 -0
  18. package/android/build.gradle +99 -0
  19. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  20. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  21. package/android/gradle.properties +4 -0
  22. package/android/gradlew +244 -0
  23. package/android/gradlew.bat +92 -0
  24. package/android/src/main/AndroidManifest.xml +4 -0
  25. package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationManager.kt +122 -0
  26. package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationPackage.kt +16 -0
  27. package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationView.kt +794 -0
  28. package/android/src/main/res/layout/navigation_view.xml +84 -0
  29. package/android/src/main/res/values/styles.xml +15 -0
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.js +12 -0
  32. package/dist/typings.d.ts +40 -0
  33. package/dist/typings.js +1 -0
  34. package/example/.buckconfig +6 -0
  35. package/example/.eslintrc.js +4 -0
  36. package/example/.flowconfig +65 -0
  37. package/example/.prettierrc.js +7 -0
  38. package/example/.watchmanconfig +1 -0
  39. package/example/App.js +51 -0
  40. package/example/Gemfile +6 -0
  41. package/example/Gemfile.lock +100 -0
  42. package/example/NavigationComponent.js +56 -0
  43. package/example/__tests__/App-test.js +14 -0
  44. package/example/_bundle/config +2 -0
  45. package/example/_ruby-version +1 -0
  46. package/example/android/.gradle/8.2/checksums/checksums.lock +0 -0
  47. package/example/android/.gradle/8.2/fileChanges/last-build.bin +0 -0
  48. package/example/android/.gradle/8.2/fileHashes/fileHashes.lock +0 -0
  49. package/example/android/.gradle/8.2/gc.properties +0 -0
  50. package/example/android/.gradle/vcs-1/gc.properties +0 -0
  51. package/example/android/app/_BUCK +55 -0
  52. package/example/android/app/build.gradle +232 -0
  53. package/example/android/app/build_defs.bzl +19 -0
  54. package/example/android/app/debug.keystore +0 -0
  55. package/example/android/app/proguard-rules.pro +10 -0
  56. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  57. package/example/android/app/src/debug/java/com/basicapp/ReactNativeFlipper.java +72 -0
  58. package/example/android/app/src/main/AndroidManifest.xml +30 -0
  59. package/example/android/app/src/main/java/com/basicapp/MainActivity.java +15 -0
  60. package/example/android/app/src/main/java/com/basicapp/MainApplication.java +81 -0
  61. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  62. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  63. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  64. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  65. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  66. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  67. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  68. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  69. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  70. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  71. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  72. package/example/android/app/src/main/res/values/strings.xml +3 -0
  73. package/example/android/app/src/main/res/values/styles.xml +9 -0
  74. package/example/android/build.gradle +55 -0
  75. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  76. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  77. package/example/android/gradle.properties +35 -0
  78. package/example/android/gradlew +185 -0
  79. package/example/android/gradlew.bat +89 -0
  80. package/example/android/settings.gradle +6 -0
  81. package/example/app.json +4 -0
  82. package/example/babel.config.js +24 -0
  83. package/example/index.js +9 -0
  84. package/example/ios/BasicApp/AppDelegate.h +8 -0
  85. package/example/ios/BasicApp/AppDelegate.m +62 -0
  86. package/example/ios/BasicApp/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
  87. package/example/ios/BasicApp/Images.xcassets/Contents.json +6 -0
  88. package/example/ios/BasicApp/Info.plist +62 -0
  89. package/example/ios/BasicApp/LaunchScreen.storyboard +47 -0
  90. package/example/ios/BasicApp/main.m +9 -0
  91. package/example/ios/BasicApp-Bridging-Header.h +4 -0
  92. package/example/ios/BasicApp.xcodeproj/project.pbxproj +690 -0
  93. package/example/ios/BasicApp.xcodeproj/xcshareddata/xcschemes/BasicApp.xcscheme +88 -0
  94. package/example/ios/BasicApp.xcworkspace/contents.xcworkspacedata +10 -0
  95. package/example/ios/BasicApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  96. package/example/ios/BasicAppTests/BasicAppTests.m +65 -0
  97. package/example/ios/BasicAppTests/Info.plist +24 -0
  98. package/example/ios/BridgeHeader.swift +8 -0
  99. package/example/ios/Podfile +44 -0
  100. package/example/ios/Podfile.lock +473 -0
  101. package/example/metro.config.js +45 -0
  102. package/example/package.json +31 -0
  103. package/img/bridging-header.png +0 -0
  104. package/img/build-setting-linking.png +0 -0
  105. package/img/build-setting-path.png +0 -0
  106. package/ios/MapboxNavigation-Bridging-Header.h +3 -0
  107. package/ios/MapboxNavigation.xcodeproj/project.pbxproj +290 -0
  108. package/ios/MapboxNavigation.xcworkspace/contents.xcworkspacedata +7 -0
  109. package/ios/MapboxNavigation.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  110. package/ios/MapboxNavigationManager.m +20 -0
  111. package/ios/MapboxNavigationManager.swift +10 -0
  112. package/ios/MapboxNavigationView.swift +163 -0
  113. package/package.json +33 -0
  114. package/react-native-mapbox-navigation.podspec +51 -0
  115. package/src/index.tsx +21 -0
  116. package/src/typings.ts +43 -0
  117. package/tsconfig.json +14 -0
@@ -0,0 +1,84 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:app="http://schemas.android.com/apk/res-auto"
4
+ android:layout_width="match_parent"
5
+ android:layout_height="match_parent">
6
+
7
+ <com.mapbox.maps.MapView
8
+ android:id="@+id/mapView"
9
+ android:layout_width="0dp"
10
+ android:layout_height="0dp"
11
+ app:layout_constraintBottom_toBottomOf="parent"
12
+ app:layout_constraintEnd_toEndOf="parent"
13
+ app:layout_constraintStart_toStartOf="parent"
14
+ app:layout_constraintTop_toTopOf="parent" />
15
+
16
+ <androidx.cardview.widget.CardView
17
+ android:id="@+id/tripProgressCard"
18
+ android:layout_width="0dp"
19
+ android:layout_height="80dp"
20
+ android:visibility="invisible"
21
+ app:cardElevation="8dp"
22
+ app:cardUseCompatPadding="false"
23
+ app:layout_constraintBottom_toBottomOf="parent"
24
+ app:layout_constraintEnd_toEndOf="parent"
25
+ app:layout_constraintStart_toStartOf="parent">
26
+
27
+ <com.mapbox.navigation.ui.tripprogress.view.MapboxTripProgressView
28
+ android:id="@+id/tripProgressView"
29
+ android:layout_width="wrap_content"
30
+ android:layout_height="wrap_content"
31
+ android:layout_gravity="fill|left"
32
+ android:layout_marginStart="16dp"
33
+ android:layout_marginTop="8dp" />
34
+
35
+ <ImageView
36
+ android:id="@+id/stop"
37
+ android:layout_width="48dp"
38
+ android:layout_height="48dp"
39
+ android:layout_gravity="right|center_vertical"
40
+ android:layout_marginEnd="12dp"
41
+ app:srcCompat="@android:drawable/ic_delete"
42
+ app:tint="@android:color/darker_gray" />
43
+ </androidx.cardview.widget.CardView>
44
+
45
+ <com.mapbox.navigation.ui.maneuver.view.MapboxManeuverView
46
+ android:id="@+id/maneuverView"
47
+ android:layout_width="0dp"
48
+ android:layout_height="90dp"
49
+ android:layout_margin="4dp"
50
+ android:visibility="invisible"
51
+ app:layout_constraintEnd_toEndOf="parent"
52
+ app:layout_constraintStart_toStartOf="parent"
53
+ app:layout_constraintTop_toTopOf="parent" />
54
+
55
+ <com.mapbox.navigation.ui.voice.view.MapboxSoundButton
56
+ android:id="@+id/soundButton"
57
+ android:layout_width="wrap_content"
58
+ android:layout_height="wrap_content"
59
+ android:layout_marginTop="8dp"
60
+ android:layout_marginEnd="16dp"
61
+ android:visibility="invisible"
62
+ app:layout_constraintEnd_toEndOf="parent"
63
+ app:layout_constraintTop_toBottomOf="@id/maneuverView" />
64
+
65
+ <com.mapbox.navigation.ui.maps.camera.view.MapboxRouteOverviewButton
66
+ android:id="@+id/routeOverview"
67
+ android:layout_width="wrap_content"
68
+ android:layout_height="wrap_content"
69
+ android:layout_marginTop="8dp"
70
+ android:layout_marginEnd="16dp"
71
+ android:visibility="invisible"
72
+ app:layout_constraintEnd_toEndOf="parent"
73
+ app:layout_constraintTop_toBottomOf="@id/soundButton" />
74
+
75
+ <com.mapbox.navigation.ui.maps.camera.view.MapboxRecenterButton
76
+ android:id="@+id/recenter"
77
+ android:layout_width="wrap_content"
78
+ android:layout_height="wrap_content"
79
+ android:layout_marginTop="8dp"
80
+ android:layout_marginEnd="16dp"
81
+ app:layout_constraintEnd_toEndOf="parent"
82
+ app:layout_constraintTop_toBottomOf="@id/routeOverview" />
83
+
84
+ </androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,15 @@
1
+ <resources>
2
+ <style name="PrimaryManeuverTextAppearance" parent="TextAppearance.AppCompat">
3
+ <item name="android:textColor">#FFFFFF</item>
4
+ <item name="android:textStyle">bold</item>
5
+ <item name="android:textSize">30sp</item>
6
+ </style>
7
+ <style name="ManeuverTextAppearance" parent="TextAppearance.AppCompat">
8
+ <item name="android:textColor">#FFFFFF</item>
9
+ <item name="android:textSize">25sp</item>
10
+ </style>
11
+ <style name="StepDistanceRemainingAppearance" parent="TextAppearance.AppCompat">
12
+ <item name="android:textColor">#FFFFFF</item>
13
+ <item name="android:textSize">21sp</item>
14
+ </style>
15
+ </resources>
@@ -0,0 +1,3 @@
1
+ import { IMapboxNavigationProps } from './typings';
2
+ declare const MapboxNavigation: (props: IMapboxNavigationProps) => any;
3
+ export default MapboxNavigation;
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { requireNativeComponent, StyleSheet } from 'react-native';
3
+ const MapboxNavigation = (props) => {
4
+ return <RNMapboxNavigation style={styles.container} {...props}/>;
5
+ };
6
+ const RNMapboxNavigation = requireNativeComponent('MapboxNavigation', MapboxNavigation);
7
+ const styles = StyleSheet.create({
8
+ container: {
9
+ flex: 1,
10
+ },
11
+ });
12
+ export default MapboxNavigation;
@@ -0,0 +1,40 @@
1
+ /** @type {[number, number]}
2
+ * Provide an array with longitude and latitude [$longitude, $latitude]
3
+ */
4
+ declare type Coordinate = [number, number];
5
+ declare type OnLocationChangeEvent = {
6
+ nativeEvent?: {
7
+ latitude: number;
8
+ longitude: number;
9
+ };
10
+ };
11
+ declare type OnRouteProgressChangeEvent = {
12
+ nativeEvent?: {
13
+ distanceTraveled: number;
14
+ durationRemaining: number;
15
+ fractionTraveled: number;
16
+ distanceRemaining: number;
17
+ };
18
+ };
19
+ declare type OnErrorEvent = {
20
+ nativeEvent?: {
21
+ message?: string;
22
+ };
23
+ };
24
+ export interface IMapboxNavigationProps {
25
+ origin: Coordinate;
26
+ destination: Coordinate;
27
+ shouldSimulateRoute?: boolean;
28
+ onLocationChange?: (event: OnLocationChangeEvent) => void;
29
+ onRouteProgressChange?: (event: OnRouteProgressChangeEvent) => void;
30
+ onError?: (event: OnErrorEvent) => void;
31
+ onCancelNavigation?: () => void;
32
+ onArrive?: () => void;
33
+ showsEndOfRouteFeedback?: boolean;
34
+ hideStatusView?: boolean;
35
+ mute?: boolean;
36
+ waypoints?: Coordinate[];
37
+ vehicleMaxHeight?: number;
38
+ vehicleMaxWidth?: number;
39
+ }
40
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+
2
+ [android]
3
+ target = Google Inc.:Google APIs:23
4
+
5
+ [maven_repositories]
6
+ central = https://repo1.maven.org/maven2
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native-community',
4
+ };
@@ -0,0 +1,65 @@
1
+ [ignore]
2
+ ; We fork some components by platform
3
+ .*/*[.]android.js
4
+
5
+ ; Ignore "BUCK" generated dirs
6
+ <PROJECT_ROOT>/\.buckd/
7
+
8
+ ; Ignore polyfills
9
+ node_modules/react-native/Libraries/polyfills/.*
10
+
11
+ ; Flow doesn't support platforms
12
+ .*/Libraries/Utilities/LoadingView.js
13
+
14
+ [untyped]
15
+ .*/node_modules/@react-native-community/cli/.*/.*
16
+
17
+ [include]
18
+
19
+ [libs]
20
+ node_modules/react-native/interface.js
21
+ node_modules/react-native/flow/
22
+
23
+ [options]
24
+ emoji=true
25
+
26
+ exact_by_default=true
27
+
28
+ format.bracket_spacing=false
29
+
30
+ module.file_ext=.js
31
+ module.file_ext=.json
32
+ module.file_ext=.ios.js
33
+
34
+ munge_underscores=true
35
+
36
+ module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
37
+ module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
38
+
39
+ suppress_type=$FlowIssue
40
+ suppress_type=$FlowFixMe
41
+ suppress_type=$FlowFixMeProps
42
+ suppress_type=$FlowFixMeState
43
+
44
+ [lints]
45
+ sketchy-null-number=warn
46
+ sketchy-null-mixed=warn
47
+ sketchy-number=warn
48
+ untyped-type-import=warn
49
+ nonstrict-import=warn
50
+ deprecated-type=warn
51
+ unsafe-getters-setters=warn
52
+ unnecessary-invariant=warn
53
+ signature-verification-failure=warn
54
+
55
+ [strict]
56
+ deprecated-type
57
+ nonstrict-import
58
+ sketchy-null
59
+ unclear-type
60
+ unsafe-getters-setters
61
+ untyped-import
62
+ untyped-type-import
63
+
64
+ [version]
65
+ ^0.158.0
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ bracketSpacing: false,
3
+ jsxBracketSameLine: true,
4
+ singleQuote: true,
5
+ trailingComma: 'all',
6
+ arrowParens: 'avoid',
7
+ };
@@ -0,0 +1 @@
1
+ {}
package/example/App.js ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Sample React Native App
3
+ * https://github.com/facebook/react-native
4
+ *
5
+ * @format
6
+ * @flow strict-local
7
+ */
8
+
9
+ import React, {useEffect} from 'react';
10
+ import {SafeAreaView, useColorScheme} from 'react-native';
11
+ import {Colors} from 'react-native/Libraries/NewAppScreen';
12
+ import NavigationComponent from './NavigationComponent';
13
+ import {PermissionsAndroid} from 'react-native';
14
+
15
+ const App = () => {
16
+ const isDarkMode = useColorScheme() === 'dark';
17
+
18
+ const backgroundStyle = {
19
+ backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
20
+ flex: 1,
21
+ };
22
+
23
+ useEffect(() => {
24
+ const requestLocationPermission = async () => {
25
+ try {
26
+ await PermissionsAndroid.request(
27
+ PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
28
+ {
29
+ title: 'Example App',
30
+ message: 'Example App access to your location ',
31
+ },
32
+ );
33
+ } catch (err) {
34
+ console.warn(err);
35
+ }
36
+ };
37
+
38
+ requestLocationPermission();
39
+ }, []);
40
+
41
+ return (
42
+ <SafeAreaView style={backgroundStyle}>
43
+ <NavigationComponent
44
+ origin={[-105.140629, 39.760194]}
45
+ destination={[-105.156544, 39.761801]}
46
+ />
47
+ </SafeAreaView>
48
+ );
49
+ };
50
+
51
+ export default App;
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby '2.7.4'
5
+
6
+ gem 'cocoapods', '~> 1.11', '>= 1.11.2'
@@ -0,0 +1,100 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ CFPropertyList (3.0.5)
5
+ rexml
6
+ activesupport (6.1.4.4)
7
+ concurrent-ruby (~> 1.0, >= 1.0.2)
8
+ i18n (>= 1.6, < 2)
9
+ minitest (>= 5.1)
10
+ tzinfo (~> 2.0)
11
+ zeitwerk (~> 2.3)
12
+ addressable (2.8.0)
13
+ public_suffix (>= 2.0.2, < 5.0)
14
+ algoliasearch (1.27.5)
15
+ httpclient (~> 2.8, >= 2.8.3)
16
+ json (>= 1.5.1)
17
+ atomos (0.1.3)
18
+ claide (1.1.0)
19
+ cocoapods (1.11.2)
20
+ addressable (~> 2.8)
21
+ claide (>= 1.0.2, < 2.0)
22
+ cocoapods-core (= 1.11.2)
23
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
24
+ cocoapods-downloader (>= 1.4.0, < 2.0)
25
+ cocoapods-plugins (>= 1.0.0, < 2.0)
26
+ cocoapods-search (>= 1.0.0, < 2.0)
27
+ cocoapods-trunk (>= 1.4.0, < 2.0)
28
+ cocoapods-try (>= 1.1.0, < 2.0)
29
+ colored2 (~> 3.1)
30
+ escape (~> 0.0.4)
31
+ fourflusher (>= 2.3.0, < 3.0)
32
+ gh_inspector (~> 1.0)
33
+ molinillo (~> 0.8.0)
34
+ nap (~> 1.0)
35
+ ruby-macho (>= 1.0, < 3.0)
36
+ xcodeproj (>= 1.21.0, < 2.0)
37
+ cocoapods-core (1.11.2)
38
+ activesupport (>= 5.0, < 7)
39
+ addressable (~> 2.8)
40
+ algoliasearch (~> 1.0)
41
+ concurrent-ruby (~> 1.1)
42
+ fuzzy_match (~> 2.0.4)
43
+ nap (~> 1.0)
44
+ netrc (~> 0.11)
45
+ public_suffix (~> 4.0)
46
+ typhoeus (~> 1.0)
47
+ cocoapods-deintegrate (1.0.5)
48
+ cocoapods-downloader (1.5.1)
49
+ cocoapods-plugins (1.0.0)
50
+ nap
51
+ cocoapods-search (1.0.1)
52
+ cocoapods-trunk (1.6.0)
53
+ nap (>= 0.8, < 2.0)
54
+ netrc (~> 0.11)
55
+ cocoapods-try (1.2.0)
56
+ colored2 (3.1.2)
57
+ concurrent-ruby (1.1.9)
58
+ escape (0.0.4)
59
+ ethon (0.15.0)
60
+ ffi (>= 1.15.0)
61
+ ffi (1.15.5)
62
+ fourflusher (2.3.1)
63
+ fuzzy_match (2.0.4)
64
+ gh_inspector (1.1.3)
65
+ httpclient (2.8.3)
66
+ i18n (1.8.11)
67
+ concurrent-ruby (~> 1.0)
68
+ json (2.6.1)
69
+ minitest (5.15.0)
70
+ molinillo (0.8.0)
71
+ nanaimo (0.3.0)
72
+ nap (1.1.0)
73
+ netrc (0.11.0)
74
+ public_suffix (4.0.6)
75
+ rexml (3.2.5)
76
+ ruby-macho (2.5.1)
77
+ typhoeus (1.4.0)
78
+ ethon (>= 0.9.0)
79
+ tzinfo (2.0.4)
80
+ concurrent-ruby (~> 1.0)
81
+ xcodeproj (1.21.0)
82
+ CFPropertyList (>= 2.3.3, < 4.0)
83
+ atomos (~> 0.1.3)
84
+ claide (>= 1.0.2, < 2.0)
85
+ colored2 (~> 3.1)
86
+ nanaimo (~> 0.3.0)
87
+ rexml (~> 3.2.4)
88
+ zeitwerk (2.5.3)
89
+
90
+ PLATFORMS
91
+ ruby
92
+
93
+ DEPENDENCIES
94
+ cocoapods (~> 1.11, >= 1.11.2)
95
+
96
+ RUBY VERSION
97
+ ruby 2.7.4p191
98
+
99
+ BUNDLED WITH
100
+ 2.2.27
@@ -0,0 +1,56 @@
1
+ /* eslint-disable comma-dangle */
2
+ import React from 'react';
3
+ import {StyleSheet, View} from 'react-native';
4
+ import MapboxNavigation from '@jadamsbit/react-native-mapbox-navigation';
5
+
6
+ const Navigation = props => {
7
+ const {origin, destination} = props;
8
+
9
+ return (
10
+ <View style={styles.container}>
11
+ <View style={styles.mapContainer}>
12
+ <MapboxNavigation
13
+ showsEndOfRouteFeedback={true}
14
+ shouldSimulateRoute={true}
15
+ origin={origin}
16
+ destination={destination}
17
+ showsEndOfRouteFeedback={false}
18
+ hideStatusView
19
+ onLocationChange={event => {
20
+ console.log('onLocationChange', event.nativeEvent);
21
+ }}
22
+ onRouteProgressChange={event => {
23
+ console.log('onRouteProgressChange', event.nativeEvent);
24
+ }}
25
+ onError={event => {
26
+ const {message} = event.nativeEvent;
27
+ // eslint-disable-next-line no-alert
28
+ alert(message);
29
+ }}
30
+ onArrive={() => {
31
+ // eslint-disable-next-line no-alert
32
+ alert('You have reached your destination');
33
+ }}
34
+ onCancelNavigation={event => {
35
+ alert('Cancelled navigation event');
36
+ }}
37
+ />
38
+ </View>
39
+ </View>
40
+ );
41
+ };
42
+
43
+ const styles = StyleSheet.create({
44
+ container: {
45
+ flex: 1,
46
+ display: 'flex',
47
+ flexDirection: 'column',
48
+ justifyContent: 'space-between',
49
+ height: '100%',
50
+ },
51
+ mapContainer: {
52
+ flex: 1,
53
+ },
54
+ });
55
+
56
+ export default Navigation;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import 'react-native';
6
+ import React from 'react';
7
+ import App from '../App';
8
+
9
+ // Note: test renderer must be required after react-native.
10
+ import renderer from 'react-test-renderer';
11
+
12
+ it('renders correctly', () => {
13
+ renderer.create(<App />);
14
+ });
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
@@ -0,0 +1 @@
1
+ 2.7.4
File without changes
File without changes
@@ -0,0 +1,55 @@
1
+ # To learn about Buck see [Docs](https://buckbuild.com/).
2
+ # To run your application with Buck:
3
+ # - install Buck
4
+ # - `npm start` - to start the packager
5
+ # - `cd android`
6
+ # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7
+ # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8
+ # - `buck install -r android/app` - compile, install and run application
9
+ #
10
+
11
+ load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12
+
13
+ lib_deps = []
14
+
15
+ create_aar_targets(glob(["libs/*.aar"]))
16
+
17
+ create_jar_targets(glob(["libs/*.jar"]))
18
+
19
+ android_library(
20
+ name = "all-libs",
21
+ exported_deps = lib_deps,
22
+ )
23
+
24
+ android_library(
25
+ name = "app-code",
26
+ srcs = glob([
27
+ "src/main/java/**/*.java",
28
+ ]),
29
+ deps = [
30
+ ":all-libs",
31
+ ":build_config",
32
+ ":res",
33
+ ],
34
+ )
35
+
36
+ android_build_config(
37
+ name = "build_config",
38
+ package = "com.basicapp",
39
+ )
40
+
41
+ android_resource(
42
+ name = "res",
43
+ package = "com.basicapp",
44
+ res = "src/main/res",
45
+ )
46
+
47
+ android_binary(
48
+ name = "app",
49
+ keystore = "//android/keystores:debug",
50
+ manifest = "src/main/AndroidManifest.xml",
51
+ package_type = "debug",
52
+ deps = [
53
+ ":app-code",
54
+ ],
55
+ )