@brightlayer-ui/react-native-template-routing-typescript 2.2.0-alpha.0 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/package.json +1 -1
- package/template/.bundle/config +2 -0
- package/template/.eslintrc.js +57 -0
- package/template/.prettierrc.js +7 -0
- package/template/.watchmanconfig +1 -0
- package/template/App.tsx +1 -2
- package/template/Gemfile +9 -0
- package/template/Gemfile.lock +105 -0
- package/template/README.md +79 -0
- package/template/__tests__/App.test.tsx +17 -0
- package/template/android/app/build.gradle +120 -0
- package/template/android/app/debug.keystore +0 -0
- package/template/android/app/proguard-rules.pro +10 -0
- package/template/android/app/src/debug/AndroidManifest.xml +9 -0
- package/template/android/app/src/main/AndroidManifest.xml +25 -0
- package/template/android/app/src/main/java/com/routingtemplate/MainActivity.kt +28 -0
- package/template/android/app/src/main/java/com/routingtemplate/MainApplication.kt +43 -0
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/android/app/src/main/res/values/styles.xml +9 -0
- package/template/android/build.gradle +21 -0
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/android/gradle.properties +41 -0
- package/template/android/gradlew +249 -0
- package/template/android/gradlew.bat +92 -0
- package/template/android/link-assets-manifest.json +25 -0
- package/template/android/settings.gradle +4 -0
- package/template/app.json +4 -0
- package/template/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/template/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/template/assets/fonts/OpenSans-Light.ttf +0 -0
- package/template/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/template/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/template/assets/images/Logo.png +0 -0
- package/template/babel.config.js +1 -2
- package/template/eslint.config.mjs +10 -0
- package/template/index.js +10 -0
- package/template/ios/.xcode.env +11 -0
- package/template/ios/Podfile +40 -0
- package/template/ios/Podfile.lock +1496 -0
- package/template/ios/blankTemplate/AppDelegate.h +6 -0
- package/template/ios/blankTemplate/AppDelegate.mm +31 -0
- package/template/ios/blankTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/template/ios/blankTemplate/Images.xcassets/Contents.json +6 -0
- package/template/ios/blankTemplate/Info.plist +75 -0
- package/template/ios/blankTemplate/LaunchScreen.storyboard +47 -0
- package/template/ios/blankTemplate/PrivacyInfo.xcprivacy +37 -0
- package/template/ios/blankTemplate/main.m +10 -0
- package/template/ios/blankTemplate.xcodeproj/project.pbxproj +741 -0
- package/template/ios/blankTemplate.xcodeproj/xcshareddata/xcschemes/blankTemplate.xcscheme +88 -0
- package/template/ios/blankTemplate.xcworkspace/contents.xcworkspacedata +10 -0
- package/template/ios/blankTemplate.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/ios/blankTemplateTests/Info.plist +24 -0
- package/template/ios/blankTemplateTests/blankTemplateTests.m +66 -0
- package/template/ios/link-assets-manifest.json +25 -0
- package/template/jest.config.js +3 -0
- package/template/metro.config.js +7 -25
- package/template/package.json +61 -0
- package/template/src/navigation/index.tsx +14 -14
- package/template/src/navigation/navigation-drawer.tsx +1 -2
- package/template/src/screens/home.tsx +77 -58
- package/template/src/screens/pageOne.tsx +3 -5
- package/template/src/screens/pageTwo.tsx +3 -5
- package/template/tsconfig.json +60 -0
- package/template/yarn.lock +7255 -0
- package/template.config.js +4 -0
- package/CHANGELOG.md +0 -62
- package/dependencies.json +0 -23
- package/images/Logo.svg +0 -11
- package/template/__mocks__/svgMock.js +0 -8
- package/template/jestSetupFile.js +0 -15
- package/template/react-native.config.js +0 -3
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Bold.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-ExtraBold.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Light.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Regular.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-SemiBold.ttf +0 -0
package/README.md
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
This is an official Brightlayer UI template used internally by the [Brightlayer UI CLI](https://www.npmjs.com/package/@brightlayer-ui/cli).
|
|
6
5
|
|
|
7
6
|
This template includes the installation and initial setup of routing using [React Navigation](https://reactnavigation.org/). It includes several placeholder routes/screens and a [Drawer](https://brightlayer-ui-components.github.io/react-native/?path=/info/components-documentation--drawer) navigator from the Brightlayer UI [React Native Component Library](https://www.npmjs.com/package/@brightlayer-ui/react-native-components).
|
|
8
7
|
|
|
9
8
|
## Usage
|
|
10
|
-
|
|
9
|
+
To create a new project using the Routing Template simply run :
|
|
11
10
|
```sh
|
|
12
|
-
npx -
|
|
11
|
+
npx react-native init MyApp --template @brightlayer-ui/react-native-template-routing-typescript
|
|
13
12
|
```
|
|
14
13
|
|
|
15
14
|
## Project Structure
|
|
@@ -20,8 +19,16 @@ Projects created using this template will start out with the following file stru
|
|
|
20
19
|
|── /android // android project folder
|
|
21
20
|
|── /assets // fonts and images used by the application
|
|
22
21
|
|── App.tsx // app entry point
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
└── src
|
|
23
|
+
|── /screens // sample application pages
|
|
24
|
+
└── /Navigation
|
|
25
|
+
|── index.tsx // sets up routing
|
|
26
|
+
└── navigation-drawer.tsx // sets up Drawer
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Clear Metro bundler cache (recommended)
|
|
30
|
+
|
|
31
|
+
Run the command into the root of the created project.
|
|
32
|
+
```sh
|
|
33
|
+
yarn start --reset-cache
|
|
34
|
+
```
|
package/package.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: '@typescript-eslint/parser',
|
|
4
|
+
extends: ['@brightlayer-ui/eslint-config/tsx'],
|
|
5
|
+
parserOptions: {
|
|
6
|
+
project: './tsconfig.json',
|
|
7
|
+
},
|
|
8
|
+
plugins: ['react-hooks'],
|
|
9
|
+
rules: {
|
|
10
|
+
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
|
|
11
|
+
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
|
|
12
|
+
'react/display-name': 'off',
|
|
13
|
+
'@typescript-eslint/naming-convention': [
|
|
14
|
+
'error',
|
|
15
|
+
{
|
|
16
|
+
selector: 'default',
|
|
17
|
+
format: ['camelCase', 'PascalCase'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
selector: 'variable',
|
|
21
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
selector: 'property',
|
|
25
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
selector: 'property',
|
|
29
|
+
format: null,
|
|
30
|
+
modifiers: ['requiresQuotes'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
selector: 'enumMember',
|
|
34
|
+
format: ['UPPER_CASE'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
selector: 'parameter',
|
|
38
|
+
format: ['camelCase'],
|
|
39
|
+
leadingUnderscore: 'allow',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
selector: 'memberLike',
|
|
43
|
+
modifiers: ['private'],
|
|
44
|
+
format: ['camelCase'],
|
|
45
|
+
leadingUnderscore: 'require',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
selector: 'typeLike',
|
|
49
|
+
format: ['PascalCase'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
selector: 'import',
|
|
53
|
+
format: ['camelCase', 'PascalCase'],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/template/App.tsx
CHANGED
|
@@ -10,8 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { Provider as ThemeProvider } from 'react-native-paper';
|
|
11
11
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
12
12
|
import * as BLUIThemes from '@brightlayer-ui/react-native-themes';
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import MainRouter from './src/navigation';
|
|
15
14
|
export const App = (): JSX.Element => (
|
|
16
15
|
<ThemeProvider theme={BLUIThemes.blue}>
|
|
17
16
|
<SafeAreaProvider>
|
package/template/Gemfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
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'
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
CFPropertyList (3.0.7)
|
|
5
|
+
base64
|
|
6
|
+
nkf
|
|
7
|
+
rexml
|
|
8
|
+
activesupport (6.1.7.7)
|
|
9
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
10
|
+
i18n (>= 1.6, < 2)
|
|
11
|
+
minitest (>= 5.1)
|
|
12
|
+
tzinfo (~> 2.0)
|
|
13
|
+
zeitwerk (~> 2.3)
|
|
14
|
+
addressable (2.8.6)
|
|
15
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
16
|
+
algoliasearch (1.27.5)
|
|
17
|
+
httpclient (~> 2.8, >= 2.8.3)
|
|
18
|
+
json (>= 1.5.1)
|
|
19
|
+
atomos (0.1.3)
|
|
20
|
+
base64 (0.2.0)
|
|
21
|
+
claide (1.1.0)
|
|
22
|
+
cocoapods (1.14.3)
|
|
23
|
+
addressable (~> 2.8)
|
|
24
|
+
claide (>= 1.0.2, < 2.0)
|
|
25
|
+
cocoapods-core (= 1.14.3)
|
|
26
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
27
|
+
cocoapods-downloader (>= 2.1, < 3.0)
|
|
28
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
29
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
|
30
|
+
cocoapods-trunk (>= 1.6.0, < 2.0)
|
|
31
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
|
32
|
+
colored2 (~> 3.1)
|
|
33
|
+
escape (~> 0.0.4)
|
|
34
|
+
fourflusher (>= 2.3.0, < 3.0)
|
|
35
|
+
gh_inspector (~> 1.0)
|
|
36
|
+
molinillo (~> 0.8.0)
|
|
37
|
+
nap (~> 1.0)
|
|
38
|
+
ruby-macho (>= 2.3.0, < 3.0)
|
|
39
|
+
xcodeproj (>= 1.23.0, < 2.0)
|
|
40
|
+
cocoapods-core (1.14.3)
|
|
41
|
+
activesupport (>= 5.0, < 8)
|
|
42
|
+
addressable (~> 2.8)
|
|
43
|
+
algoliasearch (~> 1.0)
|
|
44
|
+
concurrent-ruby (~> 1.1)
|
|
45
|
+
fuzzy_match (~> 2.0.4)
|
|
46
|
+
nap (~> 1.0)
|
|
47
|
+
netrc (~> 0.11)
|
|
48
|
+
public_suffix (~> 4.0)
|
|
49
|
+
typhoeus (~> 1.0)
|
|
50
|
+
cocoapods-deintegrate (1.0.5)
|
|
51
|
+
cocoapods-downloader (2.1)
|
|
52
|
+
cocoapods-plugins (1.0.0)
|
|
53
|
+
nap
|
|
54
|
+
cocoapods-search (1.0.1)
|
|
55
|
+
cocoapods-trunk (1.6.0)
|
|
56
|
+
nap (>= 0.8, < 2.0)
|
|
57
|
+
netrc (~> 0.11)
|
|
58
|
+
cocoapods-try (1.2.0)
|
|
59
|
+
colored2 (3.1.2)
|
|
60
|
+
concurrent-ruby (1.2.3)
|
|
61
|
+
escape (0.0.4)
|
|
62
|
+
ethon (0.16.0)
|
|
63
|
+
ffi (>= 1.15.0)
|
|
64
|
+
ffi (1.16.3)
|
|
65
|
+
fourflusher (2.3.1)
|
|
66
|
+
fuzzy_match (2.0.4)
|
|
67
|
+
gh_inspector (1.1.3)
|
|
68
|
+
httpclient (2.8.3)
|
|
69
|
+
i18n (1.14.5)
|
|
70
|
+
concurrent-ruby (~> 1.0)
|
|
71
|
+
json (2.7.2)
|
|
72
|
+
minitest (5.22.3)
|
|
73
|
+
molinillo (0.8.0)
|
|
74
|
+
nanaimo (0.3.0)
|
|
75
|
+
nap (1.1.0)
|
|
76
|
+
netrc (0.11.0)
|
|
77
|
+
nkf (0.2.0)
|
|
78
|
+
public_suffix (4.0.7)
|
|
79
|
+
rexml (3.2.6)
|
|
80
|
+
ruby-macho (2.5.1)
|
|
81
|
+
typhoeus (1.4.1)
|
|
82
|
+
ethon (>= 0.9.0)
|
|
83
|
+
tzinfo (2.0.6)
|
|
84
|
+
concurrent-ruby (~> 1.0)
|
|
85
|
+
xcodeproj (1.24.0)
|
|
86
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
87
|
+
atomos (~> 0.1.3)
|
|
88
|
+
claide (>= 1.0.2, < 2.0)
|
|
89
|
+
colored2 (~> 3.1)
|
|
90
|
+
nanaimo (~> 0.3.0)
|
|
91
|
+
rexml (~> 3.2.4)
|
|
92
|
+
zeitwerk (2.6.13)
|
|
93
|
+
|
|
94
|
+
PLATFORMS
|
|
95
|
+
ruby
|
|
96
|
+
|
|
97
|
+
DEPENDENCIES
|
|
98
|
+
activesupport (>= 6.1.7.5, < 7.1.0)
|
|
99
|
+
cocoapods (>= 1.13, < 1.15)
|
|
100
|
+
|
|
101
|
+
RUBY VERSION
|
|
102
|
+
ruby 2.6.10p210
|
|
103
|
+
|
|
104
|
+
BUNDLED WITH
|
|
105
|
+
1.17.2
|
|
@@ -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.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @format
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import App from '../App';
|
|
8
|
+
|
|
9
|
+
// Note: import explicitly to use the types shipped with jest.
|
|
10
|
+
import { it } from '@jest/globals';
|
|
11
|
+
|
|
12
|
+
// Note: test renderer must be required after react-native.
|
|
13
|
+
import renderer from 'react-test-renderer';
|
|
14
|
+
|
|
15
|
+
it('renders correctly', () => {
|
|
16
|
+
renderer.create(<App />);
|
|
17
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
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.routingtemplate"
|
|
78
|
+
defaultConfig {
|
|
79
|
+
applicationId "com.routingtemplate"
|
|
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
|
+
|
|
111
|
+
if (hermesEnabled.toBoolean()) {
|
|
112
|
+
implementation("com.facebook.react:hermes-android")
|
|
113
|
+
} else {
|
|
114
|
+
implementation jscFlavor
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
119
|
+
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
|
120
|
+
apply from: "../../node_modules/@brightlayer-ui/react-native-vector-icons/fonts.gradle"
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
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:
|
|
@@ -0,0 +1,9 @@
|
|
|
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>
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
</application>
|
|
25
|
+
</manifest>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.routingtemplate
|
|
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
|
+
import android.os.Bundle;
|
|
8
|
+
|
|
9
|
+
class MainActivity : ReactActivity() {
|
|
10
|
+
/**
|
|
11
|
+
* added for react-native-screens
|
|
12
|
+
*/
|
|
13
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
14
|
+
super.onCreate(null)
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
18
|
+
* rendering of the component.
|
|
19
|
+
*/
|
|
20
|
+
override fun getMainComponentName(): String = "blankTemplate"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
24
|
+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
25
|
+
*/
|
|
26
|
+
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
|
27
|
+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
|
28
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
package com.routingtemplate
|
|
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.soloader.SoLoader
|
|
13
|
+
|
|
14
|
+
class MainApplication : Application(), ReactApplication {
|
|
15
|
+
|
|
16
|
+
override val reactNativeHost: ReactNativeHost =
|
|
17
|
+
object : DefaultReactNativeHost(this) {
|
|
18
|
+
override fun getPackages(): List<ReactPackage> =
|
|
19
|
+
PackageList(this).packages.apply {
|
|
20
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
21
|
+
// add(MyReactNativePackage())
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
override fun getJSMainModuleName(): String = "index"
|
|
25
|
+
|
|
26
|
+
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
27
|
+
|
|
28
|
+
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
29
|
+
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
override val reactHost: ReactHost
|
|
33
|
+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|
|
34
|
+
|
|
35
|
+
override fun onCreate() {
|
|
36
|
+
super.onCreate()
|
|
37
|
+
SoLoader.init(this, false)
|
|
38
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
39
|
+
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
40
|
+
load()
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Copyright (C) 2014 The Android Open Source Project
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
-->
|
|
16
|
+
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
|
17
|
+
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
|
|
18
|
+
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
|
|
19
|
+
android:insetTop="@dimen/abc_edit_text_inset_top_material"
|
|
20
|
+
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
<selector>
|
|
24
|
+
<!--
|
|
25
|
+
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
|
26
|
+
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
|
27
|
+
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
|
28
|
+
|
|
29
|
+
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
30
|
+
|
|
31
|
+
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
|
|
32
|
+
-->
|
|
33
|
+
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
34
|
+
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
|
|
35
|
+
</selector>
|
|
36
|
+
|
|
37
|
+
</inset>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|