@jadamsbit/react-native-mapbox-navigation 1.0.11 → 1.0.13
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 +9 -5
- 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 +11 -24
- package/android/src/main/res/layout/navigation_view.xml +6 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -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/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
package/example/metro.config.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
* Metro configuration for React Native
|
|
3
|
-
* https://github.com/facebook/react-native
|
|
4
|
-
*
|
|
5
|
-
* @format
|
|
6
|
-
*/
|
|
7
|
-
|
|
1
|
+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
|
|
8
2
|
const path = require('path');
|
|
9
|
-
const blacklist = require('metro-config/src/defaults/exclusionList');
|
|
10
3
|
const escape = require('escape-string-regexp');
|
|
4
|
+
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
11
5
|
const pak = require('../package.json');
|
|
12
6
|
|
|
13
|
-
const root = path.resolve(__dirname, '
|
|
14
|
-
|
|
15
|
-
const modules = Object.keys({
|
|
16
|
-
...pak.peerDependencies,
|
|
17
|
-
});
|
|
7
|
+
const root = path.resolve(__dirname, '..');
|
|
8
|
+
const modules = Object.keys({ ...pak.peerDependencies });
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Metro configuration
|
|
12
|
+
* https://facebook.github.io/metro/docs/configuration
|
|
13
|
+
*
|
|
14
|
+
* @type {import('metro-config').MetroConfig}
|
|
15
|
+
*/
|
|
16
|
+
const config = {
|
|
21
17
|
watchFolders: [root],
|
|
22
18
|
|
|
23
19
|
// We need to make sure that only one version is loaded for peerDependencies
|
|
24
|
-
// So we
|
|
20
|
+
// So we block them at the root, and alias them to the versions in example's node_modules
|
|
25
21
|
resolver: {
|
|
26
|
-
blacklistRE:
|
|
22
|
+
blacklistRE: exclusionList(
|
|
27
23
|
modules.map(
|
|
28
|
-
m =>
|
|
29
|
-
|
|
24
|
+
(m) =>
|
|
25
|
+
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
|
|
26
|
+
)
|
|
30
27
|
),
|
|
31
28
|
|
|
32
29
|
extraNodeModules: modules.reduce((acc, name) => {
|
|
@@ -34,6 +31,7 @@ module.exports = {
|
|
|
34
31
|
return acc;
|
|
35
32
|
}, {}),
|
|
36
33
|
},
|
|
34
|
+
|
|
37
35
|
transformer: {
|
|
38
36
|
getTransformOptions: async () => ({
|
|
39
37
|
transform: {
|
|
@@ -43,3 +41,5 @@ module.exports = {
|
|
|
43
41
|
}),
|
|
44
42
|
},
|
|
45
43
|
};
|
|
44
|
+
|
|
45
|
+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
|
package/example/package.json
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "mapbox-navigation-example",
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"android": "react-native run-android",
|
|
7
7
|
"ios": "react-native run-ios",
|
|
8
8
|
"start": "react-native start",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
10
|
+
"build:ios": "cd ios && xcodebuild -workspace MapboxNavigationExample.xcworkspace -scheme MapboxNavigationExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"react": "
|
|
14
|
-
"react-native": "0.
|
|
13
|
+
"react": "18.2.0",
|
|
14
|
+
"react-native": "0.73.6"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@babel/core": "^7.
|
|
18
|
-
"@babel/
|
|
19
|
-
"@
|
|
20
|
-
"babel-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"jest": "^26.6.3",
|
|
25
|
-
"metro-react-native-babel-preset": "^0.66.2",
|
|
26
|
-
"react-test-renderer": "17.0.2"
|
|
17
|
+
"@babel/core": "^7.20.0",
|
|
18
|
+
"@babel/preset-env": "^7.20.0",
|
|
19
|
+
"@babel/runtime": "^7.20.0",
|
|
20
|
+
"@react-native/babel-preset": "0.73.21",
|
|
21
|
+
"@react-native/metro-config": "0.73.5",
|
|
22
|
+
"@react-native/typescript-config": "0.73.1",
|
|
23
|
+
"babel-plugin-module-resolver": "^5.0.0"
|
|
27
24
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
30
27
|
}
|
|
31
28
|
}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
import React, {useEffect} from 'react';
|
|
10
10
|
import {SafeAreaView, useColorScheme} from 'react-native';
|
|
11
11
|
import {Colors} from 'react-native/Libraries/NewAppScreen';
|
|
12
|
-
import NavigationComponent from './NavigationComponent';
|
|
13
12
|
import {PermissionsAndroid} from 'react-native';
|
|
13
|
+
import NavigationComponent from '../NavigationComponent';
|
|
14
14
|
|
|
15
15
|
const App = () => {
|
|
16
16
|
const isDarkMode = useColorScheme() === 'dark';
|
|
@@ -41,8 +41,8 @@ const App = () => {
|
|
|
41
41
|
return (
|
|
42
42
|
<SafeAreaView style={backgroundStyle}>
|
|
43
43
|
<NavigationComponent
|
|
44
|
-
origin={[-82.
|
|
45
|
-
destination={[-82.
|
|
44
|
+
origin={[-82.5320747067464, 37.4906492874019]}
|
|
45
|
+
destination={[-82.5311503322108, 37.483129190962124]}
|
|
46
46
|
/>
|
|
47
47
|
</SafeAreaView>
|
|
48
48
|
);
|
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.13",
|
|
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",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
it.todo('write a test');
|
package/src/typings.ts
CHANGED
package/.vscode/settings.json
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/android/README.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
README
|
|
2
|
-
======
|
|
3
|
-
|
|
4
|
-
If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
|
|
5
|
-
|
|
6
|
-
1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
|
|
7
|
-
2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
|
|
8
|
-
```
|
|
9
|
-
ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
|
|
10
|
-
sdk.dir=/Users/{username}/Library/Android/sdk
|
|
11
|
-
```
|
|
12
|
-
3. Delete the `maven` folder
|
|
13
|
-
4. Run `./gradlew installArchives`
|
|
14
|
-
5. Verify that latest set of generated files is in the maven folder with the correct version number
|
package/example/Gemfile.lock
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
GEM
|
|
2
|
-
remote: https://rubygems.org/
|
|
3
|
-
specs:
|
|
4
|
-
CFPropertyList (3.0.5)
|
|
5
|
-
rexml
|
|
6
|
-
activesupport (6.1.7.7)
|
|
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.6.3)
|
|
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.2.3)
|
|
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.14.4)
|
|
67
|
-
concurrent-ruby (~> 1.0)
|
|
68
|
-
json (2.6.1)
|
|
69
|
-
minitest (5.22.2)
|
|
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.6)
|
|
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.6.13)
|
|
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
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
});
|
package/example/_ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.7.4
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"""Helper definitions to glob .aar and .jar targets"""
|
|
2
|
-
|
|
3
|
-
def create_aar_targets(aarfiles):
|
|
4
|
-
for aarfile in aarfiles:
|
|
5
|
-
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
|
|
6
|
-
lib_deps.append(":" + name)
|
|
7
|
-
android_prebuilt_aar(
|
|
8
|
-
name = name,
|
|
9
|
-
aar = aarfile,
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
def create_jar_targets(jarfiles):
|
|
13
|
-
for jarfile in jarfiles:
|
|
14
|
-
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
|
|
15
|
-
lib_deps.append(":" + name)
|
|
16
|
-
prebuilt_jar(
|
|
17
|
-
name = name,
|
|
18
|
-
binary_jar = jarfile,
|
|
19
|
-
)
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
-
* directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
package com.basicapp;
|
|
8
|
-
|
|
9
|
-
import android.content.Context;
|
|
10
|
-
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
-
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
-
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
-
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
-
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
-
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
-
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
-
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
-
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
|
|
21
|
-
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
22
|
-
import com.facebook.react.ReactInstanceManager;
|
|
23
|
-
import com.facebook.react.bridge.ReactContext;
|
|
24
|
-
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
-
import okhttp3.OkHttpClient;
|
|
26
|
-
|
|
27
|
-
public class ReactNativeFlipper {
|
|
28
|
-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
29
|
-
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
30
|
-
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
31
|
-
|
|
32
|
-
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
33
|
-
client.addPlugin(new ReactFlipperPlugin());
|
|
34
|
-
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
35
|
-
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
36
|
-
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
37
|
-
|
|
38
|
-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
39
|
-
NetworkingModule.setCustomClientBuilder(
|
|
40
|
-
new NetworkingModule.CustomClientBuilder() {
|
|
41
|
-
@Override
|
|
42
|
-
public void apply(OkHttpClient.Builder builder) {
|
|
43
|
-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
client.addPlugin(networkFlipperPlugin);
|
|
47
|
-
client.start();
|
|
48
|
-
|
|
49
|
-
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
50
|
-
// Hence we run if after all native modules have been initialized
|
|
51
|
-
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
52
|
-
if (reactContext == null) {
|
|
53
|
-
reactInstanceManager.addReactInstanceEventListener(
|
|
54
|
-
new ReactInstanceManager.ReactInstanceEventListener() {
|
|
55
|
-
@Override
|
|
56
|
-
public void onReactContextInitialized(ReactContext reactContext) {
|
|
57
|
-
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
58
|
-
reactContext.runOnNativeModulesQueueThread(
|
|
59
|
-
new Runnable() {
|
|
60
|
-
@Override
|
|
61
|
-
public void run() {
|
|
62
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
client.addPlugin(new FrescoFlipperPlugin());
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
package com.basicapp;
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.ReactActivity;
|
|
4
|
-
|
|
5
|
-
public class MainActivity extends ReactActivity {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
9
|
-
* rendering of the component.
|
|
10
|
-
*/
|
|
11
|
-
@Override
|
|
12
|
-
protected String getMainComponentName() {
|
|
13
|
-
return "BasicApp";
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
package com.basicapp;
|
|
2
|
-
|
|
3
|
-
import android.app.Application;
|
|
4
|
-
import android.content.Context;
|
|
5
|
-
import com.facebook.react.PackageList;
|
|
6
|
-
import com.facebook.react.ReactApplication;
|
|
7
|
-
import com.facebook.react.ReactInstanceManager;
|
|
8
|
-
import com.facebook.react.ReactNativeHost;
|
|
9
|
-
import com.facebook.react.ReactPackage;
|
|
10
|
-
import com.facebook.soloader.SoLoader;
|
|
11
|
-
import java.lang.reflect.InvocationTargetException;
|
|
12
|
-
import java.util.List;
|
|
13
|
-
import com.jadamsbit.mapboxnavigation.MapboxNavigationPackage;
|
|
14
|
-
|
|
15
|
-
public class MainApplication extends Application implements ReactApplication {
|
|
16
|
-
|
|
17
|
-
private final ReactNativeHost mReactNativeHost =
|
|
18
|
-
new ReactNativeHost(this) {
|
|
19
|
-
@Override
|
|
20
|
-
public boolean getUseDeveloperSupport() {
|
|
21
|
-
return BuildConfig.DEBUG;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Override
|
|
25
|
-
protected List<ReactPackage> getPackages() {
|
|
26
|
-
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
27
|
-
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
28
|
-
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
29
|
-
packages.add(new MapboxNavigationPackage());
|
|
30
|
-
return packages;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@Override
|
|
34
|
-
protected String getJSMainModuleName() {
|
|
35
|
-
return "index";
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
@Override
|
|
40
|
-
public ReactNativeHost getReactNativeHost() {
|
|
41
|
-
return mReactNativeHost;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@Override
|
|
45
|
-
public void onCreate() {
|
|
46
|
-
super.onCreate();
|
|
47
|
-
SoLoader.init(this, /* native exopackage */ false);
|
|
48
|
-
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
53
|
-
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
54
|
-
*
|
|
55
|
-
* @param context
|
|
56
|
-
* @param reactInstanceManager
|
|
57
|
-
*/
|
|
58
|
-
private static void initializeFlipper(
|
|
59
|
-
Context context, ReactInstanceManager reactInstanceManager) {
|
|
60
|
-
if (BuildConfig.DEBUG) {
|
|
61
|
-
try {
|
|
62
|
-
/*
|
|
63
|
-
We use reflection here to pick up the class that initializes Flipper,
|
|
64
|
-
since Flipper library is not available in release mode
|
|
65
|
-
*/
|
|
66
|
-
Class<?> aClass = Class.forName("com.basicapp.ReactNativeFlipper");
|
|
67
|
-
aClass
|
|
68
|
-
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
69
|
-
.invoke(null, context, reactInstanceManager);
|
|
70
|
-
} catch (ClassNotFoundException e) {
|
|
71
|
-
e.printStackTrace();
|
|
72
|
-
} catch (NoSuchMethodException e) {
|
|
73
|
-
e.printStackTrace();
|
|
74
|
-
} catch (IllegalAccessException e) {
|
|
75
|
-
e.printStackTrace();
|
|
76
|
-
} catch (InvocationTargetException e) {
|
|
77
|
-
e.printStackTrace();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
package/img/bridging-header.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|