@jadamsbit/react-native-mapbox-navigation 1.0.18 → 1.0.20
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.
- package/.vscode/settings.json +3 -0
- package/.yarn/releases/yarn-3.6.1.cjs +0 -0
- package/android/.classpath +6 -0
- package/android/.project +34 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/.settings/org.eclipse.jdt.core.prefs +4 -0
- package/android/build.gradle +1 -1
- package/android/gradlew +0 -0
- package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationModule.kt +47 -22
- package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationView.kt +268 -406
- package/android/src/main/res/layout/navigation_view.xml +16 -6
- package/package.json +2 -2
- package/react-native-mapbox-navigation.podspec +1 -1
- package/.github/actions/setup/action.yml +0 -27
- package/.github/workflows/ci.yml +0 -154
- package/example/.buckconfig +0 -6
- package/example/.bundle/config +0 -2
- package/example/.eslintrc.js +0 -4
- package/example/.flowconfig +0 -65
- package/example/.prettierrc.js +0 -7
- package/example/.watchmanconfig +0 -1
- package/example/Gemfile +0 -9
- package/example/NavigationComponent.js +0 -55
- package/example/README.md +0 -79
- package/example/android/app/build.gradle +0 -119
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +0 -10
- package/example/android/app/src/debug/AndroidManifest.xml +0 -9
- package/example/android/app/src/main/AndroidManifest.xml +0 -26
- package/example/android/app/src/main/java/com/mapboxnavigationexample/MainActivity.kt +0 -22
- package/example/android/app/src/main/java/com/mapboxnavigationexample/MainApplication.kt +0 -45
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +0 -3
- package/example/android/app/src/main/res/values/styles.xml +0 -9
- package/example/android/build.gradle +0 -39
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/example/android/gradle.properties +0 -46
- package/example/android/gradlew +0 -249
- package/example/android/gradlew.bat +0 -92
- package/example/android/settings.gradle +0 -6
- package/example/app.json +0 -4
- package/example/babel.config.js +0 -17
- package/example/index.js +0 -5
- package/example/ios/.xcode.env +0 -1
- package/example/ios/.xcode.env.local +0 -2
- package/example/ios/BasicApp/AppDelegate.h +0 -8
- package/example/ios/BasicApp/AppDelegate.m +0 -62
- package/example/ios/BasicApp/Images.xcassets/AppIcon.appiconset/Contents.json +0 -38
- package/example/ios/BasicApp/Images.xcassets/Contents.json +0 -6
- package/example/ios/BasicApp/Info.plist +0 -62
- package/example/ios/BasicApp/LaunchScreen.storyboard +0 -47
- package/example/ios/BasicApp/main.m +0 -9
- package/example/ios/BasicApp-Bridging-Header.h +0 -4
- package/example/ios/BasicApp.xcodeproj/project.pbxproj +0 -716
- package/example/ios/BasicApp.xcodeproj/xcshareddata/xcschemes/BasicApp.xcscheme +0 -88
- package/example/ios/BasicApp.xcworkspace/contents.xcworkspacedata +0 -10
- package/example/ios/BasicApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/example/ios/BasicAppTests/BasicAppTests.m +0 -65
- package/example/ios/BasicAppTests/Info.plist +0 -24
- package/example/ios/BridgeHeader.swift +0 -8
- package/example/ios/Podfile +0 -67
- package/example/ios/Podfile.lock +0 -1431
- package/example/jest.config.js +0 -3
- package/example/metro.config.js +0 -45
- package/example/package.json +0 -28
- package/example/react-native.config.js +0 -10
- package/example/src/App.js +0 -51
- package/lefthook.yml +0 -35
|
@@ -18,18 +18,28 @@
|
|
|
18
18
|
android:layout_width="0dp"
|
|
19
19
|
android:layout_height="80dp"
|
|
20
20
|
android:visibility="invisible"
|
|
21
|
+
app:cardBackgroundColor="@android:color/white"
|
|
21
22
|
app:cardElevation="8dp"
|
|
22
23
|
app:cardUseCompatPadding="false"
|
|
23
24
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
24
25
|
app:layout_constraintEnd_toEndOf="parent"
|
|
25
|
-
app:layout_constraintStart_toStartOf="parent"
|
|
26
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
27
|
+
android:gravity="center_vertical"
|
|
28
|
+
>
|
|
26
29
|
|
|
27
|
-
<
|
|
28
|
-
android:id="@+id/tripProgressView"
|
|
30
|
+
<FrameLayout
|
|
29
31
|
android:layout_width="match_parent"
|
|
30
|
-
android:layout_height="
|
|
31
|
-
android:
|
|
32
|
-
|
|
32
|
+
android:layout_height="match_parent"
|
|
33
|
+
android:foregroundGravity="center_vertical">
|
|
34
|
+
|
|
35
|
+
<com.mapbox.navigation.ui.tripprogress.view.MapboxTripProgressView
|
|
36
|
+
android:id="@+id/tripProgressView"
|
|
37
|
+
android:layout_width="match_parent"
|
|
38
|
+
android:layout_height="wrap_content"
|
|
39
|
+
android:layout_gravity="center_vertical"
|
|
40
|
+
android:paddingStart="16dp" />
|
|
41
|
+
|
|
42
|
+
</FrameLayout>
|
|
33
43
|
|
|
34
44
|
<ImageView
|
|
35
45
|
android:id="@+id/stop"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jadamsbit/react-native-mapbox-navigation",
|
|
3
3
|
"title": "React Native Mapbox Navigation",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.20",
|
|
5
5
|
"description": "Smart Mapbox turn-by-turn routing based on real-time traffic for React Native.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"access": "public",
|
|
33
33
|
"name": "https://registry.yarnpkg.com/@jadamsbit/react-native-mapbox-navigation"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|
|
@@ -39,7 +39,7 @@ Pod::Spec.new do |s|
|
|
|
39
39
|
s.homepage = "https://github.com/jadamsbit/react-native-mapbox-navigation"
|
|
40
40
|
s.license = { :type => "MIT", :file => "LICENSE" }
|
|
41
41
|
s.authors = { "Jamie Adams" => "adams.jamie@bitsourceky.com" }
|
|
42
|
-
s.platforms = { :ios => "
|
|
42
|
+
s.platforms = { :ios => "13.4" }
|
|
43
43
|
s.source = { :git => "https://github.com/jadamsbit/react-native-mapbox-navigation.git", :tag => "#{s.version}" }
|
|
44
44
|
|
|
45
45
|
s.source_files = "ios/**/*.{h,m,swift}"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Setup
|
|
2
|
-
description: Setup Node.js and install dependencies
|
|
3
|
-
|
|
4
|
-
runs:
|
|
5
|
-
using: composite
|
|
6
|
-
steps:
|
|
7
|
-
- name: Setup Node.js
|
|
8
|
-
uses: actions/setup-node@v3
|
|
9
|
-
with:
|
|
10
|
-
node-version-file: .nvmrc
|
|
11
|
-
|
|
12
|
-
- name: Cache dependencies
|
|
13
|
-
id: yarn-cache
|
|
14
|
-
uses: actions/cache@v3
|
|
15
|
-
with:
|
|
16
|
-
path: |
|
|
17
|
-
**/node_modules
|
|
18
|
-
.yarn/install-state.gz
|
|
19
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
|
|
20
|
-
restore-keys: |
|
|
21
|
-
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
|
|
22
|
-
${{ runner.os }}-yarn-
|
|
23
|
-
|
|
24
|
-
- name: Install dependencies
|
|
25
|
-
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
26
|
-
run: yarn install --immutable
|
|
27
|
-
shell: bash
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- main
|
|
6
|
-
pull_request:
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
lint:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout
|
|
15
|
-
uses: actions/checkout@v3
|
|
16
|
-
|
|
17
|
-
- name: Setup
|
|
18
|
-
uses: ./.github/actions/setup
|
|
19
|
-
|
|
20
|
-
- name: Lint files
|
|
21
|
-
run: yarn lint
|
|
22
|
-
|
|
23
|
-
- name: Typecheck files
|
|
24
|
-
run: yarn typecheck
|
|
25
|
-
|
|
26
|
-
test:
|
|
27
|
-
runs-on: ubuntu-latest
|
|
28
|
-
steps:
|
|
29
|
-
- name: Checkout
|
|
30
|
-
uses: actions/checkout@v3
|
|
31
|
-
|
|
32
|
-
- name: Setup
|
|
33
|
-
uses: ./.github/actions/setup
|
|
34
|
-
|
|
35
|
-
- name: Run unit tests
|
|
36
|
-
run: yarn test --maxWorkers=2 --coverage
|
|
37
|
-
|
|
38
|
-
build-library:
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
steps:
|
|
41
|
-
- name: Checkout
|
|
42
|
-
uses: actions/checkout@v3
|
|
43
|
-
|
|
44
|
-
- name: Setup
|
|
45
|
-
uses: ./.github/actions/setup
|
|
46
|
-
|
|
47
|
-
- name: Build package
|
|
48
|
-
run: yarn prepare
|
|
49
|
-
|
|
50
|
-
build-android:
|
|
51
|
-
runs-on: ubuntu-latest
|
|
52
|
-
env:
|
|
53
|
-
TURBO_CACHE_DIR: .turbo/android
|
|
54
|
-
steps:
|
|
55
|
-
- name: Checkout
|
|
56
|
-
uses: actions/checkout@v3
|
|
57
|
-
|
|
58
|
-
- name: Setup
|
|
59
|
-
uses: ./.github/actions/setup
|
|
60
|
-
|
|
61
|
-
- name: Cache turborepo for Android
|
|
62
|
-
uses: actions/cache@v3
|
|
63
|
-
with:
|
|
64
|
-
path: ${{ env.TURBO_CACHE_DIR }}
|
|
65
|
-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
|
|
66
|
-
restore-keys: |
|
|
67
|
-
${{ runner.os }}-turborepo-android-
|
|
68
|
-
|
|
69
|
-
- name: Check turborepo cache for Android
|
|
70
|
-
run: |
|
|
71
|
-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
|
|
72
|
-
|
|
73
|
-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
|
|
74
|
-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
- name: Install JDK
|
|
78
|
-
if: env.turbo_cache_hit != 1
|
|
79
|
-
uses: actions/setup-java@v3
|
|
80
|
-
with:
|
|
81
|
-
distribution: 'zulu'
|
|
82
|
-
java-version: '17'
|
|
83
|
-
|
|
84
|
-
- name: Finalize Android SDK
|
|
85
|
-
if: env.turbo_cache_hit != 1
|
|
86
|
-
run: |
|
|
87
|
-
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
|
|
88
|
-
|
|
89
|
-
- name: Cache Gradle
|
|
90
|
-
if: env.turbo_cache_hit != 1
|
|
91
|
-
uses: actions/cache@v3
|
|
92
|
-
with:
|
|
93
|
-
path: |
|
|
94
|
-
~/.gradle/wrapper
|
|
95
|
-
~/.gradle/caches
|
|
96
|
-
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
|
|
97
|
-
restore-keys: |
|
|
98
|
-
${{ runner.os }}-gradle-
|
|
99
|
-
|
|
100
|
-
- name: Build example for Android
|
|
101
|
-
env:
|
|
102
|
-
JAVA_OPTS: "-XX:MaxHeapSize=6g"
|
|
103
|
-
run: |
|
|
104
|
-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
|
|
105
|
-
|
|
106
|
-
build-ios:
|
|
107
|
-
runs-on: macos-14
|
|
108
|
-
env:
|
|
109
|
-
TURBO_CACHE_DIR: .turbo/ios
|
|
110
|
-
steps:
|
|
111
|
-
- name: Checkout
|
|
112
|
-
uses: actions/checkout@v3
|
|
113
|
-
|
|
114
|
-
- name: Setup
|
|
115
|
-
uses: ./.github/actions/setup
|
|
116
|
-
|
|
117
|
-
- name: Cache turborepo for iOS
|
|
118
|
-
uses: actions/cache@v3
|
|
119
|
-
with:
|
|
120
|
-
path: ${{ env.TURBO_CACHE_DIR }}
|
|
121
|
-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
|
|
122
|
-
restore-keys: |
|
|
123
|
-
${{ runner.os }}-turborepo-ios-
|
|
124
|
-
|
|
125
|
-
- name: Check turborepo cache for iOS
|
|
126
|
-
run: |
|
|
127
|
-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
|
|
128
|
-
|
|
129
|
-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
|
|
130
|
-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
|
|
131
|
-
fi
|
|
132
|
-
|
|
133
|
-
- name: Cache cocoapods
|
|
134
|
-
if: env.turbo_cache_hit != 1
|
|
135
|
-
id: cocoapods-cache
|
|
136
|
-
uses: actions/cache@v3
|
|
137
|
-
with:
|
|
138
|
-
path: |
|
|
139
|
-
**/ios/Pods
|
|
140
|
-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
|
|
141
|
-
restore-keys: |
|
|
142
|
-
${{ runner.os }}-cocoapods-
|
|
143
|
-
|
|
144
|
-
- name: Install cocoapods
|
|
145
|
-
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
|
|
146
|
-
run: |
|
|
147
|
-
cd example/ios
|
|
148
|
-
pod install
|
|
149
|
-
env:
|
|
150
|
-
NO_FLIPPER: 1
|
|
151
|
-
|
|
152
|
-
- name: Build example for iOS
|
|
153
|
-
run: |
|
|
154
|
-
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
|
package/example/.buckconfig
DELETED
package/example/.bundle/config
DELETED
package/example/.eslintrc.js
DELETED
package/example/.flowconfig
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
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
|
package/example/.prettierrc.js
DELETED
package/example/.watchmanconfig
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/example/Gemfile
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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.6.10"
|
|
5
|
-
|
|
6
|
-
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
|
|
7
|
-
# bound in the template on Cocoapods with next React Native release.
|
|
8
|
-
gem 'cocoapods', '>= 1.13', '< 1.15'
|
|
9
|
-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
hideStatusView
|
|
18
|
-
onLocationChange={event => {
|
|
19
|
-
console.log('onLocationChange', event.nativeEvent);
|
|
20
|
-
}}
|
|
21
|
-
onRouteProgressChange={event => {
|
|
22
|
-
console.log('onRouteProgressChange', event.nativeEvent);
|
|
23
|
-
}}
|
|
24
|
-
onError={event => {
|
|
25
|
-
const {message} = event.nativeEvent;
|
|
26
|
-
// eslint-disable-next-line no-alert
|
|
27
|
-
alert(message);
|
|
28
|
-
}}
|
|
29
|
-
onArrive={() => {
|
|
30
|
-
// eslint-disable-next-line no-alert
|
|
31
|
-
alert('You have reached your destination');
|
|
32
|
-
}}
|
|
33
|
-
onCancelNavigation={event => {
|
|
34
|
-
alert('Cancelled navigation event');
|
|
35
|
-
}}
|
|
36
|
-
/>
|
|
37
|
-
</View>
|
|
38
|
-
</View>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const styles = StyleSheet.create({
|
|
43
|
-
container: {
|
|
44
|
-
flex: 1,
|
|
45
|
-
display: 'flex',
|
|
46
|
-
flexDirection: 'column',
|
|
47
|
-
justifyContent: 'space-between',
|
|
48
|
-
height: '100%',
|
|
49
|
-
},
|
|
50
|
-
mapContainer: {
|
|
51
|
-
flex: 1,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export default Navigation;
|
package/example/README.md
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
|
|
2
|
-
|
|
3
|
-
# Getting Started
|
|
4
|
-
|
|
5
|
-
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
|
|
6
|
-
|
|
7
|
-
## Step 1: Start the Metro Server
|
|
8
|
-
|
|
9
|
-
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
|
|
10
|
-
|
|
11
|
-
To start Metro, run the following command from the _root_ of your React Native project:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# using npm
|
|
15
|
-
npm start
|
|
16
|
-
|
|
17
|
-
# OR using Yarn
|
|
18
|
-
yarn start
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Step 2: Start your Application
|
|
22
|
-
|
|
23
|
-
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
|
|
24
|
-
|
|
25
|
-
### For Android
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# using npm
|
|
29
|
-
npm run android
|
|
30
|
-
|
|
31
|
-
# OR using Yarn
|
|
32
|
-
yarn android
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### For iOS
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# using npm
|
|
39
|
-
npm run ios
|
|
40
|
-
|
|
41
|
-
# OR using Yarn
|
|
42
|
-
yarn ios
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
|
|
46
|
-
|
|
47
|
-
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
|
|
48
|
-
|
|
49
|
-
## Step 3: Modifying your App
|
|
50
|
-
|
|
51
|
-
Now that you have successfully run the app, let's modify it.
|
|
52
|
-
|
|
53
|
-
1. Open `App.tsx` in your text editor of choice and edit some lines.
|
|
54
|
-
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
|
|
55
|
-
|
|
56
|
-
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
|
|
57
|
-
|
|
58
|
-
## Congratulations! :tada:
|
|
59
|
-
|
|
60
|
-
You've successfully run and modified your React Native App. :partying_face:
|
|
61
|
-
|
|
62
|
-
### Now what?
|
|
63
|
-
|
|
64
|
-
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
65
|
-
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
|
|
66
|
-
|
|
67
|
-
# Troubleshooting
|
|
68
|
-
|
|
69
|
-
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
70
|
-
|
|
71
|
-
# Learn More
|
|
72
|
-
|
|
73
|
-
To learn more about React Native, take a look at the following resources:
|
|
74
|
-
|
|
75
|
-
- [React Native Website](https://reactnative.dev) - learn more about React Native.
|
|
76
|
-
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
|
|
77
|
-
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
|
|
78
|
-
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
|
|
79
|
-
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
apply plugin: "com.android.application"
|
|
2
|
-
apply plugin: "org.jetbrains.kotlin.android"
|
|
3
|
-
apply plugin: "com.facebook.react"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This is the configuration block to customize your React Native Android app.
|
|
7
|
-
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
8
|
-
*/
|
|
9
|
-
react {
|
|
10
|
-
/* Folders */
|
|
11
|
-
// The root of your project, i.e. where "package.json" lives. Default is '..'
|
|
12
|
-
// root = file("../")
|
|
13
|
-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
14
|
-
// reactNativeDir = file("../node_modules/react-native")
|
|
15
|
-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
|
|
16
|
-
// codegenDir = file("../node_modules/@react-native/codegen")
|
|
17
|
-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
18
|
-
// cliFile = file("../node_modules/react-native/cli.js")
|
|
19
|
-
|
|
20
|
-
/* Variants */
|
|
21
|
-
// The list of variants to that are debuggable. For those we're going to
|
|
22
|
-
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
23
|
-
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
24
|
-
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
25
|
-
|
|
26
|
-
/* Bundling */
|
|
27
|
-
// A list containing the node command and its flags. Default is just 'node'.
|
|
28
|
-
// nodeExecutableAndArgs = ["node"]
|
|
29
|
-
//
|
|
30
|
-
// The command to run when bundling. By default is 'bundle'
|
|
31
|
-
// bundleCommand = "ram-bundle"
|
|
32
|
-
//
|
|
33
|
-
// The path to the CLI configuration file. Default is empty.
|
|
34
|
-
// bundleConfig = file(../rn-cli.config.js)
|
|
35
|
-
//
|
|
36
|
-
// The name of the generated asset file containing your JS bundle
|
|
37
|
-
// bundleAssetName = "MyApplication.android.bundle"
|
|
38
|
-
//
|
|
39
|
-
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
40
|
-
// entryFile = file("../js/MyApplication.android.js")
|
|
41
|
-
//
|
|
42
|
-
// A list of extra flags to pass to the 'bundle' commands.
|
|
43
|
-
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
44
|
-
// extraPackagerArgs = []
|
|
45
|
-
|
|
46
|
-
/* Hermes Commands */
|
|
47
|
-
// The hermes compiler command to run. By default it is 'hermesc'
|
|
48
|
-
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
49
|
-
//
|
|
50
|
-
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
51
|
-
// hermesFlags = ["-O", "-output-source-map"]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
56
|
-
*/
|
|
57
|
-
def enableProguardInReleaseBuilds = false
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* The preferred build flavor of JavaScriptCore (JSC)
|
|
61
|
-
*
|
|
62
|
-
* For example, to use the international variant, you can use:
|
|
63
|
-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
64
|
-
*
|
|
65
|
-
* The international variant includes ICU i18n library and necessary data
|
|
66
|
-
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
67
|
-
* give correct results when using with locales other than en-US. Note that
|
|
68
|
-
* this variant is about 6MiB larger per architecture than default.
|
|
69
|
-
*/
|
|
70
|
-
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
71
|
-
|
|
72
|
-
android {
|
|
73
|
-
ndkVersion rootProject.ext.ndkVersion
|
|
74
|
-
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
75
|
-
compileSdk rootProject.ext.compileSdkVersion
|
|
76
|
-
|
|
77
|
-
namespace "com.mapboxnavigationexample"
|
|
78
|
-
defaultConfig {
|
|
79
|
-
applicationId "com.mapboxnavigationexample"
|
|
80
|
-
minSdkVersion rootProject.ext.minSdkVersion
|
|
81
|
-
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
82
|
-
versionCode 1
|
|
83
|
-
versionName "1.0"
|
|
84
|
-
}
|
|
85
|
-
signingConfigs {
|
|
86
|
-
debug {
|
|
87
|
-
storeFile file('debug.keystore')
|
|
88
|
-
storePassword 'android'
|
|
89
|
-
keyAlias 'androiddebugkey'
|
|
90
|
-
keyPassword 'android'
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
buildTypes {
|
|
94
|
-
debug {
|
|
95
|
-
signingConfig signingConfigs.debug
|
|
96
|
-
}
|
|
97
|
-
release {
|
|
98
|
-
// Caution! In production, you need to generate your own keystore file.
|
|
99
|
-
// see https://reactnative.dev/docs/signed-apk-android.
|
|
100
|
-
signingConfig signingConfigs.debug
|
|
101
|
-
minifyEnabled enableProguardInReleaseBuilds
|
|
102
|
-
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
dependencies {
|
|
108
|
-
// The version of react-native is set by the React Native Gradle Plugin
|
|
109
|
-
implementation("com.facebook.react:react-android")
|
|
110
|
-
implementation("com.facebook.react:flipper-integration")
|
|
111
|
-
|
|
112
|
-
if (hermesEnabled.toBoolean()) {
|
|
113
|
-
implementation("com.facebook.react:hermes-android")
|
|
114
|
-
} else {
|
|
115
|
-
implementation jscFlavor
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Add project specific ProGuard rules here.
|
|
2
|
-
# By default, the flags in this file are appended to flags specified
|
|
3
|
-
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
4
|
-
# You can edit the include path and order by changing the proguardFiles
|
|
5
|
-
# directive in build.gradle.
|
|
6
|
-
#
|
|
7
|
-
# For more details, see
|
|
8
|
-
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
9
|
-
|
|
10
|
-
# Add any project specific keep options here:
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
-
|
|
5
|
-
<application
|
|
6
|
-
android:usesCleartextTraffic="true"
|
|
7
|
-
tools:targetApi="28"
|
|
8
|
-
tools:ignore="GoogleAppIndexingWarning"/>
|
|
9
|
-
</manifest>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
-
|
|
3
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
|
-
|
|
5
|
-
<application
|
|
6
|
-
android:name=".MainApplication"
|
|
7
|
-
android:label="@string/app_name"
|
|
8
|
-
android:icon="@mipmap/ic_launcher"
|
|
9
|
-
android:roundIcon="@mipmap/ic_launcher_round"
|
|
10
|
-
android:allowBackup="false"
|
|
11
|
-
android:theme="@style/AppTheme">
|
|
12
|
-
<activity
|
|
13
|
-
android:name=".MainActivity"
|
|
14
|
-
android:label="@string/app_name"
|
|
15
|
-
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
16
|
-
android:launchMode="singleTask"
|
|
17
|
-
android:windowSoftInputMode="adjustResize"
|
|
18
|
-
android:exported="true">
|
|
19
|
-
<intent-filter>
|
|
20
|
-
<action android:name="android.intent.action.MAIN" />
|
|
21
|
-
<category android:name="android.intent.category.LAUNCHER" />
|
|
22
|
-
</intent-filter>
|
|
23
|
-
</activity>
|
|
24
|
-
<meta-data android:name="MAPBOX_ACCESS_TOKEN" android:value="pk.eyJ1IjoiYWRhbXNqYW1pZSIsImEiOiJja211enlwMXUwMGNjMm5xbjB2bjZrazBkIn0.U4IzgCKh43lsGEoeOSMT4g" />
|
|
25
|
-
</application>
|
|
26
|
-
</manifest>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
package com.mapboxnavigationexample
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactActivity
|
|
4
|
-
import com.facebook.react.ReactActivityDelegate
|
|
5
|
-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
6
|
-
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
7
|
-
|
|
8
|
-
class MainActivity : ReactActivity() {
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
12
|
-
* rendering of the component.
|
|
13
|
-
*/
|
|
14
|
-
override fun getMainComponentName(): String = "MapboxNavigationExample"
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
18
|
-
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
19
|
-
*/
|
|
20
|
-
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
|
21
|
-
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
|
22
|
-
}
|