@jadamsbit/react-native-mapbox-navigation 1.0.10 → 1.0.12
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/.gitattributes +2 -0
- package/.github/actions/setup/action.yml +27 -0
- package/.github/workflows/ci.yml +154 -0
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
- package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
- package/.yarn/releases/yarn-3.6.1.cjs +874 -0
- package/CONTRIBUTING.md +117 -6
- package/LICENSE +1 -2
- package/README.md +4 -4
- package/android/build.gradle +7 -3
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +2 -2
- package/android/gradle.properties +5 -3
- package/android/gradlew +17 -12
- package/android/gradlew.bat +10 -10
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/jadamsbit/mapboxnavigation/{MapboxNavigationManager.kt → MapboxNavigationModule.kt} +30 -27
- package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationPackage.kt +3 -2
- package/android/src/main/java/com/jadamsbit/mapboxnavigation/MapboxNavigationView.kt +12 -25
- package/android/src/main/res/layout/navigation_view.xml +6 -7
- package/example/.buckconfig +0 -0
- package/example/{_bundle → .bundle}/config +0 -0
- package/example/.eslintrc.js +1 -1
- package/example/.flowconfig +0 -0
- package/example/.prettierrc.js +2 -2
- package/example/.watchmanconfig +1 -1
- package/example/Gemfile +5 -2
- package/example/NavigationComponent.js +0 -1
- package/example/README.md +79 -0
- package/example/android/app/build.gradle +60 -173
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +0 -0
- package/example/android/app/src/debug/AndroidManifest.xml +1 -5
- package/example/android/app/src/main/AndroidManifest.xml +5 -9
- package/example/android/app/src/main/java/com/mapboxnavigationexample/MainActivity.kt +22 -0
- package/example/android/app/src/main/java/com/mapboxnavigationexample/MainApplication.kt +45 -0
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +1 -1
- 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 +1 -1
- package/example/android/app/src/main/res/values/styles.xml +0 -0
- package/example/android/build.gradle +19 -35
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +3 -1
- package/example/android/gradle.properties +18 -7
- package/example/android/gradlew +173 -109
- package/example/android/gradlew.bat +19 -16
- package/example/android/settings.gradle +3 -3
- package/example/app.json +3 -3
- package/example/babel.config.js +1 -8
- package/example/index.js +3 -7
- package/example/ios/.xcode.env +1 -0
- package/example/ios/.xcode.env.local +2 -0
- package/example/ios/BasicApp/AppDelegate.h +1 -1
- package/example/ios/BasicApp/AppDelegate.m +1 -1
- package/example/ios/BasicApp/Info.plist +18 -18
- package/example/ios/BasicApp.xcodeproj/project.pbxproj +35 -9
- package/example/ios/BasicApp.xcodeproj/xcshareddata/xcschemes/BasicApp.xcscheme +1 -1
- package/example/ios/Podfile +48 -25
- package/example/ios/Podfile.lock +1257 -299
- package/example/jest.config.js +3 -0
- package/example/metro.config.js +19 -19
- package/example/package.json +14 -17
- package/example/react-native.config.js +10 -0
- package/example/{App.js → src/App.js} +3 -3
- package/package.json +1 -1
- package/src/__tests__/index.test.tsx +1 -0
- package/src/typings.ts +0 -1
- package/.vscode/settings.json +0 -3
- package/android/.gradle/7.3.3/checksums/checksums.lock +0 -0
- package/android/.gradle/7.3.3/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.3.3/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.3.3/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.3.3/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.3.3/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.3.3/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.3.3/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.3.3/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/README.md +0 -14
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -12
- package/dist/typings.d.ts +0 -38
- package/dist/typings.js +0 -1
- package/example/Gemfile.lock +0 -100
- package/example/__tests__/App-test.js +0 -14
- package/example/_ruby-version +0 -1
- package/example/android/.gradle/8.2/checksums/checksums.lock +0 -0
- package/example/android/.gradle/8.2/fileChanges/last-build.bin +0 -0
- package/example/android/.gradle/8.2/fileHashes/fileHashes.lock +0 -0
- package/example/android/.gradle/8.2/gc.properties +0 -0
- package/example/android/.gradle/vcs-1/gc.properties +0 -0
- package/example/android/app/_BUCK +0 -55
- package/example/android/app/build_defs.bzl +0 -19
- package/example/android/app/src/debug/java/com/basicapp/ReactNativeFlipper.java +0 -72
- package/example/android/app/src/main/java/com/basicapp/MainActivity.java +0 -15
- package/example/android/app/src/main/java/com/basicapp/MainApplication.java +0 -81
- package/img/bridging-header.png +0 -0
- package/img/build-setting-linking.png +0 -0
- package/img/build-setting-path.png +0 -0
- /package/android/src/main/res/{values → value}/styles.xml +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
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,153 +1,87 @@
|
|
|
1
1
|
apply plugin: "com.android.application"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
|
7
|
-
* and bundleReleaseJsAndAssets).
|
|
8
|
-
* These basically call `react-native bundle` with the correct arguments during the Android build
|
|
9
|
-
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
|
|
10
|
-
* bundle directly from the development server. Below you can see all the possible configurations
|
|
11
|
-
* and their defaults. If you decide to add a configuration block, make sure to add it before the
|
|
12
|
-
* `apply from: "../../node_modules/react-native/react.gradle"` line.
|
|
13
|
-
*
|
|
14
|
-
* project.ext.react = [
|
|
15
|
-
* // the name of the generated asset file containing your JS bundle
|
|
16
|
-
* bundleAssetName: "index.android.bundle",
|
|
17
|
-
*
|
|
18
|
-
* // the entry file for bundle generation. If none specified and
|
|
19
|
-
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
|
|
20
|
-
* // default. Can be overridden with ENTRY_FILE environment variable.
|
|
21
|
-
* entryFile: "index.android.js",
|
|
22
|
-
*
|
|
23
|
-
* // https://reactnative.dev/docs/performance#enable-the-ram-format
|
|
24
|
-
* bundleCommand: "ram-bundle",
|
|
25
|
-
*
|
|
26
|
-
* // whether to bundle JS and assets in debug mode
|
|
27
|
-
* bundleInDebug: false,
|
|
28
|
-
*
|
|
29
|
-
* // whether to bundle JS and assets in release mode
|
|
30
|
-
* bundleInRelease: true,
|
|
31
|
-
*
|
|
32
|
-
* // whether to bundle JS and assets in another build variant (if configured).
|
|
33
|
-
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
|
|
34
|
-
* // The configuration property can be in the following formats
|
|
35
|
-
* // 'bundleIn${productFlavor}${buildType}'
|
|
36
|
-
* // 'bundleIn${buildType}'
|
|
37
|
-
* // bundleInFreeDebug: true,
|
|
38
|
-
* // bundleInPaidRelease: true,
|
|
39
|
-
* // bundleInBeta: true,
|
|
40
|
-
*
|
|
41
|
-
* // whether to disable dev mode in custom build variants (by default only disabled in release)
|
|
42
|
-
* // for example: to disable dev mode in the staging build type (if configured)
|
|
43
|
-
* devDisabledInStaging: true,
|
|
44
|
-
* // The configuration property can be in the following formats
|
|
45
|
-
* // 'devDisabledIn${productFlavor}${buildType}'
|
|
46
|
-
* // 'devDisabledIn${buildType}'
|
|
47
|
-
*
|
|
48
|
-
* // the root of your project, i.e. where "package.json" lives
|
|
49
|
-
* root: "../../",
|
|
50
|
-
*
|
|
51
|
-
* // where to put the JS bundle asset in debug mode
|
|
52
|
-
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
|
|
53
|
-
*
|
|
54
|
-
* // where to put the JS bundle asset in release mode
|
|
55
|
-
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
|
|
56
|
-
*
|
|
57
|
-
* // where to put drawable resources / React Native assets, e.g. the ones you use via
|
|
58
|
-
* // require('./image.png')), in debug mode
|
|
59
|
-
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
|
|
60
|
-
*
|
|
61
|
-
* // where to put drawable resources / React Native assets, e.g. the ones you use via
|
|
62
|
-
* // require('./image.png')), in release mode
|
|
63
|
-
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
|
|
64
|
-
*
|
|
65
|
-
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
|
|
66
|
-
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
|
|
67
|
-
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
|
|
68
|
-
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
|
|
69
|
-
* // for example, you might want to remove it from here.
|
|
70
|
-
* inputExcludes: ["android/**", "ios/**"],
|
|
71
|
-
*
|
|
72
|
-
* // override which node gets called and with what additional arguments
|
|
73
|
-
* nodeExecutableAndArgs: ["node"],
|
|
74
|
-
*
|
|
75
|
-
* // supply additional arguments to the packager
|
|
76
|
-
* extraPackagerArgs: []
|
|
77
|
-
* ]
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
project.ext.react = [
|
|
81
|
-
enableHermes: false, // clean and rebuild if changing
|
|
82
|
-
]
|
|
83
|
-
|
|
84
|
-
apply from: "../../node_modules/react-native/react.gradle"
|
|
2
|
+
apply plugin: "org.jetbrains.kotlin.android"
|
|
3
|
+
apply plugin: "com.facebook.react"
|
|
85
4
|
|
|
86
5
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* - An APK that only works on x86 devices
|
|
90
|
-
* The advantage is the size of the APK is reduced by about 4MB.
|
|
91
|
-
* Upload all the APKs to the Play Store and people will download
|
|
92
|
-
* the correct one based on the CPU architecture of their device.
|
|
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.
|
|
93
8
|
*/
|
|
94
|
-
|
|
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
|
+
}
|
|
95
53
|
|
|
96
54
|
/**
|
|
97
|
-
* Run Proguard to
|
|
55
|
+
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
98
56
|
*/
|
|
99
57
|
def enableProguardInReleaseBuilds = false
|
|
100
58
|
|
|
101
59
|
/**
|
|
102
|
-
* The preferred build flavor of JavaScriptCore
|
|
60
|
+
* The preferred build flavor of JavaScriptCore (JSC)
|
|
103
61
|
*
|
|
104
62
|
* For example, to use the international variant, you can use:
|
|
105
63
|
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
106
64
|
*
|
|
107
65
|
* The international variant includes ICU i18n library and necessary data
|
|
108
66
|
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
109
|
-
* give correct results when using with locales other than en-US.
|
|
67
|
+
* give correct results when using with locales other than en-US. Note that
|
|
110
68
|
* this variant is about 6MiB larger per architecture than default.
|
|
111
69
|
*/
|
|
112
70
|
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
113
71
|
|
|
114
|
-
/**
|
|
115
|
-
* Whether to enable the Hermes VM.
|
|
116
|
-
*
|
|
117
|
-
* This should be set on project.ext.react and that value will be read here. If it is not set
|
|
118
|
-
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
|
|
119
|
-
* and the benefits of using Hermes will therefore be sharply reduced.
|
|
120
|
-
*/
|
|
121
|
-
def enableHermes = project.ext.react.get("enableHermes", false);
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Architectures to build native code for in debug.
|
|
125
|
-
*/
|
|
126
|
-
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
|
|
127
|
-
|
|
128
72
|
android {
|
|
129
73
|
ndkVersion rootProject.ext.ndkVersion
|
|
74
|
+
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
75
|
+
compileSdk rootProject.ext.compileSdkVersion
|
|
130
76
|
|
|
131
|
-
|
|
132
|
-
|
|
77
|
+
namespace "com.mapboxnavigationexample"
|
|
133
78
|
defaultConfig {
|
|
134
|
-
applicationId "com.
|
|
79
|
+
applicationId "com.mapboxnavigationexample"
|
|
135
80
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
136
81
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
137
82
|
versionCode 1
|
|
138
83
|
versionName "1.0"
|
|
139
84
|
}
|
|
140
|
-
splits {
|
|
141
|
-
abi {
|
|
142
|
-
reset()
|
|
143
|
-
enable enableSeparateBuildPerCPUArchitecture
|
|
144
|
-
universalApk false // If true, also generate a universal APK
|
|
145
|
-
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
packagingOptions {
|
|
149
|
-
pickFirst '**/*.so'
|
|
150
|
-
}
|
|
151
85
|
signingConfigs {
|
|
152
86
|
debug {
|
|
153
87
|
storeFile file('debug.keystore')
|
|
@@ -159,11 +93,6 @@ android {
|
|
|
159
93
|
buildTypes {
|
|
160
94
|
debug {
|
|
161
95
|
signingConfig signingConfigs.debug
|
|
162
|
-
if (nativeArchitectures) {
|
|
163
|
-
ndk {
|
|
164
|
-
abiFilters nativeArchitectures.split(',')
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
96
|
}
|
|
168
97
|
release {
|
|
169
98
|
// Caution! In production, you need to generate your own keystore file.
|
|
@@ -173,60 +102,18 @@ android {
|
|
|
173
102
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
174
103
|
}
|
|
175
104
|
}
|
|
176
|
-
|
|
177
|
-
// applicationVariants are e.g. debug, release
|
|
178
|
-
applicationVariants.all { variant ->
|
|
179
|
-
variant.outputs.each { output ->
|
|
180
|
-
// For each separate APK per architecture, set a unique version code as described here:
|
|
181
|
-
// https://developer.android.com/studio/build/configure-apk-splits.html
|
|
182
|
-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
|
|
183
|
-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
|
|
184
|
-
def abi = output.getFilter(OutputFile.ABI)
|
|
185
|
-
if (abi != null) { // null for the universal-debug, universal-release variants
|
|
186
|
-
output.versionCodeOverride =
|
|
187
|
-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
105
|
}
|
|
193
106
|
|
|
194
107
|
dependencies {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
implementation
|
|
198
|
-
|
|
199
|
-
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
|
200
|
-
|
|
201
|
-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
|
|
202
|
-
exclude group:'com.facebook.fbjni'
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
|
206
|
-
exclude group:'com.facebook.flipper'
|
|
207
|
-
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
|
208
|
-
}
|
|
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")
|
|
209
111
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (enableHermes) {
|
|
215
|
-
def hermesPath = "../../node_modules/hermes-engine/android/";
|
|
216
|
-
debugImplementation files(hermesPath + "hermes-debug.aar")
|
|
217
|
-
releaseImplementation files(hermesPath + "hermes-release.aar")
|
|
112
|
+
if (hermesEnabled.toBoolean()) {
|
|
113
|
+
implementation("com.facebook.react:hermes-android")
|
|
218
114
|
} else {
|
|
219
115
|
implementation jscFlavor
|
|
220
116
|
}
|
|
221
|
-
|
|
222
|
-
implementation project(':mapboxnavigation')
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Run this once to be able to run the application with BUCK
|
|
226
|
-
// puts all compile dependencies into folder libs for BUCK to use
|
|
227
|
-
task copyDownloadableDepsToLibs(type: Copy) {
|
|
228
|
-
from configurations.implementation
|
|
229
|
-
into 'libs'
|
|
230
117
|
}
|
|
231
118
|
|
|
232
119
|
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
File without changes
|
|
File without changes
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
3
|
xmlns:tools="http://schemas.android.com/tools">
|
|
4
4
|
|
|
5
|
-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
-
|
|
7
5
|
<application
|
|
8
6
|
android:usesCleartextTraffic="true"
|
|
9
7
|
tools:targetApi="28"
|
|
10
|
-
tools:ignore="GoogleAppIndexingWarning"
|
|
11
|
-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
12
|
-
</application>
|
|
8
|
+
tools:ignore="GoogleAppIndexingWarning"/>
|
|
13
9
|
</manifest>
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
-
package="com.basicapp">
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
2
|
|
|
4
3
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
-
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
6
|
-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
7
|
-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
8
4
|
|
|
9
5
|
<application
|
|
10
6
|
android:name=".MainApplication"
|
|
@@ -16,15 +12,15 @@
|
|
|
16
12
|
<activity
|
|
17
13
|
android:name=".MainActivity"
|
|
18
14
|
android:label="@string/app_name"
|
|
19
|
-
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
|
15
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
20
16
|
android:launchMode="singleTask"
|
|
21
|
-
android:windowSoftInputMode="adjustResize"
|
|
17
|
+
android:windowSoftInputMode="adjustResize"
|
|
18
|
+
android:exported="true">
|
|
22
19
|
<intent-filter>
|
|
23
20
|
<action android:name="android.intent.action.MAIN" />
|
|
24
21
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
25
22
|
</intent-filter>
|
|
26
23
|
</activity>
|
|
27
|
-
<meta-data android:name="MAPBOX_ACCESS_TOKEN"
|
|
28
|
-
android:value="pk.eyJ1IjoiYWRhbXNqYW1pZSIsImEiOiJja211enlwMXUwMGNjMm5xbjB2bjZrazBkIn0.U4IzgCKh43lsGEoeOSMT4g" />
|
|
24
|
+
<meta-data android:name="MAPBOX_ACCESS_TOKEN" android:value="pk.eyJ1IjoiYWRhbXNqYW1pZSIsImEiOiJja211enlwMXUwMGNjMm5xbjB2bjZrazBkIn0.U4IzgCKh43lsGEoeOSMT4g" />
|
|
29
25
|
</application>
|
|
30
26
|
</manifest>
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package com.mapboxnavigationexample
|
|
2
|
+
|
|
3
|
+
import android.app.Application
|
|
4
|
+
import com.facebook.react.PackageList
|
|
5
|
+
import com.facebook.react.ReactApplication
|
|
6
|
+
import com.facebook.react.ReactHost
|
|
7
|
+
import com.facebook.react.ReactNativeHost
|
|
8
|
+
import com.facebook.react.ReactPackage
|
|
9
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
10
|
+
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
|
11
|
+
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
12
|
+
import com.facebook.react.flipper.ReactNativeFlipper
|
|
13
|
+
import com.facebook.soloader.SoLoader
|
|
14
|
+
|
|
15
|
+
class MainApplication : Application(), ReactApplication {
|
|
16
|
+
|
|
17
|
+
override val reactNativeHost: ReactNativeHost =
|
|
18
|
+
object : DefaultReactNativeHost(this) {
|
|
19
|
+
override fun getPackages(): List<ReactPackage> =
|
|
20
|
+
PackageList(this).packages.apply {
|
|
21
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
22
|
+
// add(MyReactNativePackage())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun getJSMainModuleName(): String = "index"
|
|
26
|
+
|
|
27
|
+
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
28
|
+
|
|
29
|
+
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
30
|
+
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
override val reactHost: ReactHost
|
|
34
|
+
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
|
|
35
|
+
|
|
36
|
+
override fun onCreate() {
|
|
37
|
+
super.onCreate()
|
|
38
|
+
SoLoader.init(this, false)
|
|
39
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
40
|
+
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
41
|
+
load()
|
|
42
|
+
}
|
|
43
|
+
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
|
|
21
21
|
|
|
22
22
|
<selector>
|
|
23
|
-
<!--
|
|
23
|
+
<!--
|
|
24
24
|
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
|
25
25
|
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
|
26
26
|
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,55 +1,39 @@
|
|
|
1
|
-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
2
|
-
|
|
3
1
|
buildscript {
|
|
4
2
|
ext {
|
|
5
|
-
buildToolsVersion = "
|
|
3
|
+
buildToolsVersion = "34.0.0"
|
|
6
4
|
minSdkVersion = 21
|
|
7
|
-
compileSdkVersion =
|
|
8
|
-
targetSdkVersion =
|
|
5
|
+
compileSdkVersion = 34
|
|
6
|
+
targetSdkVersion = 34
|
|
9
7
|
ndkVersion = "21.4.7075529"
|
|
8
|
+
kotlinVersion = "1.8.0"
|
|
10
9
|
}
|
|
11
10
|
repositories {
|
|
12
11
|
google()
|
|
13
12
|
mavenCentral()
|
|
14
13
|
}
|
|
15
14
|
dependencies {
|
|
16
|
-
classpath("com.android.tools.build:gradle
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
classpath("com.android.tools.build:gradle")
|
|
16
|
+
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
17
|
+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
allprojects {
|
|
23
22
|
repositories {
|
|
24
23
|
maven {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
url("$rootDir/../node_modules/jsc-android/dist")
|
|
31
|
-
}
|
|
32
|
-
mavenCentral {
|
|
33
|
-
// We don't want to fetch react-native from Maven Central as there are
|
|
34
|
-
// older versions over there.
|
|
35
|
-
content {
|
|
36
|
-
excludeGroup "com.facebook.react"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
google()
|
|
40
|
-
maven { url 'https://www.jitpack.io' }
|
|
41
|
-
maven {
|
|
42
|
-
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
|
43
|
-
authentication {
|
|
44
|
-
basic(BasicAuthentication)
|
|
45
|
-
}
|
|
46
|
-
credentials {
|
|
24
|
+
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
|
25
|
+
authentication {
|
|
26
|
+
basic(BasicAuthentication)
|
|
27
|
+
}
|
|
28
|
+
credentials {
|
|
47
29
|
// Do not change the username below.
|
|
48
30
|
// This should always be `mapbox` (not your username).
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
username = "mapbox"
|
|
32
|
+
// Use the secret token you stored in gradle.properties as the password
|
|
33
|
+
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
|
|
34
|
+
}
|
|
35
|
+
}
|
|
54
36
|
}
|
|
55
37
|
}
|
|
38
|
+
|
|
39
|
+
apply plugin: "com.facebook.react.rootproject"
|
|
Binary file
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
|
4
|
+
networkTimeout=10000
|
|
5
|
+
validateDistributionUrl=true
|
|
4
6
|
zipStoreBase=GRADLE_USER_HOME
|
|
5
7
|
zipStorePath=wrapper/dists
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
# Specifies the JVM arguments used for the daemon process.
|
|
11
11
|
# The setting is particularly useful for tweaking memory settings.
|
|
12
|
-
# Default value: -
|
|
13
|
-
|
|
12
|
+
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
|
13
|
+
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
|
14
14
|
|
|
15
15
|
# When configured, Gradle will run in incubating parallel mode.
|
|
16
16
|
# This option should only be used with decoupled projects. More details, visit
|
|
@@ -24,12 +24,23 @@ android.useAndroidX=true
|
|
|
24
24
|
# Automatically convert third-party libraries to use AndroidX
|
|
25
25
|
android.enableJetifier=true
|
|
26
26
|
|
|
27
|
+
# Use this property to specify which architecture you want to build.
|
|
28
|
+
# You can also override it from the CLI using
|
|
29
|
+
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
|
30
|
+
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|
31
|
+
|
|
32
|
+
# Use this property to enable support to the new architecture.
|
|
33
|
+
# This will allow you to use TurboModules and the Fabric render in
|
|
34
|
+
# your application. You should enable this flag either if you want
|
|
35
|
+
# to write custom TurboModules/Fabric components OR use libraries that
|
|
36
|
+
# are providing them.
|
|
37
|
+
newArchEnabled=false
|
|
38
|
+
|
|
39
|
+
# Use this property to enable or disable the Hermes JS engine.
|
|
40
|
+
# If set to false, you will be using JSC instead.
|
|
41
|
+
hermesEnabled=true
|
|
42
|
+
|
|
27
43
|
# Version of flipper SDK to use with React Native
|
|
28
44
|
FLIPPER_VERSION=0.99.0
|
|
29
45
|
|
|
30
46
|
MAPBOX_DOWNLOADS_TOKEN=sk.eyJ1IjoiYWRhbXNqYW1pZSIsImEiOiJjbHN4Z3I1emIwMnFlMmtubnhna3hoZ2Y5In0.LvUt6Xjj8imNaqoJCE9Hkg
|
|
31
|
-
|
|
32
|
-
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
|
|
33
|
-
org.gradle.daemon=true
|
|
34
|
-
org.gradle.parallel=true
|
|
35
|
-
org.gradle.configureondemand=true.
|