Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
246f4b0e15 | ||
|
|
c828050ba1 | ||
|
|
5eaec68860 | ||
|
|
6142f06bbd | ||
|
|
d342812102 | ||
|
|
5c13cea6c9 | ||
|
|
2433071930 | ||
|
|
dd03234e2d | ||
|
|
3bd15d3f8b | ||
|
|
2b27bcd134 | ||
|
|
3aee211c73 | ||
|
|
531686ea8e | ||
|
|
951afa5fb1 | ||
|
|
61e71ee09f | ||
|
|
d9e1a5ee25 | ||
|
|
e3d2ce12c3 | ||
|
|
d1ec360902 | ||
|
|
8c5eba700d | ||
|
|
d6232860c5 | ||
|
|
e7028ce75a | ||
|
|
523cf17f8e | ||
|
|
11458a9f73 | ||
|
|
2744c53843 | ||
|
|
4e7f9f07ee | ||
|
|
97016c4498 | ||
|
|
b83c4bb379 | ||
|
|
136db984ee | ||
|
|
de6921061e | ||
|
|
25b97b235b | ||
|
|
a12cb97b1d | ||
|
|
9bdf5fa784 | ||
|
|
81a9dc2071 | ||
|
|
3009429d72 | ||
|
|
c636f5ab47 | ||
|
|
2b6ad6a3c6 | ||
|
|
42dcfd6622 | ||
|
|
edc4ace200 | ||
|
|
5ae94601be | ||
|
|
e87014519b | ||
|
|
ae59cf2d97 | ||
|
|
928efd5fb1 | ||
|
|
cb47a55fc5 | ||
|
|
5dbfc3543f | ||
|
|
8361745f3e | ||
|
|
b05cdcb076 | ||
|
|
14e2df66d5 | ||
|
|
a862ebd451 | ||
|
|
35625ded74 | ||
|
|
65632779c2 | ||
|
|
26ca0639bc | ||
|
|
255a87a463 | ||
|
|
76590e31d9 | ||
|
|
a3092ab17d | ||
|
|
338d5c2364 | ||
|
|
40e7ff1655 | ||
|
|
d1419cd2ed | ||
|
|
cd342935a1 | ||
|
|
97d21c39be | ||
|
|
2f38d420aa | ||
|
|
6d9bc8d869 | ||
|
|
8e57aae5cf | ||
|
|
b464e15718 | ||
|
|
a874d5774c | ||
|
|
96cb00b5a6 | ||
|
|
9a8a34636d | ||
|
|
950d5ef6d2 | ||
|
|
542122794a | ||
|
|
4c81fbefc3 | ||
|
|
bd2daa809f | ||
|
|
5e07cd2601 | ||
|
|
cd22810be6 | ||
|
|
3f8a4d491c | ||
|
|
837fc0bc25 | ||
|
|
57d2bbeb96 | ||
|
|
e3c38aefe8 | ||
|
|
fb7da05beb | ||
|
|
5d097b92f4 | ||
|
|
60618d5d1d | ||
|
|
28e1753434 | ||
|
|
48b1bd965b | ||
|
|
6e80d7c75a | ||
|
|
1c75f17a86 | ||
|
|
e542c84e29 | ||
|
|
a7265155bd |
@@ -1,11 +1,65 @@
|
|||||||
version: 3
|
version: 2
|
||||||
|
|
||||||
|
defaults: &defaults
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:10.9.0
|
||||||
|
working_directory: ~/project
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
install-dependencies:
|
||||||
docker:
|
<<: *defaults
|
||||||
- image: circleci/node:10
|
|
||||||
parallelism: 2
|
|
||||||
working_directory: ~/react-navigation
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: yarn install --frozen-lockfile
|
- attach_workspace:
|
||||||
- run: ./scripts/test.sh
|
at: ~/project
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-dependencies-{{ checksum "package.json" }}
|
||||||
|
- v1-dependencies-
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-dependencies-example-{{ checksum "example/package.json" }}
|
||||||
|
- v1-dependencies-example-
|
||||||
|
- run: |
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
yarn install --frozen-lockfile --cwd example
|
||||||
|
- save_cache:
|
||||||
|
key: v1-dependencies-{{ checksum "package.json" }}
|
||||||
|
paths: node_modules
|
||||||
|
- save_cache:
|
||||||
|
key: v1-dependencies-example-{{ checksum "example/package.json" }}
|
||||||
|
paths: example/node_modules
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: .
|
||||||
|
paths: .
|
||||||
|
lint-and-typecheck:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: ~/project
|
||||||
|
- run: |
|
||||||
|
yarn lint
|
||||||
|
yarn typescript
|
||||||
|
unit-tests:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: ~/project
|
||||||
|
- run: |
|
||||||
|
yarn test --coverage
|
||||||
|
yarn codecov
|
||||||
|
- store_artifacts:
|
||||||
|
path: coverage
|
||||||
|
destination: coverage
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build-and-test:
|
||||||
|
jobs:
|
||||||
|
- install-dependencies
|
||||||
|
- lint-and-typecheck:
|
||||||
|
requires:
|
||||||
|
- install-dependencies
|
||||||
|
- unit-tests:
|
||||||
|
requires:
|
||||||
|
- install-dependencies
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
coverage
|
coverage/
|
||||||
flow
|
flow/
|
||||||
node_modules
|
node_modules/
|
||||||
lib*
|
lib/
|
||||||
build
|
build/
|
||||||
|
typescript/
|
||||||
## Temporary
|
|
||||||
examples
|
|
||||||
|
|||||||
59
.eslintrc
@@ -1,52 +1,21 @@
|
|||||||
{
|
{
|
||||||
"extends": [
|
"extends": "eslint-config-satya164",
|
||||||
"plugin:react/recommended",
|
|
||||||
"plugin:import/errors",
|
"plugins": ["react-native-globals"],
|
||||||
"plugin:import/warnings",
|
|
||||||
"prettier",
|
"settings": {
|
||||||
"prettier/react"
|
"react": {
|
||||||
],
|
"version": "detect"
|
||||||
"parser": "babel-eslint",
|
},
|
||||||
"plugins": ["react", "prettier"],
|
},
|
||||||
|
|
||||||
"env": {
|
"env": {
|
||||||
"jasmine": true
|
"es6": true,
|
||||||
|
"react-native-globals/all": true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"prettier/prettier": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"trailingComma": "es5",
|
|
||||||
"singleQuote": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"no-underscore-dangle": "off",
|
|
||||||
"no-use-before-define": "off",
|
|
||||||
"no-unused-expressions": "off",
|
|
||||||
"new-cap": "off",
|
|
||||||
"no-plusplus": "off",
|
|
||||||
"no-class-assign": "off",
|
|
||||||
"no-duplicate-imports": "off",
|
|
||||||
"import/extensions": "off",
|
|
||||||
"import/no-extraneous-dependencies": "off",
|
|
||||||
"import/no-unresolved": "off",
|
"import/no-unresolved": "off",
|
||||||
|
"react/sort-comp": "off"
|
||||||
"react/jsx-filename-extension": ["off", { "extensions": [".js", ".jsx"] }],
|
|
||||||
|
|
||||||
"react/sort-comp": "off",
|
|
||||||
"react/prefer-stateless-function": "off",
|
|
||||||
"react/no-deprecated": "off",
|
|
||||||
|
|
||||||
"react/forbid-prop-types": "warn",
|
|
||||||
"react/prop-types": "off",
|
|
||||||
"react/require-default-props": "off",
|
|
||||||
"react/no-unused-prop-types": "off"
|
|
||||||
},
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 6,
|
|
||||||
"sourceType": "module",
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"modules": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -15,7 +15,3 @@ The code must pass tests.
|
|||||||
## Code formatting
|
## Code formatting
|
||||||
|
|
||||||
Look around. Match the style of the rest of the codebase. Run `yarn format` before committing.
|
Look around. Match the style of the rest of the codebase. Run `yarn format` before committing.
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
Add an entry under the "Unreleased" heading in [CHANGELOG.md](https://github.com/react-navigation/react-navigation/blob/master/CHANGELOG.md#unreleased) which explains your change.
|
|
||||||
|
|||||||
4
.gitignore
vendored
@@ -13,8 +13,8 @@ yarn-error.log
|
|||||||
# OS X
|
# OS X
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# Exponent
|
# Expo
|
||||||
.exponent
|
.expo
|
||||||
|
|
||||||
# Jest
|
# Jest
|
||||||
coverage
|
coverage
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"increment": "conventional:angular",
|
"git": {
|
||||||
"changelogCommand": "conventional-changelog -p angular | tail -n +3",
|
|
||||||
"safeBump": false,
|
|
||||||
"src": {
|
|
||||||
"commitMessage": "chore: release %s",
|
"commitMessage": "chore: release %s",
|
||||||
"tagName": "v%s"
|
"tagName": "v%s"
|
||||||
},
|
},
|
||||||
@@ -11,5 +8,10 @@
|
|||||||
},
|
},
|
||||||
"github": {
|
"github": {
|
||||||
"release": true
|
"release": true
|
||||||
|
},
|
||||||
|
"plugins": {
|
||||||
|
"@release-it/conventional-changelog": {
|
||||||
|
"preset": "angular"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
244
CHANGELOG.md
@@ -1,244 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
## [Unreleased]
|
|
||||||
|
|
||||||
## [3.6.1] - [2019-04-02](https://github.com/react-navigation/react-navigation/releases/tag/3.6.1)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Move event subscriptions to constructor in `withNavigationFocus` to ensure initial `didFocus` event is received.
|
|
||||||
|
|
||||||
## [3.6.0] - [2019-03-31](https://github.com/react-navigation/react-navigation/releases/tag/3.6.0)
|
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- Export TabBarIconProps, TabBarLabelProps, DrawerIconProps, DrawerLabelProps, ScreenProps and InitialLayout.
|
|
||||||
- Add `disabled` prop to HeaderBackButton
|
|
||||||
- Add `StackViewTransitionConfigs.NoAnimation`
|
|
||||||
- Add `drawerContainerStyle` to navigator config for drawer navigator
|
|
||||||
|
|
||||||
## [3.5.1] - [2019-03-19](https://github.com/react-navigation/react-navigation/releases/tag/3.5.1)
|
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- Export StackGestureContext and DrawerGestureContext
|
|
||||||
- Add missing type for withOrientation
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Fix header HeaderBackButton title TypeScript type
|
|
||||||
|
|
||||||
## [3.5.0] - [2019-03-19](https://github.com/react-navigation/react-navigation/releases/tag/3.5.0)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Fixed types for `BottomTabBar`
|
|
||||||
- export `NavigationContext` type
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- Make 'react-native-gesture-handler' a peer dependency rather than a hard dependency
|
|
||||||
|
|
||||||
## [3.4.1] - [2019-03-16](https://github.com/react-navigation/react-navigation/releases/tag/3.4.1)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Fix missing TypeScript definitions file in release package
|
|
||||||
|
|
||||||
## [3.4.0] - [2019-03-15](https://github.com/react-navigation/react-navigation/releases/tag/3.4.0)
|
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- TypeScript type definition now included in the project.
|
|
||||||
- Better support for react-native-web in core and stack.
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Default key to null in stack reset action (https://github.com/react-navigation/react-navigation-core/commit/59238160d86284a3353d53af10688fcf3f36004f)
|
|
||||||
- Fix header back button label and title label scaling. Defaults to false. (https://github.com/react-navigation/react-navigation-stack/commit/c1f1dff465e9eebe274a08e274cf10570045fa23)
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- Remove react-lifecycles-compat from @react-navigation/core
|
|
||||||
- NavigationPlayground uses TypeScript
|
|
||||||
|
|
||||||
## [3.3.2] - [2019-02-25](https://github.com/react-navigation/react-navigation/releases/tag/3.3.2)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Updated Flow types (https://github.com/react-navigation/react-navigation/commit/d3040e52b39bc8e91ffc1354d9c5f8c096baf597)
|
|
||||||
|
|
||||||
## [3.3.1] - [2019-02-25](https://github.com/react-navigation/react-navigation/releases/tag/3.3.1)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- SafeAreaView bottom inset on iPhone XR and XS fixed. (https://github.com/react-navigation/react-navigation/issues/5625)
|
|
||||||
|
|
||||||
## [3.3.0] - [2019-02-16](https://github.com/react-navigation/react-navigation/releases/tag/3.3.0)
|
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- Pass through `drawerOpenProgress` to drawer content component (https://github.com/react-navigation/react-navigation-drawer/pull/40)
|
|
||||||
|
|
||||||
## [3.2.3] - [2019-02-09](https://github.com/react-navigation/react-navigation/releases/tag/3.2.3)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- `await` the result of `onTransitionStart` before starting the transition (https://github.com/react-navigation/react-navigation-stack/pull/79)
|
|
||||||
|
|
||||||
## [3.2.2]
|
|
||||||
|
|
||||||
- Oops, I skipped it. Nothing here.
|
|
||||||
|
|
||||||
## [3.2.1] - [2019-02-09](https://github.com/react-navigation/react-navigation/releases/tag/3.2.1)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Remove accidental console.log
|
|
||||||
|
|
||||||
## [3.2.0] - [2019-02-08](https://github.com/react-navigation/react-navigation/releases/tag/3.2.0)
|
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- Add support for `backBehavior: history'` and `backBehavior: 'order'` to any navigator based on SwitchRouter (eg: tab navigators). (https://github.com/react-navigation/react-navigation-core/pull/31)
|
|
||||||
|
|
||||||
## [3.1.5] - [2019-02-06](https://github.com/react-navigation/react-navigation/releases/tag/3.1.5)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Revert "Transparent header measurement fix (https://github.com/react-navigation/react-navigation-stack/pull/71)"
|
|
||||||
|
|
||||||
## [3.1.4] - [2019-02-05](https://github.com/react-navigation/react-navigation/releases/tag/3.1.4)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Fix references to onGestureFinish in StackViewLayout, should be onGestureEnd
|
|
||||||
|
|
||||||
## [3.1.3] - [2019-02-04](https://github.com/react-navigation/react-navigation/releases/tag/3.1.3)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Stack navigator properly dismisses and restores keyboard when gesture starts and is cancelled
|
|
||||||
- Transparent header measurement fix (https://github.com/react-navigation/react-navigation-stack/pull/71)
|
|
||||||
|
|
||||||
## [3.1.2] - [2019-02-01](https://github.com/react-navigation/react-navigation/releases/tag/3.1.2)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Update flow definition for `withNavigation` and `withNavigationFocus` to support `defaultProps`
|
|
||||||
- Prevent onRef callback be called twice on withNavigationFocus components (https://github.com/react-navigation/react-navigation-core/pull/30)
|
|
||||||
- Bump react-navigation-drawer version to improve performance - if you use Expo, you will need expo@^32.0.3 to update!
|
|
||||||
|
|
||||||
## [3.0.9] - [2018-12-19](https://github.com/react-navigation/react-navigation/releases/tag/3.0.9)
|
|
||||||
|
|
||||||
## Fixed
|
|
||||||
|
|
||||||
- Intermittent flicker when changing tabs while using react-native-screens fixed by not changing opacity (https://github.com/react-navigation/react-navigation-tabs/pull/80)
|
|
||||||
- Prevent fading the previous screen on push/pop on Android (https://github.com/react-navigation/react-navigation-stack/pull/73)
|
|
||||||
|
|
||||||
## [3.0.8] - [2018-12-08](https://github.com/react-navigation/react-navigation/releases/tag/3.0.8)
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- Lock create-react-context to 0.2.2
|
|
||||||
|
|
||||||
## [3.0.7] - [2018-12-08](https://github.com/react-navigation/react-navigation/releases/tag/3.0.7)
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- Optimize stack gesture to avoid a setState and reduce unnecessary Animated node creation (https://github.com/react-navigation/react-navigation-stack/pull/70)
|
|
||||||
|
|
||||||
## [3.0.6] - [2018-12-06](https://github.com/react-navigation/react-navigation/releases/tag/3.0.6)
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- Fix drawer accessibility label when drawer label is not a string
|
|
||||||
|
|
||||||
|
|
||||||
## [3.0.5] - [2018-12-03](https://github.com/react-navigation/react-navigation/releases/tag/3.0.5)
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- Fix crash in rare case where onNavigationStateChange on container leads to setState and container has screenProps (https://github.com/react-navigation/react-navigation/issues/5301)
|
|
||||||
- Expose underlaying ScrollView methods to NavigationAwareScrollable (https://github.com/react-navigation/react-navigation-native/pull/8)
|
|
||||||
|
|
||||||
## [3.0.4] - [2018-11-30](https://github.com/react-navigation/react-navigation/releases/tag/3.0.4)
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- Lock dependencies to exact versions
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- Fix crash when screenInterpolator is null (https://github.com/react-navigation/react-navigation-stack/issues/64)
|
|
||||||
- Fix renderPager override (https://github.com/react-navigation/react-navigation-tabs/pull/70)
|
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- Accessibility labels on drawer items (https://github.com/react-navigation/react-navigation-drawer/pull/30)
|
|
||||||
|
|
||||||
|
|
||||||
## [3.0.3] - [2018-11-30](https://github.com/react-navigation/react-navigation/releases/tag/3.0.3)
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- Fix bug where if you navigate immediately when the navigator is first mounted the stack could get in an invalid state.
|
|
||||||
- Transparent stack card factors in header height now, even though you probably won't want to use this.
|
|
||||||
- Fix bug where shadow was still rendered on transparent stack
|
|
||||||
- Fix gestureResponseDistance custom values being ignored for modal stack
|
|
||||||
|
|
||||||
## [3.0.2] - [2018-11-27](https://github.com/react-navigation/react-navigation/releases/tag/3.0.2)
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- Fix `drawerLockMode` on drawer navigator
|
|
||||||
- Fix RTL support in drawer navigator
|
|
||||||
|
|
||||||
## [3.0.1] - [2018-11-26](https://github.com/react-navigation/react-navigation/releases/tag/3.0.1)
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- fix NavigationTestUtils.js deprecated file import.
|
|
||||||
- Update `getParam` flow typings to check `key` and `fallback` arguments, as well as return the correct type automatically.
|
|
||||||
- Fix regression in backgroundColor on cardStyle for stack navigator.
|
|
||||||
|
|
||||||
## [3.0.0] - [2018-11-17](https://github.com/react-navigation/react-navigation/releases/tag/3.0.0)
|
|
||||||
|
|
||||||
- Changes between the latest 2.x release and 3.0.0 are listed on the blog at https://reactnavigation.org/blog/2018/11/17/react-navigation-3.0.html
|
|
||||||
|
|
||||||
# [Previous major versions]
|
|
||||||
|
|
||||||
- [2.x](https://github.com/react-navigation/react-navigation/blob/2.x/CHANGELOG.md)
|
|
||||||
|
|
||||||
[Unreleased]: https://github.com/react-navigation/react-navigation/compare/3.6.1...HEAD
|
|
||||||
[3.6.1]: https://github.com/react-navigation/react-navigation/compare/3.6.0...3.6.1
|
|
||||||
[3.6.0]: https://github.com/react-navigation/react-navigation/compare/3.5.1...3.6.0
|
|
||||||
[3.5.1]: https://github.com/react-navigation/react-navigation/compare/3.5.0...3.5.1
|
|
||||||
[3.5.0]: https://github.com/react-navigation/react-navigation/compare/3.4.1...3.5.0
|
|
||||||
[3.4.1]: https://github.com/react-navigation/react-navigation/compare/3.4.0...3.4.1
|
|
||||||
[3.4.0]: https://github.com/react-navigation/react-navigation/compare/3.3.2...3.4.0
|
|
||||||
[3.3.2]: https://github.com/react-navigation/react-navigation/compare/3.3.1...3.3.2
|
|
||||||
[3.3.1]: https://github.com/react-navigation/react-navigation/compare/3.3.0...3.3.1
|
|
||||||
[3.3.0]: https://github.com/react-navigation/react-navigation/compare/3.2.3...3.3.0
|
|
||||||
[3.2.3]: https://github.com/react-navigation/react-navigation/compare/3.2.1...3.2.3
|
|
||||||
[3.2.1]: https://github.com/react-navigation/react-navigation/compare/3.2.0...3.2.1
|
|
||||||
[3.2.0]: https://github.com/react-navigation/react-navigation/compare/3.1.5...3.2.0
|
|
||||||
[3.1.5]: https://github.com/react-navigation/react-navigation/compare/3.1.4...3.1.5
|
|
||||||
[3.1.4]: https://github.com/react-navigation/react-navigation/compare/3.1.3...3.1.4
|
|
||||||
[3.1.3]: https://github.com/react-navigation/react-navigation/compare/3.1.2...3.1.3
|
|
||||||
[3.1.2]: https://github.com/react-navigation/react-navigation/compare/3.0.9...3.1.2
|
|
||||||
[3.0.9]: https://github.com/react-navigation/react-navigation/compare/3.0.8...3.0.9
|
|
||||||
[3.0.8]: https://github.com/react-navigation/react-navigation/compare/3.0.7...3.0.8
|
|
||||||
[3.0.7]: https://github.com/react-navigation/react-navigation/compare/3.0.6...3.0.7
|
|
||||||
[3.0.6]: https://github.com/react-navigation/react-navigation/compare/3.0.5...3.0.6
|
|
||||||
[3.0.5]: https://github.com/react-navigation/react-navigation/compare/3.0.4...3.0.5
|
|
||||||
[3.0.4]: https://github.com/react-navigation/react-navigation/compare/3.0.3...3.0.4
|
|
||||||
[3.0.3]: https://github.com/react-navigation/react-navigation/compare/3.0.2...3.0.3
|
|
||||||
[3.0.2]: https://github.com/react-navigation/react-navigation/compare/3.0.1...3.0.2
|
|
||||||
[3.0.1]: https://github.com/react-navigation/react-navigation/compare/3.0.0...3.0.1
|
|
||||||
[3.0.0]: https://github.com/react-navigation/react-navigation/compare/2.x...3.0.0
|
|
||||||
39
LICENSE
@@ -1,26 +1,21 @@
|
|||||||
BSD License
|
MIT License
|
||||||
|
|
||||||
For React Navigation software
|
Copyright (c) 2017 React Native Community
|
||||||
|
|
||||||
Copyright (c) 2016-present, React Navigation Contributors. All rights reserved.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
The above copyright notice and this permission notice shall be included in all
|
||||||
are permitted provided that the following conditions are met:
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
list of conditions and the following disclaimer.
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* Redistributions in binary form must reproduce the above copyright notice,
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
this list of conditions and the following disclaimer in the documentation
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
and/or other materials provided with the distribution.
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ See: https://reactnavigation.org/docs/en/getting-started.html
|
|||||||
* The [Community Resources](https://github.com/react-navigation/react-navigation/blob/master/COMMUNITY_RESOURCES.md) document lists some other resources submitted to us by people who use React Navigation. Feel free to open a pull request to add your resource to the list.
|
* The [Community Resources](https://github.com/react-navigation/react-navigation/blob/master/COMMUNITY_RESOURCES.md) document lists some other resources submitted to us by people who use React Navigation. Feel free to open a pull request to add your resource to the list.
|
||||||
* You can contribute improvements to the documentation [in the website repository](https://github.com/react-navigation/react-navigation.github.io).
|
* You can contribute improvements to the documentation [in the website repository](https://github.com/react-navigation/react-navigation.github.io).
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
The changes for each release are outlined on [the Github releases page](https://github.com/react-navigation/react-navigation/releases).
|
||||||
|
|
||||||
## Try it out
|
## Try it out
|
||||||
|
|
||||||
You can also try out the [Navigation Playground app](https://exp.host/@react-navigation/NavigationPlayground) to get a sense for some of the tools built in to React Navigation. The "Fundamentals" in the documentation also include examples you can play with.
|
You can also try out the [Navigation Playground app](https://exp.host/@react-navigation/NavigationPlayground) to get a sense for some of the tools built in to React Navigation. The "Fundamentals" in the documentation also include examples you can play with.
|
||||||
@@ -33,7 +37,7 @@ See our [Contributing Guide](CONTRIBUTING.md)!
|
|||||||
|
|
||||||
#### Is this the only library available for navigation?
|
#### Is this the only library available for navigation?
|
||||||
|
|
||||||
Certainly not! There other libraries - which, depending on your needs, can be better or worse suited for your project. Read more in the [alternative libraries](https://reactnavigation.org/docs/alternatives.html) documentation, and read React Navigation's [pitch & anti-pitch](https://reactnavigation.org/docs/pitch.html) to understand the tradeoffs.
|
Certainly not! There are other libraries - which, depending on your needs, can be better or worse suited for your project. Read more in the [alternative libraries](https://reactnavigation.org/docs/alternatives.html) documentation, and read React Navigation's [pitch & anti-pitch](https://reactnavigation.org/docs/pitch.html) to understand the tradeoffs.
|
||||||
|
|
||||||
#### Can I use this library for web?
|
#### Can I use this library for web?
|
||||||
|
|
||||||
@@ -45,4 +49,4 @@ This library has adopted a Code of Conduct that we expect project participants t
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
React Navigation is licensed under the [BSD 2-clause "Simplified" License](https://github.com/react-community/react-navigation/blob/master/LICENSE).
|
React Navigation is licensed under the [MIT](https://github.com/react-community/react-navigation/blob/master/LICENSE).
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable import/no-commonjs */
|
||||||
/**
|
/**
|
||||||
* This file is needed to hijack asset imports so that test files don't attempt
|
* This file is needed to hijack asset imports so that test files don't attempt
|
||||||
* to import them as JavaScript modules.
|
* to import them as JavaScript modules.
|
||||||
@@ -6,7 +7,7 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
process(src, filename, config, options) {
|
process(src, filename) {
|
||||||
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
|
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable import/no-commonjs */
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
presets: ['module:metro-react-native-babel-preset'],
|
presets: ['module:metro-react-native-babel-preset'],
|
||||||
};
|
};
|
||||||
|
|||||||
5
commitlint.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
/* eslint-disable import/no-commonjs */
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
extends: ['@commitlint/config-conventional'],
|
||||||
|
};
|
||||||
12
example/.babelrc
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
"expo"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
["module-resolver", {
|
||||||
|
"alias": {
|
||||||
|
"react-navigation": "../src/react-navigation"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
}
|
||||||
18
example/.eslintrc
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
'extends': '../.eslintrc',
|
||||||
|
|
||||||
|
'settings':
|
||||||
|
{
|
||||||
|
'import/core-modules':
|
||||||
|
[
|
||||||
|
'expo-asset',
|
||||||
|
'react-navigation-stack',
|
||||||
|
'react-native-gesture-handler',
|
||||||
|
'react-native-reanimated',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
"rules": {
|
||||||
|
"react-native/no-inline-styles": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
Platform,
|
Platform,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
|
TouchableOpacity,
|
||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
@@ -13,26 +14,30 @@ import {
|
|||||||
RectButton,
|
RectButton,
|
||||||
} from 'react-native-gesture-handler';
|
} from 'react-native-gesture-handler';
|
||||||
import {
|
import {
|
||||||
|
SupportedThemes,
|
||||||
|
ThemeColors,
|
||||||
|
ThemeContext,
|
||||||
|
Themed,
|
||||||
createAppContainer,
|
createAppContainer,
|
||||||
createStackNavigator,
|
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
import CustomTabs from './CustomTabs';
|
import { createStackNavigator } from 'react-navigation-stack';
|
||||||
import CustomTabUI from './CustomTabUI';
|
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
||||||
// import CustomTransitioner from './CustomTransitioner';
|
import CustomTabs from './src/CustomTabs';
|
||||||
import Drawer from './Drawer';
|
import CustomTabUI from './src/CustomTabUI';
|
||||||
import ModalStack from './ModalStack';
|
import Drawer from './src/Drawer';
|
||||||
import SimpleStack from './SimpleStack';
|
import ModalStack from './src/ModalStack';
|
||||||
import SimpleTabs from './SimpleTabs';
|
import SimpleStack from './src/SimpleStack';
|
||||||
import StacksInTabs from './StacksInTabs';
|
import SimpleTabs from './src/SimpleTabs';
|
||||||
import StacksOverTabs from './StacksOverTabs';
|
import StacksInTabs from './src/StacksInTabs';
|
||||||
import StacksOverTopTabs from './StacksOverTopTabs';
|
import StacksOverTabs from './src/StacksOverTabs';
|
||||||
import StacksAndKeys from './StacksAndKeys';
|
import StacksOverTopTabs from './src/StacksOverTopTabs';
|
||||||
import StackWithCustomHeaderBackImage from './StackWithCustomHeaderBackImage';
|
import StacksAndKeys from './src/StacksAndKeys';
|
||||||
import StackWithHeaderPreset from './StackWithHeaderPreset';
|
import StackWithCustomHeaderBackImage from './src/StackWithCustomHeaderBackImage';
|
||||||
import StackWithTranslucentHeader from './StackWithTranslucentHeader';
|
import StackWithHeaderPreset from './src/StackWithHeaderPreset';
|
||||||
import SwitchWithStacks from './SwitchWithStacks';
|
import StackWithTranslucentHeader from './src/StackWithTranslucentHeader';
|
||||||
import TabsInDrawer from './TabsInDrawer';
|
import SwitchWithStacks from './src/SwitchWithStacks';
|
||||||
|
import TabsInDrawer from './src/TabsInDrawer';
|
||||||
|
|
||||||
const ExampleInfo: any = {
|
const ExampleInfo: any = {
|
||||||
CustomTabUI: {
|
CustomTabUI: {
|
||||||
@@ -141,7 +146,6 @@ const ExampleInfo: any = {
|
|||||||
const ExampleRoutes: any = {
|
const ExampleRoutes: any = {
|
||||||
CustomTabUI,
|
CustomTabUI,
|
||||||
CustomTabs,
|
CustomTabs,
|
||||||
// CustomTransitioner,
|
|
||||||
Drawer,
|
Drawer,
|
||||||
ModalStack,
|
ModalStack,
|
||||||
SimpleStack,
|
SimpleStack,
|
||||||
@@ -175,6 +179,9 @@ interface State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MainScreen extends React.Component<any, State> {
|
class MainScreen extends React.Component<any, State> {
|
||||||
|
static contextType = ThemeContext;
|
||||||
|
context!: React.ContextType<typeof ThemeContext>;
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
scrollY: new Animated.Value(0),
|
scrollY: new Animated.Value(0),
|
||||||
};
|
};
|
||||||
@@ -220,7 +227,7 @@ class MainScreen extends React.Component<any, State> {
|
|||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<NativeViewGestureHandler>
|
<NativeViewGestureHandler>
|
||||||
<Animated.ScrollView
|
<Animated.ScrollView
|
||||||
style={{ flex: 1, backgroundColor: '#eee' }}
|
style={{ flex: 1, backgroundColor: ThemeColors[this.context].body }}
|
||||||
scrollEventThrottle={1}
|
scrollEventThrottle={1}
|
||||||
onScroll={Animated.event(
|
onScroll={Animated.event(
|
||||||
[
|
[
|
||||||
@@ -251,7 +258,7 @@ class MainScreen extends React.Component<any, State> {
|
|||||||
>
|
>
|
||||||
<View style={styles.banner}>
|
<View style={styles.banner}>
|
||||||
<Image
|
<Image
|
||||||
source={require('./assets/NavLogo.png')}
|
source={require('./src/assets/NavLogo.png')}
|
||||||
style={styles.bannerImage}
|
style={styles.bannerImage}
|
||||||
/>
|
/>
|
||||||
<Text style={styles.bannerTitle}>
|
<Text style={styles.bannerTitle}>
|
||||||
@@ -265,7 +272,11 @@ class MainScreen extends React.Component<any, State> {
|
|||||||
forceInset={{ top: 'never', bottom: 'always' }}
|
forceInset={{ top: 'never', bottom: 'always' }}
|
||||||
style={{ backgroundColor: '#eee' }}
|
style={{ backgroundColor: '#eee' }}
|
||||||
>
|
>
|
||||||
<View style={{ backgroundColor: '#fff' }}>
|
<View
|
||||||
|
style={{
|
||||||
|
backgroundColor: ThemeColors[this.context].bodyContent,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{Object.keys(ExampleRoutes).map((routeName: string) => (
|
{Object.keys(ExampleRoutes).map((routeName: string) => (
|
||||||
<RectButton
|
<RectButton
|
||||||
key={routeName}
|
key={routeName}
|
||||||
@@ -285,10 +296,17 @@ class MainScreen extends React.Component<any, State> {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View style={styles.item}>
|
<View
|
||||||
<Text style={styles.title}>
|
style={[
|
||||||
|
styles.item,
|
||||||
|
this.context === 'dark'
|
||||||
|
? styles.itemDark
|
||||||
|
: styles.itemLight,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Themed.Text style={styles.title}>
|
||||||
{ExampleInfo[routeName].name}
|
{ExampleInfo[routeName].name}
|
||||||
</Text>
|
</Themed.Text>
|
||||||
<Text style={styles.description}>
|
<Text style={styles.description}>
|
||||||
{ExampleInfo[routeName].description}
|
{ExampleInfo[routeName].description}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -308,7 +326,7 @@ class MainScreen extends React.Component<any, State> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppNavigator = createAppContainer(
|
const Navigation = createAppContainer(
|
||||||
createStackNavigator(
|
createStackNavigator(
|
||||||
{
|
{
|
||||||
...ExampleRoutes,
|
...ExampleRoutes,
|
||||||
@@ -329,11 +347,50 @@ const AppNavigator = createAppContainer(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
export default class App extends React.Component {
|
export default () => {
|
||||||
render() {
|
let [theme, setTheme] = React.useState<SupportedThemes>('light');
|
||||||
return <AppNavigator /* persistenceKey="if-you-want-it" */ />;
|
|
||||||
}
|
return (
|
||||||
}
|
<View style={{ flex: 1 }}>
|
||||||
|
<Navigation theme={theme} />
|
||||||
|
<View style={{ position: 'absolute', bottom: 60, right: 20 }}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => {
|
||||||
|
setTheme(theme === 'light' ? 'dark' : 'light');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
backgroundColor: ThemeColors[theme].bodyContent,
|
||||||
|
borderRadius: 25,
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
borderColor: ThemeColors[theme].bodyBorder,
|
||||||
|
borderWidth: 1,
|
||||||
|
shadowColor: ThemeColors[theme].label,
|
||||||
|
shadowOffset: {
|
||||||
|
width: 0,
|
||||||
|
height: 2,
|
||||||
|
},
|
||||||
|
shadowOpacity: 0.4,
|
||||||
|
shadowRadius: 2,
|
||||||
|
|
||||||
|
elevation: 5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MaterialCommunityIcons
|
||||||
|
name="theme-light-dark"
|
||||||
|
size={30}
|
||||||
|
color={ThemeColors[theme].label}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
backgroundUnderlay: {
|
backgroundUnderlay: {
|
||||||
@@ -371,19 +428,17 @@ const styles = StyleSheet.create({
|
|||||||
color: '#999',
|
color: '#999',
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
},
|
},
|
||||||
image: {
|
|
||||||
alignSelf: 'center',
|
|
||||||
height: 120,
|
|
||||||
marginBottom: 20,
|
|
||||||
resizeMode: 'contain',
|
|
||||||
width: 120,
|
|
||||||
},
|
|
||||||
item: {
|
item: {
|
||||||
borderBottomColor: '#ddd',
|
|
||||||
borderBottomWidth: StyleSheet.hairlineWidth,
|
borderBottomWidth: StyleSheet.hairlineWidth,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
},
|
},
|
||||||
|
itemLight: {
|
||||||
|
borderBottomColor: ThemeColors.light.bodyBorder,
|
||||||
|
},
|
||||||
|
itemDark: {
|
||||||
|
borderBottomColor: ThemeColors.dark.bodyBorder,
|
||||||
|
},
|
||||||
statusBarUnderlay: {
|
statusBarUnderlay: {
|
||||||
backgroundColor: '#673ab7',
|
backgroundColor: '#673ab7',
|
||||||
height: 20,
|
height: 20,
|
||||||
@@ -393,7 +448,6 @@ const styles = StyleSheet.create({
|
|||||||
top: 0,
|
top: 0,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
color: '#444',
|
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
@@ -5,10 +5,8 @@ The NavigationPlayground example app includes a variety of patterns and is used
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn # in the react-navigation root directory
|
yarn bootstrap # in the react-navigation root directory
|
||||||
cd examples/NavigationPlayground
|
yarn example start
|
||||||
yarn
|
|
||||||
yarn start
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can view this example application directly on Android phones by visiting scanning the QR code on [this site](https://exp.host/@react-navigation/NavigationPlayground) with the [Expo app](https://play.google.com/store/apps/details?id=host.exp.exponent&hl=en).
|
You can view this example application directly on Android phones by visiting scanning the QR code on [this site](https://exp.host/@react-navigation/NavigationPlayground) with the [Expo app](https://play.google.com/store/apps/details?id=host.exp.exponent&hl=en).
|
||||||
10
example/app.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"expo": {
|
||||||
|
"name": "React Navigation Stack Example",
|
||||||
|
"description": "Demonstrates the various capabilities of react-navigation-stack",
|
||||||
|
"slug": "react-navigation-stack-demo",
|
||||||
|
"sdkVersion": "33.0.0",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"primaryColor": "#2196f3"
|
||||||
|
}
|
||||||
|
}
|
||||||
35
example/metro.config.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/* eslint-disable import/no-extraneous-dependencies, import/no-commonjs */
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const blacklist = require('metro-config/src/defaults/blacklist');
|
||||||
|
const project = require('../package.json');
|
||||||
|
const escape = require('escape-string-regexp');
|
||||||
|
|
||||||
|
const projectDependencies = Object.keys({
|
||||||
|
...project.dependencies,
|
||||||
|
...project.peerDependencies,
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
projectRoot: __dirname,
|
||||||
|
watchFolders: [path.resolve(__dirname, '..')],
|
||||||
|
|
||||||
|
resolver: {
|
||||||
|
blacklistRE: blacklist([
|
||||||
|
new RegExp(
|
||||||
|
`^${escape(
|
||||||
|
path.resolve(__dirname, 'node_modules', project.name)
|
||||||
|
)}\\/.*$`
|
||||||
|
),
|
||||||
|
new RegExp(
|
||||||
|
`^${escape(path.resolve(__dirname, '..', 'node_modules'))}\\/.*$`
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
|
||||||
|
providesModuleNodeModules: [
|
||||||
|
'@expo/vector-icons',
|
||||||
|
'@babel/runtime',
|
||||||
|
...projectDependencies,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
37
example/package.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"name": "playground",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"main": "node_modules/expo/AppEntry.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "expo start",
|
||||||
|
"android": "expo start --android",
|
||||||
|
"ios": "expo start --ios"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@expo/vector-icons": "^10.0.0",
|
||||||
|
"@react-native-community/masked-view": "^0.1.1",
|
||||||
|
"@react-navigation/core": "^3.5.1",
|
||||||
|
"@react-navigation/native": "^3.6.2",
|
||||||
|
"expo": "^33.0.7",
|
||||||
|
"expo-asset": "^5.0.1",
|
||||||
|
"expo-blur": "~5.0.1",
|
||||||
|
"expo-constants": "~5.0.1",
|
||||||
|
"hoist-non-react-statics": "^3.3.0",
|
||||||
|
"react": "16.8.3",
|
||||||
|
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
|
||||||
|
"react-native-iphone-x-helper": "^1.2.1",
|
||||||
|
"react-native-paper": "^2.15.2",
|
||||||
|
"react-navigation-drawer": "^2.0.1",
|
||||||
|
"react-navigation-header-buttons": "^3.0.2",
|
||||||
|
"react-navigation-stack": "^1.7.2",
|
||||||
|
"react-navigation-tabs": "^1.2.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-plugin-module-resolver": "^3.2.0"
|
||||||
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"react-native-safe-area-view": "0.14.6",
|
||||||
|
"react-native-screens": "1.0.0-alpha.23"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,25 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
|
Alert,
|
||||||
|
TouchableOpacity,
|
||||||
LayoutAnimation,
|
LayoutAnimation,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
import { Ionicons } from '@expo/vector-icons';
|
||||||
import {
|
import {
|
||||||
createMaterialTopTabNavigator,
|
Themed,
|
||||||
|
ThemeContext,
|
||||||
NavigationScreenProp,
|
NavigationScreenProp,
|
||||||
NavigationState,
|
NavigationState,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
|
import {
|
||||||
|
createMaterialTopTabNavigator,
|
||||||
|
MaterialTopTabBar,
|
||||||
|
} from 'react-navigation-tabs';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -42,7 +49,7 @@ class MyHomeScreen extends React.Component<Props> {
|
|||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
return (
|
return (
|
||||||
<SafeAreaView forceInset={{ horizontal: 'always', top: 'always' }}>
|
<SafeAreaView forceInset={{ horizontal: 'always', top: 'always' }}>
|
||||||
<Text>Home Screen</Text>
|
<Themed.Text>Home Screen</Themed.Text>
|
||||||
<Button
|
<Button
|
||||||
onPress={() => navigation.navigate('Home')}
|
onPress={() => navigation.navigate('Home')}
|
||||||
title="Go to home tab"
|
title="Go to home tab"
|
||||||
@@ -53,9 +60,9 @@ class MyHomeScreen extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RecommendedScreen extends React.Component<Props> {
|
class StarredScreen extends React.Component<Props> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
tabBarLabel: 'Recommended',
|
tabBarLabel: 'Starred',
|
||||||
tabBarIcon: ({
|
tabBarIcon: ({
|
||||||
tintColor,
|
tintColor,
|
||||||
focused,
|
focused,
|
||||||
@@ -76,7 +83,7 @@ class RecommendedScreen extends React.Component<Props> {
|
|||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
return (
|
return (
|
||||||
<SafeAreaView forceInset={{ horizontal: 'always', top: 'always' }}>
|
<SafeAreaView forceInset={{ horizontal: 'always', top: 'always' }}>
|
||||||
<Text>Recommended Screen</Text>
|
<Themed.Text>Starred Screen</Themed.Text>
|
||||||
<Button
|
<Button
|
||||||
onPress={() => navigation.navigate('Home')}
|
onPress={() => navigation.navigate('Home')}
|
||||||
title="Go to home tab"
|
title="Go to home tab"
|
||||||
@@ -87,12 +94,23 @@ class RecommendedScreen extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MaterialTopTabBarProps = React.ComponentProps<typeof MaterialTopTabBar>;
|
||||||
|
|
||||||
|
class MaterialTopTabBarWrapper extends React.Component<MaterialTopTabBarProps> {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<SafeAreaView
|
||||||
|
style={{ backgroundColor: '#000' }}
|
||||||
|
forceInset={{ top: 'always', horizontal: 'never', bottom: 'never' }}
|
||||||
|
>
|
||||||
|
<MaterialTopTabBar {...this.props} />
|
||||||
|
</SafeAreaView>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FeaturedScreen extends React.Component<Props> {
|
class FeaturedScreen extends React.Component<Props> {
|
||||||
static navigationOptions = ({
|
static navigationOptions = {
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => ({
|
|
||||||
tabBarLabel: 'Featured',
|
tabBarLabel: 'Featured',
|
||||||
tabBarIcon: ({
|
tabBarIcon: ({
|
||||||
tintColor,
|
tintColor,
|
||||||
@@ -109,12 +127,13 @@ class FeaturedScreen extends React.Component<Props> {
|
|||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
});
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
return (
|
return (
|
||||||
<SafeAreaView forceInset={{ horizontal: 'always', top: 'always' }}>
|
<SafeAreaView forceInset={{ horizontal: 'always', top: 'always' }}>
|
||||||
<Text>Featured Screen</Text>
|
<Themed.Text>Featured Screen</Themed.Text>
|
||||||
<Button
|
<Button
|
||||||
onPress={() => navigation.navigate('Home')}
|
onPress={() => navigation.navigate('Home')}
|
||||||
title="Go to home tab"
|
title="Go to home tab"
|
||||||
@@ -125,13 +144,25 @@ class FeaturedScreen extends React.Component<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const SimpleTabs = createMaterialTopTabNavigator({
|
const SimpleTabs = createMaterialTopTabNavigator(
|
||||||
Home: MyHomeScreen,
|
{
|
||||||
Recommended: RecommendedScreen,
|
Home: MyHomeScreen,
|
||||||
Featured: FeaturedScreen,
|
Starred: StarredScreen,
|
||||||
});
|
Featured: FeaturedScreen,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tabBarComponent: MaterialTopTabBarWrapper,
|
||||||
|
tabBarOptions: {
|
||||||
|
style: {
|
||||||
|
backgroundColor: '#000',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
class TabNavigator extends React.Component<Props> {
|
class TabNavigator extends React.Component<Props> {
|
||||||
|
static contextType = ThemeContext;
|
||||||
|
|
||||||
static router = SimpleTabs.router;
|
static router = SimpleTabs.router;
|
||||||
componentWillUpdate() {
|
componentWillUpdate() {
|
||||||
LayoutAnimation.easeInEaseOut();
|
LayoutAnimation.easeInEaseOut();
|
||||||
@@ -143,25 +174,38 @@ class TabNavigator extends React.Component<Props> {
|
|||||||
let bottom = null;
|
let bottom = null;
|
||||||
if (activeRoute.routeName !== 'Home') {
|
if (activeRoute.routeName !== 'Home') {
|
||||||
bottom = (
|
bottom = (
|
||||||
<View style={{ height: 50, borderTopWidth: StyleSheet.hairlineWidth }}>
|
<View
|
||||||
<Button
|
style={{
|
||||||
title="Check out"
|
height: 50,
|
||||||
|
borderTopWidth: StyleSheet.hairlineWidth,
|
||||||
|
backgroundColor: this.context === 'light' ? '#000' : '#fff',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TouchableOpacity
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
Alert.alert('hello!');
|
||||||
//
|
//
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: 20,
|
||||||
|
color: this.context === 'light' ? '#fff' : '#000',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Check out
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<StatusBar barStyle="default" />
|
<StatusBar barStyle="light-content" />
|
||||||
<SafeAreaView
|
<SimpleTabs navigation={navigation} />
|
||||||
style={{ flex: 1 }}
|
|
||||||
forceInset={{ horizontal: 'always', top: 'always' }}
|
|
||||||
>
|
|
||||||
<SimpleTabs navigation={navigation} />
|
|
||||||
</SafeAreaView>
|
|
||||||
{bottom}
|
{bottom}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, StatusBar, StyleSheet, Text } from 'react-native';
|
import { ScrollView, StyleSheet } from 'react-native';
|
||||||
import { BorderlessButton } from 'react-native-gesture-handler';
|
import { BorderlessButton } from 'react-native-gesture-handler';
|
||||||
import {
|
import {
|
||||||
createNavigator,
|
createNavigator,
|
||||||
NavigationState,
|
NavigationState,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
TabRouter,
|
TabRouter,
|
||||||
|
Themed,
|
||||||
|
useTheme,
|
||||||
|
createAppContainer,
|
||||||
|
NavigationScreenProp,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
import { createAppContainer } from 'react-navigation';
|
|
||||||
import { NavigationScreenProp } from 'react-navigation';
|
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
@@ -29,7 +32,7 @@ const MyNavScreen = ({
|
|||||||
title="Go back"
|
title="Go back"
|
||||||
/>
|
/>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -65,13 +68,12 @@ const CustomTabBar = ({
|
|||||||
style={styles.tab}
|
style={styles.tab}
|
||||||
key={route.routeName}
|
key={route.routeName}
|
||||||
>
|
>
|
||||||
<Text>{route.routeName}</Text>
|
<Themed.Text>{route.routeName}</Themed.Text>
|
||||||
</BorderlessButton>
|
</BorderlessButton>
|
||||||
))}
|
))}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// @todo - how does the type definition for a custom navigator work?
|
// @todo - how does the type definition for a custom navigator work?
|
||||||
class CustomTabView extends React.Component<any> {
|
class CustomTabView extends React.Component<any> {
|
||||||
render() {
|
render() {
|
||||||
@@ -129,4 +131,9 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default CustomTabs;
|
export default () => {
|
||||||
|
// Need to thread the theme through to detached nested navigator
|
||||||
|
let theme = useTheme();
|
||||||
|
|
||||||
|
return <CustomTabs detached theme={theme} />;
|
||||||
|
};
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, StatusBar, StyleProp, TextStyle } from 'react-native';
|
import { ScrollView, StyleProp, TextStyle } from 'react-native';
|
||||||
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
import { MaterialIcons } from '@expo/vector-icons';
|
||||||
import {
|
import {
|
||||||
createDrawerNavigator,
|
Themed,
|
||||||
createStackNavigator,
|
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
|
NavigationScreenProp,
|
||||||
|
NavigationState,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
import { NavigationScreenProp, NavigationState } from 'react-navigation';
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
|
import { createDrawerNavigator } from 'react-navigation-drawer';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
@@ -27,7 +32,7 @@ const MyNavScreen = ({
|
|||||||
/>
|
/>
|
||||||
<Button onPress={() => navigation.navigate('Index')} title="Go back" />
|
<Button onPress={() => navigation.navigate('Index')} title="Go back" />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -35,22 +40,18 @@ const InboxScreen = ({
|
|||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationScreenProp<NavigationState>;
|
||||||
}) => <MyNavScreen banner={'Inbox Screen'} navigation={navigation} />;
|
}) => <MyNavScreen banner="Inbox Screen" navigation={navigation} />;
|
||||||
InboxScreen.navigationOptions = {
|
InboxScreen.navigationOptions = {
|
||||||
headerTitle: 'Inbox',
|
headerTitle: 'Inbox',
|
||||||
};
|
};
|
||||||
|
|
||||||
const EmailScreen = ({
|
const EmailScreen = ({ navigation }: NavigationStackScreenProps) => (
|
||||||
navigation,
|
<MyNavScreen banner="Email Screen" navigation={navigation} />
|
||||||
}: {
|
);
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => <MyNavScreen banner={'Email Screen'} navigation={navigation} />;
|
|
||||||
|
|
||||||
const DraftsScreen = ({
|
const DraftsScreen = ({ navigation }: NavigationStackScreenProps) => (
|
||||||
navigation,
|
<MyNavScreen banner="Drafts Screen" navigation={navigation} />
|
||||||
}: {
|
);
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => <MyNavScreen banner={'Drafts Screen'} navigation={navigation} />;
|
|
||||||
DraftsScreen.navigationOptions = {
|
DraftsScreen.navigationOptions = {
|
||||||
headerTitle: 'Drafts',
|
headerTitle: 'Drafts',
|
||||||
};
|
};
|
||||||
@@ -62,7 +63,7 @@ const InboxStack = createStackNavigator(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }: { tintColor: string }) => (
|
||||||
<MaterialIcons
|
<MaterialIcons
|
||||||
name="move-to-inbox"
|
name="move-to-inbox"
|
||||||
size={24}
|
size={24}
|
||||||
@@ -81,7 +82,7 @@ const DraftsStack = createStackNavigator(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
navigationOptions: {
|
navigationOptions: {
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }: { tintColor: string }) => (
|
||||||
<MaterialIcons
|
<MaterialIcons
|
||||||
name="drafts"
|
name="drafts"
|
||||||
size={24}
|
size={24}
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, StatusBar, Text } from 'react-native';
|
import { ScrollView } from 'react-native';
|
||||||
|
import {
|
||||||
|
NavigationScreenProp,
|
||||||
|
Themed,
|
||||||
|
SafeAreaView,
|
||||||
|
NavigationState,
|
||||||
|
} from 'react-navigation';
|
||||||
import {
|
import {
|
||||||
createStackNavigator,
|
createStackNavigator,
|
||||||
NavigationScreenProp,
|
NavigationStackScreenProps,
|
||||||
SafeAreaView,
|
} from 'react-navigation-stack';
|
||||||
} from 'react-navigation';
|
|
||||||
import { NavigationState } from 'react-navigation';
|
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
@@ -45,7 +49,7 @@ const MyNavScreen = ({
|
|||||||
)}
|
)}
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -94,16 +98,13 @@ const ProfileNavigator = createStackNavigator(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const MyHeaderTestScreen = ({
|
const MyHeaderTestScreen = ({ navigation }: NavigationStackScreenProps) => (
|
||||||
navigation,
|
<MyNavScreen banner="Full screen view" navigation={navigation} />
|
||||||
}: {
|
);
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => <MyNavScreen banner={`Full screen view`} navigation={navigation} />;
|
|
||||||
MyHeaderTestScreen.navigationOptions = ({
|
MyHeaderTestScreen.navigationOptions = ({
|
||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: NavigationStackScreenProps) => {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => {
|
|
||||||
const headerVisible =
|
const headerVisible =
|
||||||
navigation.state.params && navigation.state.params.headerVisible;
|
navigation.state.params && navigation.state.params.headerVisible;
|
||||||
return {
|
return {
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { StyleSheet, Text } from 'react-native';
|
import { StyleSheet } from 'react-native';
|
||||||
|
import { Themed } from 'react-navigation';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used across examples as a screen placeholder.
|
* Used across examples as a screen placeholder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const SampleText = ({ children }: { children?: ReactNode }) => (
|
const SampleText = ({ children }: { children?: ReactNode }) => (
|
||||||
<Text style={styles.sampleText}>{children}</Text>
|
<Themed.Text style={styles.sampleText}>{children}</Themed.Text>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default SampleText;
|
export default SampleText;
|
||||||
@@ -1,19 +1,20 @@
|
|||||||
// tslint:disable no-unused-expression
|
// tslint:disable no-unused-expression
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { StatusBar } from 'react-native';
|
|
||||||
import {
|
import {
|
||||||
createStackNavigator,
|
|
||||||
NavigationActions,
|
NavigationActions,
|
||||||
NavigationEventPayload,
|
NavigationEventPayload,
|
||||||
NavigationEventSubscription,
|
NavigationEventSubscription,
|
||||||
NavigationScreenProp,
|
|
||||||
NavigationState,
|
|
||||||
NavigationStateRoute,
|
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
StackActions,
|
StackActions,
|
||||||
|
Themed,
|
||||||
withNavigation,
|
withNavigation,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackProp,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import { HeaderButtons } from './commonComponents/HeaderButtons';
|
import { HeaderButtons } from './commonComponents/HeaderButtons';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
@@ -21,12 +22,12 @@ import SampleText from './SampleText';
|
|||||||
const DEBUG = false;
|
const DEBUG = false;
|
||||||
|
|
||||||
interface MyNavScreenProps {
|
interface MyNavScreenProps {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
banner: React.ReactNode;
|
banner: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BackButtonProps {
|
interface BackButtonProps {
|
||||||
navigation: NavigationScreenProp<NavigationStateRoute<any>>;
|
navigation: NavigationStackProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyBackButton extends React.Component<BackButtonProps, any> {
|
class MyBackButton extends React.Component<BackButtonProps, any> {
|
||||||
@@ -93,17 +94,13 @@ class MyNavScreen extends React.Component<MyNavScreenProps> {
|
|||||||
title="Go back"
|
title="Go back"
|
||||||
/>
|
/>
|
||||||
<Button onPress={() => dismiss()} title="Dismiss" />
|
<Button onPress={() => dismiss()} title="Dismiss" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MyHomeScreenProps {
|
class MyHomeScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyHomeScreen extends React.Component<MyHomeScreenProps> {
|
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: 'Welcome',
|
title: 'Welcome',
|
||||||
};
|
};
|
||||||
@@ -143,12 +140,9 @@ class MyHomeScreen extends React.Component<MyHomeScreenProps> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MyPhotosScreenProps {
|
class MyPhotosScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}
|
|
||||||
class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
|
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
headerLeft: <MyBackButtonWithNavigation />,
|
headerLeft: () => <MyBackButtonWithNavigation />,
|
||||||
title: 'Photos',
|
title: 'Photos',
|
||||||
};
|
};
|
||||||
s0: NavigationEventSubscription | null = null;
|
s0: NavigationEventSubscription | null = null;
|
||||||
@@ -195,7 +189,7 @@ class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
|
|||||||
const MyProfileScreen = ({
|
const MyProfileScreen = ({
|
||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
}) => (
|
}) => (
|
||||||
<MyNavScreen
|
<MyNavScreen
|
||||||
banner={`${
|
banner={`${
|
||||||
@@ -205,7 +199,7 @@ const MyProfileScreen = ({
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
MyProfileScreen.navigationOptions = (props: MyHomeScreenProps) => {
|
MyProfileScreen.navigationOptions = (props: NavigationStackScreenProps) => {
|
||||||
const { navigation } = props;
|
const { navigation } = props;
|
||||||
const { state, setParams } = navigation;
|
const { state, setParams } = navigation;
|
||||||
const { params } = state;
|
const { params } = state;
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Animated, Platform, StatusBar, Text, View } from 'react-native';
|
import { Ionicons } from '@expo/vector-icons';
|
||||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
||||||
import {
|
import {
|
||||||
createBottomTabNavigator,
|
|
||||||
FlatList,
|
FlatList,
|
||||||
NavigationEventSubscription,
|
NavigationEventSubscription,
|
||||||
NavigationScreenProp,
|
NavigationScreenProp,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
|
Themed,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
|
NavigationEventPayload,
|
||||||
|
NavigationState,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
import { NavigationEventPayload, NavigationState } from 'react-navigation';
|
import { createBottomTabNavigator } from 'react-navigation-tabs';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
@@ -37,28 +38,29 @@ const MyNavScreen = ({
|
|||||||
/>
|
/>
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
{TEXT.split('\n').map((p, n) => (
|
{TEXT.split('\n').map((p, n) => (
|
||||||
<Text key={n} style={{ marginVertical: 10, marginHorizontal: 8 }}>
|
<Themed.Text
|
||||||
|
key={n}
|
||||||
|
style={{ marginVertical: 10, marginHorizontal: 8 }}
|
||||||
|
>
|
||||||
{p}
|
{p}
|
||||||
</Text>
|
</Themed.Text>
|
||||||
))}
|
))}
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
|
|
||||||
const MyListScreen = ({
|
const MyListScreen = () => (
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => (
|
|
||||||
<FlatList
|
<FlatList
|
||||||
data={TEXT.split('\n')}
|
data={TEXT.split('\n')}
|
||||||
style={{ paddingTop: 10 }}
|
style={{ paddingTop: 10 }}
|
||||||
keyExtractor={(item, index) => index.toString()}
|
keyExtractor={(_, index) => index.toString()}
|
||||||
renderItem={({ item }) => (
|
renderItem={({ item }) => (
|
||||||
<Text style={{ fontSize: 16, marginVertical: 10, marginHorizontal: 8 }}>
|
<Themed.Text
|
||||||
|
style={{ fontSize: 16, marginVertical: 10, marginHorizontal: 8 }}
|
||||||
|
>
|
||||||
{item}
|
{item}
|
||||||
</Text>
|
</Themed.Text>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -72,7 +74,6 @@ const MyHomeScreen = ({
|
|||||||
MyHomeScreen.navigationOptions = {
|
MyHomeScreen.navigationOptions = {
|
||||||
tabBarIcon: ({
|
tabBarIcon: ({
|
||||||
tintColor,
|
tintColor,
|
||||||
focused,
|
|
||||||
horizontal,
|
horizontal,
|
||||||
}: {
|
}: {
|
||||||
tintColor: string;
|
tintColor: string;
|
||||||
@@ -80,7 +81,7 @@ MyHomeScreen.navigationOptions = {
|
|||||||
horizontal: boolean;
|
horizontal: boolean;
|
||||||
}) => (
|
}) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={'ios-home'}
|
name="ios-home"
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -100,7 +101,6 @@ class MyPeopleScreen extends React.Component<MyPeopleScreenProps> {
|
|||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
tabBarIcon: ({
|
tabBarIcon: ({
|
||||||
tintColor,
|
tintColor,
|
||||||
focused,
|
|
||||||
horizontal,
|
horizontal,
|
||||||
}: {
|
}: {
|
||||||
tintColor: string;
|
tintColor: string;
|
||||||
@@ -108,7 +108,7 @@ class MyPeopleScreen extends React.Component<MyPeopleScreenProps> {
|
|||||||
horizontal: boolean;
|
horizontal: boolean;
|
||||||
}) => (
|
}) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={'ios-people'}
|
name="ios-people"
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -147,7 +147,6 @@ class MyChatScreen extends React.Component<MyChatScreenProps> {
|
|||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
tabBarIcon: ({
|
tabBarIcon: ({
|
||||||
tintColor,
|
tintColor,
|
||||||
focused,
|
|
||||||
horizontal,
|
horizontal,
|
||||||
}: {
|
}: {
|
||||||
tintColor: string;
|
tintColor: string;
|
||||||
@@ -155,7 +154,7 @@ class MyChatScreen extends React.Component<MyChatScreenProps> {
|
|||||||
horizontal: boolean;
|
horizontal: boolean;
|
||||||
}) => (
|
}) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={'ios-chatboxes'}
|
name="ios-chatboxes"
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -196,7 +195,6 @@ const MySettingsScreen = ({
|
|||||||
MySettingsScreen.navigationOptions = {
|
MySettingsScreen.navigationOptions = {
|
||||||
tabBarIcon: ({
|
tabBarIcon: ({
|
||||||
tintColor,
|
tintColor,
|
||||||
focused,
|
|
||||||
horizontal,
|
horizontal,
|
||||||
}: {
|
}: {
|
||||||
tintColor: string;
|
tintColor: string;
|
||||||
@@ -204,7 +202,7 @@ MySettingsScreen.navigationOptions = {
|
|||||||
horizontal: boolean;
|
horizontal: boolean;
|
||||||
}) => (
|
}) => (
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={'ios-settings'}
|
name="ios-settings"
|
||||||
size={horizontal ? 20 : 26}
|
size={horizontal ? 20 : 26}
|
||||||
style={{ color: tintColor }}
|
style={{ color: tintColor }}
|
||||||
/>
|
/>
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Button, Image, StatusBar, StyleSheet } from 'react-native';
|
import { Button, Image, StyleSheet } from 'react-native';
|
||||||
import {
|
import {
|
||||||
createStackNavigator,
|
|
||||||
NavigationScreenProp,
|
NavigationScreenProp,
|
||||||
NavigationState,
|
NavigationState,
|
||||||
|
Themed,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
interface MyNavScreenProps {
|
interface MyNavScreenProps {
|
||||||
@@ -36,7 +40,7 @@ class MyNavScreen extends React.Component<MyNavScreenProps> {
|
|||||||
title="Navigate to a photos screen"
|
title="Navigate to a photos screen"
|
||||||
/>
|
/>
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -81,7 +85,7 @@ class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
|
|||||||
title="Navigate to a profile screen"
|
title="Navigate to a profile screen"
|
||||||
/>
|
/>
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -91,12 +95,9 @@ interface MyProfileScreenProps {
|
|||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationScreenProp<NavigationState>;
|
||||||
}
|
}
|
||||||
class MyProfileScreen extends React.Component<MyProfileScreenProps> {
|
class MyProfileScreen extends React.Component<MyProfileScreenProps> {
|
||||||
static navigationOptions = () => ({
|
static navigationOptions = {
|
||||||
headerBackImage: (
|
|
||||||
<MyCustomHeaderBackImage style={styles.myCustomHeaderBackImageAlt} />
|
|
||||||
),
|
|
||||||
title: 'Profile',
|
title: 'Profile',
|
||||||
});
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
@@ -104,7 +105,7 @@ class MyProfileScreen extends React.Component<MyProfileScreenProps> {
|
|||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<SampleText>{`${navigation.state.params!.name}'s Profile`}</SampleText>
|
<SampleText>{`${navigation.state.params!.name}'s Profile`}</SampleText>
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -125,9 +126,18 @@ const StackWithCustomHeaderBackImage = createStackNavigator(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
defaultNavigationOptions: {
|
defaultNavigationOptions: ({ theme }: NavigationStackScreenProps) => ({
|
||||||
headerBackImage: MyCustomHeaderBackImage as any,
|
headerBackImage: () => (
|
||||||
},
|
<MyCustomHeaderBackImage
|
||||||
|
style={[
|
||||||
|
styles.myCustomHeaderBackImageAlt,
|
||||||
|
{
|
||||||
|
tintColor: theme === 'light' ? '#000' : '#fff',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -142,7 +152,5 @@ const styles = StyleSheet.create({
|
|||||||
resizeMode: 'contain',
|
resizeMode: 'contain',
|
||||||
width: 24,
|
width: 24,
|
||||||
},
|
},
|
||||||
myCustomHeaderBackImageAlt: {
|
myCustomHeaderBackImageAlt: {},
|
||||||
tintColor: '#f00',
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
@@ -1,19 +1,13 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { StatusBar } from 'react-native';
|
import { SafeAreaView, Themed } from 'react-navigation';
|
||||||
import {
|
import {
|
||||||
createStackNavigator,
|
createStackNavigator,
|
||||||
NavigationScreenProp,
|
NavigationStackScreenProps,
|
||||||
NavigationState,
|
} from 'react-navigation-stack';
|
||||||
SafeAreaView,
|
|
||||||
} from 'react-navigation';
|
|
||||||
|
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
|
|
||||||
interface NavScreenProps {
|
class HomeScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}
|
|
||||||
|
|
||||||
class HomeScreen extends React.Component<NavScreenProps> {
|
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: 'Welcome',
|
title: 'Welcome',
|
||||||
};
|
};
|
||||||
@@ -30,13 +24,13 @@ class HomeScreen extends React.Component<NavScreenProps> {
|
|||||||
title="Push screen with no header"
|
title="Push screen with no header"
|
||||||
/>
|
/>
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go Home" />
|
<Button onPress={() => navigation.goBack(null)} title="Go Home" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OtherScreen extends React.Component<NavScreenProps> {
|
class OtherScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: 'Your title here',
|
title: 'Your title here',
|
||||||
};
|
};
|
||||||
@@ -57,13 +51,13 @@ class OtherScreen extends React.Component<NavScreenProps> {
|
|||||||
/>
|
/>
|
||||||
<Button onPress={() => pop()} title="Pop" />
|
<Button onPress={() => pop()} title="Pop" />
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ScreenWithLongTitle extends React.Component<NavScreenProps> {
|
class ScreenWithLongTitle extends React.Component<NavigationStackScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: "Another title that's kind of long",
|
title: "Another title that's kind of long",
|
||||||
};
|
};
|
||||||
@@ -76,13 +70,13 @@ class ScreenWithLongTitle extends React.Component<NavScreenProps> {
|
|||||||
<SafeAreaView style={{ paddingTop: 30 }}>
|
<SafeAreaView style={{ paddingTop: 30 }}>
|
||||||
<Button onPress={() => pop()} title="Pop" />
|
<Button onPress={() => pop()} title="Pop" />
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ScreenWithNoHeader extends React.Component<NavScreenProps> {
|
class ScreenWithNoHeader extends React.Component<NavigationStackScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
header: null,
|
header: null,
|
||||||
title: 'No Header',
|
title: 'No Header',
|
||||||
@@ -97,7 +91,7 @@ class ScreenWithNoHeader extends React.Component<NavScreenProps> {
|
|||||||
<Button onPress={() => push('Other')} title="Push another screen" />
|
<Button onPress={() => push('Other')} title="Push another screen" />
|
||||||
<Button onPress={() => pop()} title="Pop" />
|
<Button onPress={() => pop()} title="Pop" />
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,29 +1,26 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {
|
import { Platform, ScrollView, StyleSheet, View } from 'react-native';
|
||||||
Platform,
|
import { BlurView } from 'expo-blur';
|
||||||
ScrollView,
|
|
||||||
StatusBar,
|
|
||||||
StyleSheet,
|
|
||||||
View,
|
|
||||||
} from 'react-native';
|
|
||||||
import { BlurView } from 'react-native-blur';
|
|
||||||
import { isIphoneX } from 'react-native-iphone-x-helper';
|
import { isIphoneX } from 'react-native-iphone-x-helper';
|
||||||
|
import {
|
||||||
|
NavigationEventPayload,
|
||||||
|
NavigationEventSubscription,
|
||||||
|
Themed,
|
||||||
|
SupportedThemes,
|
||||||
|
} from 'react-navigation';
|
||||||
import {
|
import {
|
||||||
createStackNavigator,
|
createStackNavigator,
|
||||||
Header,
|
Header,
|
||||||
HeaderStyleInterpolator,
|
HeaderStyleInterpolator,
|
||||||
NavigationEventPayload,
|
NavigationStackScreenProps,
|
||||||
NavigationEventSubscription,
|
NavigationStackProp,
|
||||||
NavigationScreenProp,
|
} from 'react-navigation-stack';
|
||||||
NavigationState,
|
|
||||||
TransitionConfig,
|
|
||||||
} from 'react-navigation';
|
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import { HeaderButtons } from './commonComponents/HeaderButtons';
|
import { HeaderButtons } from './commonComponents/HeaderButtons';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
interface MyNavScreenProps {
|
interface MyNavScreenProps {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
banner: React.ReactNode;
|
banner: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +46,7 @@ class MyNavScreen extends React.Component<MyNavScreenProps> {
|
|||||||
<Button onPress={() => popToTop()} title="Pop to top" />
|
<Button onPress={() => popToTop()} title="Pop to top" />
|
||||||
<Button onPress={() => pop()} title="Pop" />
|
<Button onPress={() => pop()} title="Pop" />
|
||||||
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
<Button onPress={() => navigation.goBack(null)} title="Go back" />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -84,7 +81,7 @@ class MyNavScreen extends React.Component<MyNavScreenProps> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface MyHomeScreenProps {
|
interface MyHomeScreenProps {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyHomeScreen extends React.Component<MyHomeScreenProps> {
|
class MyHomeScreen extends React.Component<MyHomeScreenProps> {
|
||||||
@@ -128,7 +125,7 @@ class MyHomeScreen extends React.Component<MyHomeScreenProps> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface MyPhotosScreenProps {
|
interface MyPhotosScreenProps {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
}
|
}
|
||||||
class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
|
class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
@@ -178,7 +175,7 @@ class MyPhotosScreen extends React.Component<MyPhotosScreenProps> {
|
|||||||
const MyProfileScreen = ({
|
const MyProfileScreen = ({
|
||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
}) => (
|
}) => (
|
||||||
<MyNavScreen
|
<MyNavScreen
|
||||||
banner={`${navigation.state.params!.mode === 'edit' ? 'Now Editing ' : ''}${
|
banner={`${navigation.state.params!.mode === 'edit' ? 'Now Editing ' : ''}${
|
||||||
@@ -189,9 +186,10 @@ const MyProfileScreen = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
MyProfileScreen.navigationOptions = (props: {
|
MyProfileScreen.navigationOptions = (props: {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
|
theme: SupportedThemes;
|
||||||
}) => {
|
}) => {
|
||||||
const { navigation } = props;
|
const { navigation, theme } = props;
|
||||||
const { state, setParams } = navigation;
|
const { state, setParams } = navigation;
|
||||||
const { params } = state;
|
const { params } = state;
|
||||||
return {
|
return {
|
||||||
@@ -201,6 +199,7 @@ MyProfileScreen.navigationOptions = (props: {
|
|||||||
headerRight: (
|
headerRight: (
|
||||||
<HeaderButtons>
|
<HeaderButtons>
|
||||||
<HeaderButtons.Item
|
<HeaderButtons.Item
|
||||||
|
color={theme === 'light' ? '#000' : '#fff'}
|
||||||
title={params!.mode === 'edit' ? 'Done' : 'Edit'}
|
title={params!.mode === 'edit' ? 'Done' : 'Edit'}
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
setParams({ mode: params!.mode === 'edit' ? '' : 'edit' })
|
setParams({ mode: params!.mode === 'edit' ? '' : 'edit' })
|
||||||
@@ -227,27 +226,29 @@ const StackWithTranslucentHeader = createStackNavigator(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
defaultNavigationOptions: {
|
defaultNavigationOptions: ({ theme }: NavigationStackScreenProps) => ({
|
||||||
headerBackground: Platform.select({
|
headerBackground:
|
||||||
android: (
|
Platform.OS === 'ios' ? (
|
||||||
|
<BlurView
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
blurType={theme === 'light' ? 'light' : 'dark'}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
<View style={{ flex: 1, backgroundColor: 'rgba(255,255,255,0.7)' }} />
|
<View style={{ flex: 1, backgroundColor: 'rgba(255,255,255,0.7)' }} />
|
||||||
),
|
),
|
||||||
ios: <BlurView style={{ flex: 1 }} blurType="light" />,
|
|
||||||
}),
|
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
borderBottomColor: '#A7A7AA',
|
borderBottomColor: theme === 'light' ? '#A7A7AA' : 'transparent',
|
||||||
borderBottomWidth: StyleSheet.hairlineWidth,
|
borderBottomWidth: StyleSheet.hairlineWidth,
|
||||||
},
|
},
|
||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
},
|
}),
|
||||||
headerTransitionPreset: 'uikit',
|
headerTransitionPreset: 'uikit',
|
||||||
// You can leave this out if you don't want the card shadow to
|
// You can leave this out if you don't want the card shadow to
|
||||||
// be visible through the header
|
// be visible through the header
|
||||||
transitionConfig: () =>
|
transitionConfig: () => ({
|
||||||
({
|
headerBackgroundInterpolator:
|
||||||
headerBackgroundInterpolator:
|
HeaderStyleInterpolator.forBackgroundWithTranslation,
|
||||||
HeaderStyleInterpolator.forBackgroundWithTranslation,
|
}),
|
||||||
} as TransitionConfig),
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StatusBar, Text, View } from 'react-native';
|
import { Text, View } from 'react-native';
|
||||||
import { createStackNavigator, NavigationScreenProp } from 'react-navigation';
|
import { Themed } from 'react-navigation';
|
||||||
import { NavigationState } from 'react-navigation';
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
|
|
||||||
interface Props {
|
class HomeScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
navigation: NavigationScreenProp<NavigationState & any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
class HomeScreen extends React.Component<Props, any> {
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
||||||
@@ -27,15 +26,18 @@ class HomeScreen extends React.Component<Props, any> {
|
|||||||
title="Go back to other examples"
|
title="Go back to other examples"
|
||||||
onPress={() => this.props.navigation.goBack(null)}
|
onPress={() => this.props.navigation.goBack(null)}
|
||||||
/>
|
/>
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProfileScreen extends React.Component<any, any> {
|
class ProfileScreen extends React.Component<
|
||||||
|
NavigationStackScreenProps<{ homeKey: string }>
|
||||||
|
> {
|
||||||
render() {
|
render() {
|
||||||
const { homeKey } = this.props.navigation.state.params;
|
const homeKey = this.props.navigation.getParam('homeKey');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
||||||
<Text>Profile</Text>
|
<Text>Profile</Text>
|
||||||
@@ -60,7 +62,7 @@ class ProfileScreen extends React.Component<any, any> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SettingsScreen extends React.Component<Props, any> {
|
class SettingsScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
render() {
|
render() {
|
||||||
const { homeKey } = this.props.navigation.state.params!;
|
const { homeKey } = this.props.navigation.state.params!;
|
||||||
|
|
||||||
@@ -1,15 +1,19 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StatusBar, Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
import {
|
import {
|
||||||
createBottomTabNavigator,
|
Themed,
|
||||||
createStackNavigator,
|
|
||||||
NavigationScreenProp,
|
NavigationScreenProp,
|
||||||
NavigationState,
|
NavigationState,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
|
import {
|
||||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
NavigationStackProp,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
|
import { createBottomTabNavigator } from 'react-navigation-tabs';
|
||||||
|
import { Ionicons } from '@expo/vector-icons';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
@@ -19,7 +23,7 @@ Nulla convallis pulvinar hendrerit. Nulla mattis sem et aliquam ultrices. Nam eg
|
|||||||
Praesent lobortis elit sit amet mauris pulvinar, viverra condimentum massa pellentesque. Curabitur massa ex, dignissim eget neque at, fringilla consectetur justo. Cras sollicitudin vel ligula sed cursus. Aliquam porta sem hendrerit diam porta ultricies. Sed eu mi erat. Curabitur id justo vel tortor hendrerit vestibulum id eget est. Morbi eros magna, placerat id diam ut, varius sollicitudin mi. Curabitur pretium finibus accumsan.`;
|
Praesent lobortis elit sit amet mauris pulvinar, viverra condimentum massa pellentesque. Curabitur massa ex, dignissim eget neque at, fringilla consectetur justo. Cras sollicitudin vel ligula sed cursus. Aliquam porta sem hendrerit diam porta ultricies. Sed eu mi erat. Curabitur id justo vel tortor hendrerit vestibulum id eget est. Morbi eros magna, placerat id diam ut, varius sollicitudin mi. Curabitur pretium finibus accumsan.`;
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
navigation: NavigationStackProp;
|
||||||
banner: string;
|
banner: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,17 +57,13 @@ class MyNavScreen extends React.Component<Props> {
|
|||||||
))}
|
))}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const MyProfileScreen = ({
|
const MyProfileScreen = ({ navigation }: NavigationStackScreenProps) => (
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => (
|
|
||||||
<MyNavScreen
|
<MyNavScreen
|
||||||
banner={`${navigation.state.params!.name}s Profile`}
|
banner={`${navigation.state.params!.name}s Profile`}
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
@@ -1,14 +1,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ScrollView, StatusBar } from 'react-native';
|
import { ScrollView, StatusBar } from 'react-native';
|
||||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
import { Ionicons } from '@expo/vector-icons';
|
||||||
import {
|
import {
|
||||||
createBottomTabNavigator,
|
|
||||||
createStackNavigator,
|
|
||||||
getActiveChildNavigationOptions,
|
getActiveChildNavigationOptions,
|
||||||
NavigationScreenProp,
|
NavigationScreenProp,
|
||||||
NavigationState,
|
NavigationState,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
|
import { createBottomTabNavigator } from 'react-navigation-tabs';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
|
|
||||||
@@ -59,9 +62,9 @@ const MyProfileScreen = ({
|
|||||||
|
|
||||||
const MyNotificationsSettingsScreen = ({
|
const MyNotificationsSettingsScreen = ({
|
||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: NavigationStackScreenProps) => (
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
<MyNavScreen banner="Notifications Screen" navigation={navigation} />
|
||||||
}) => <MyNavScreen banner="Notifications Screen" navigation={navigation} />;
|
);
|
||||||
|
|
||||||
const MySettingsScreen = ({
|
const MySettingsScreen = ({
|
||||||
navigation,
|
navigation,
|
||||||
@@ -141,11 +144,7 @@ const StacksOverTabs = createStackNavigator({
|
|||||||
screen: MyNotificationsSettingsScreen,
|
screen: MyNotificationsSettingsScreen,
|
||||||
},
|
},
|
||||||
Profile: {
|
Profile: {
|
||||||
navigationOptions: ({
|
navigationOptions: ({ navigation }: NavigationStackScreenProps) => ({
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => ({
|
|
||||||
title: `${navigation.state.params!.name}'s Profile!`,
|
title: `${navigation.state.params!.name}'s Profile!`,
|
||||||
}),
|
}),
|
||||||
path: '/people/:name',
|
path: '/people/:name',
|
||||||
@@ -7,13 +7,18 @@ import {
|
|||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {
|
import {
|
||||||
createMaterialTopTabNavigator,
|
|
||||||
createStackNavigator,
|
|
||||||
NavigationScreenProp,
|
NavigationScreenProp,
|
||||||
NavigationState,
|
NavigationState,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from 'react-navigation';
|
} from 'react-navigation';
|
||||||
import { MaterialTopTabBar } from 'react-navigation-tabs';
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
|
import {
|
||||||
|
createMaterialTopTabNavigator,
|
||||||
|
MaterialTopTabBar,
|
||||||
|
} from 'react-navigation-tabs';
|
||||||
|
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
import SampleText from './SampleText';
|
import SampleText from './SampleText';
|
||||||
@@ -62,11 +67,7 @@ const MyHomeScreen = ({
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
const MyProfileScreen = ({
|
const MyProfileScreen = ({ navigation }: NavigationStackScreenProps) => (
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => (
|
|
||||||
<MyNavScreen
|
<MyNavScreen
|
||||||
banner={`${navigation.state.params!.name}s Profile`}
|
banner={`${navigation.state.params!.name}s Profile`}
|
||||||
navigation={navigation}
|
navigation={navigation}
|
||||||
@@ -75,9 +76,9 @@ const MyProfileScreen = ({
|
|||||||
|
|
||||||
const MyNotificationsSettingsScreen = ({
|
const MyNotificationsSettingsScreen = ({
|
||||||
navigation,
|
navigation,
|
||||||
}: {
|
}: NavigationStackScreenProps) => (
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
<MyNavScreen banner="Notifications Screen" navigation={navigation} />
|
||||||
}) => <MyNavScreen banner="Notifications Screen" navigation={navigation} />;
|
);
|
||||||
|
|
||||||
const MySettingsScreen = ({
|
const MySettingsScreen = ({
|
||||||
navigation,
|
navigation,
|
||||||
@@ -157,11 +158,7 @@ const StackNavigator = createStackNavigator(
|
|||||||
},
|
},
|
||||||
Profile: {
|
Profile: {
|
||||||
screen: MyProfileScreen,
|
screen: MyProfileScreen,
|
||||||
navigationOptions: ({
|
navigationOptions: ({ navigation }: NavigationStackScreenProps) => ({
|
||||||
navigation,
|
|
||||||
}: {
|
|
||||||
navigation: NavigationScreenProp<NavigationState>;
|
|
||||||
}) => ({
|
|
||||||
title: `${navigation.state.params!.name}'s Profile!`,
|
title: `${navigation.state.params!.name}'s Profile!`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@@ -2,15 +2,18 @@ import React from 'react';
|
|||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
AsyncStorage,
|
AsyncStorage,
|
||||||
StatusBar,
|
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
View,
|
View,
|
||||||
Platform,
|
Platform,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { createStackNavigator, createSwitchNavigator } from 'react-navigation';
|
import { Themed, createSwitchNavigator } from 'react-navigation';
|
||||||
|
import {
|
||||||
|
createStackNavigator,
|
||||||
|
NavigationStackScreenProps,
|
||||||
|
} from 'react-navigation-stack';
|
||||||
import { Button } from './commonComponents/ButtonWithMargin';
|
import { Button } from './commonComponents/ButtonWithMargin';
|
||||||
|
|
||||||
class SignInScreen extends React.Component<any, any> {
|
class SignInScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: 'Please sign in',
|
title: 'Please sign in',
|
||||||
};
|
};
|
||||||
@@ -23,7 +26,7 @@ class SignInScreen extends React.Component<any, any> {
|
|||||||
title="Go back to other examples"
|
title="Go back to other examples"
|
||||||
onPress={() => this.props.navigation.goBack(null)}
|
onPress={() => this.props.navigation.goBack(null)}
|
||||||
/>
|
/>
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -34,7 +37,7 @@ class SignInScreen extends React.Component<any, any> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class HomeScreen extends React.Component<any, any> {
|
class HomeScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: 'Welcome to the app!',
|
title: 'Welcome to the app!',
|
||||||
};
|
};
|
||||||
@@ -44,7 +47,7 @@ class HomeScreen extends React.Component<any, any> {
|
|||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Button title="Show me more of the app" onPress={this.showMoreApp} />
|
<Button title="Show me more of the app" onPress={this.showMoreApp} />
|
||||||
<Button title="Actually, sign me out :)" onPress={this.signOutAsync} />
|
<Button title="Actually, sign me out :)" onPress={this.signOutAsync} />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -54,12 +57,17 @@ class HomeScreen extends React.Component<any, any> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
signOutAsync = async () => {
|
signOutAsync = async () => {
|
||||||
Platform.OS === 'ios' ? await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove) : await AsyncStorage.clear()
|
if (Platform.OS === 'ios') {
|
||||||
|
await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove);
|
||||||
|
} else {
|
||||||
|
await AsyncStorage.clear();
|
||||||
|
}
|
||||||
|
|
||||||
this.props.navigation.navigate('Auth');
|
this.props.navigation.navigate('Auth');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class OtherScreen extends React.Component<any, any> {
|
class OtherScreen extends React.Component<NavigationStackScreenProps> {
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
title: 'Lots of features here',
|
title: 'Lots of features here',
|
||||||
};
|
};
|
||||||
@@ -68,13 +76,18 @@ class OtherScreen extends React.Component<any, any> {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Button title="I'm done, sign me out" onPress={this.signOutAsync} />
|
<Button title="I'm done, sign me out" onPress={this.signOutAsync} />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
signOutAsync = async () => {
|
signOutAsync = async () => {
|
||||||
Platform.OS === 'ios' ? await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove) : await AsyncStorage.clear()
|
if (Platform.OS === 'ios') {
|
||||||
|
await AsyncStorage.getAllKeys().then(AsyncStorage.multiRemove);
|
||||||
|
} else {
|
||||||
|
await AsyncStorage.clear();
|
||||||
|
}
|
||||||
|
|
||||||
this.props.navigation.navigate('Auth');
|
this.props.navigation.navigate('Auth');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -94,7 +107,7 @@ class LoadingScreen extends React.Component<any, any> {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<ActivityIndicator />
|
<ActivityIndicator />
|
||||||
<StatusBar barStyle="default" />
|
<Themed.StatusBar />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Platform, ScrollView } from 'react-native';
|
import { MaterialIcons } from '@expo/vector-icons';
|
||||||
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
import { createDrawerNavigator } from 'react-navigation-drawer';
|
||||||
import { createDrawerNavigator } from 'react-navigation';
|
|
||||||
import SimpleTabs from './SimpleTabs';
|
import SimpleTabs from './SimpleTabs';
|
||||||
import StacksOverTabs from './StacksOverTabs';
|
import StacksOverTabs from './StacksOverTabs';
|
||||||
|
|
||||||
BIN
example/src/assets/NavLogo.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
example/src/assets/back.png
Normal file
|
After Width: | Height: | Size: 939 B |
BIN
example/src/assets/dog-back.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
example/src/assets/icon.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
example/src/assets/splash.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
@@ -1,42 +1,49 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { AccessibilityState, Platform, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
import {
|
||||||
|
AccessibilityStates,
|
||||||
|
Platform,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
|
||||||
export interface ButtonProps {
|
export interface ButtonProps {
|
||||||
/**
|
/**
|
||||||
* Text to display inside the button
|
* Text to display inside the button
|
||||||
*/
|
*/
|
||||||
title: string,
|
title: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to be called when the user taps the button
|
* Handler to be called when the user taps the button
|
||||||
*/
|
*/
|
||||||
onPress: (event?: any) => void,
|
onPress: (event?: any) => void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color of the text (iOS), or background color of the button (Android)
|
* Color of the text (iOS), or background color of the button (Android)
|
||||||
*/
|
*/
|
||||||
color?: string,
|
color?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TV preferred focus (see documentation for the View component).
|
* TV preferred focus (see documentation for the View component).
|
||||||
*/
|
*/
|
||||||
hasTVPreferredFocus?: boolean,
|
hasTVPreferredFocus?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Text to display for blindness accessibility features
|
* Text to display for blindness accessibility features
|
||||||
*/
|
*/
|
||||||
accessibilityLabel?: string,
|
accessibilityLabel?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true, disable all interactions for this component.
|
* If true, disable all interactions for this component.
|
||||||
*/
|
*/
|
||||||
disabled?: boolean,
|
disabled?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to locate this view in end-to-end tests.
|
* Used to locate this view in end-to-end tests.
|
||||||
*/
|
*/
|
||||||
testID?: string,
|
testID?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A basic button component that should render nicely on any platform. Supports
|
* A basic button component that should render nicely on any platform. Supports
|
||||||
@@ -81,7 +88,7 @@ export default class Button extends React.Component<ButtonProps> {
|
|||||||
buttonStyles.push({ backgroundColor: color });
|
buttonStyles.push({ backgroundColor: color });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const accessibilityStates: AccessibilityState[] = [];
|
const accessibilityStates: AccessibilityStates[] = [];
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
buttonStyles.push(styles.buttonDisabled);
|
buttonStyles.push(styles.buttonDisabled);
|
||||||
textStyles.push(styles.textDisabled);
|
textStyles.push(styles.textDisabled);
|
||||||
@@ -99,9 +106,7 @@ export default class Button extends React.Component<ButtonProps> {
|
|||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
>
|
>
|
||||||
<View style={buttonStyles}>
|
<View style={buttonStyles}>
|
||||||
<Text style={textStyles}>
|
<Text style={textStyles}>{formattedTitle}</Text>
|
||||||
{formattedTitle}
|
|
||||||
</Text>
|
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
);
|
);
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Platform, StyleSheet, View } from 'react-native';
|
import { Platform, StyleSheet, View } from 'react-native';
|
||||||
import BaseButton, { ButtonProps } from './Button';
|
import BaseButton, { ButtonProps } from './Button';
|
||||||
|
|
||||||
export const Button = (props: ButtonProps) => (
|
export const Button = (props: ButtonProps) => (
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import DefaultHeaderButtons from 'react-navigation-header-buttons';
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Platform } from 'react-native';
|
import {
|
||||||
|
HeaderButtons as DefaultHeaderButtons,
|
||||||
|
Item,
|
||||||
|
} from 'react-navigation-header-buttons';
|
||||||
|
|
||||||
export class HeaderButtons extends React.PureComponent {
|
export class HeaderButtons extends React.PureComponent {
|
||||||
static Item = DefaultHeaderButtons.Item;
|
static Item = Item;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": ["module:metro-react-native-babel-preset"]
|
|
||||||
}
|
|
||||||
1
examples/NavigationPlayground/.gitattributes
vendored
@@ -1 +0,0 @@
|
|||||||
*.pbxproj -text
|
|
||||||
60
examples/NavigationPlayground/.gitignore
vendored
@@ -1,60 +0,0 @@
|
|||||||
# OSX
|
|
||||||
#
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Xcode
|
|
||||||
#
|
|
||||||
build/
|
|
||||||
*.pbxuser
|
|
||||||
!default.pbxuser
|
|
||||||
*.mode1v3
|
|
||||||
!default.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
!default.mode2v3
|
|
||||||
*.perspectivev3
|
|
||||||
!default.perspectivev3
|
|
||||||
xcuserdata
|
|
||||||
*.xccheckout
|
|
||||||
*.moved-aside
|
|
||||||
DerivedData
|
|
||||||
*.hmap
|
|
||||||
*.ipa
|
|
||||||
*.xcuserstate
|
|
||||||
project.xcworkspace
|
|
||||||
|
|
||||||
# Android/IntelliJ
|
|
||||||
#
|
|
||||||
build/
|
|
||||||
.idea
|
|
||||||
.gradle
|
|
||||||
local.properties
|
|
||||||
*.iml
|
|
||||||
|
|
||||||
# Visual Studio Code
|
|
||||||
#
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
# node.js
|
|
||||||
#
|
|
||||||
node_modules/
|
|
||||||
npm-debug.log
|
|
||||||
yarn-error.log
|
|
||||||
|
|
||||||
# BUCK
|
|
||||||
buck-out/
|
|
||||||
\.buckd/
|
|
||||||
*.keystore
|
|
||||||
|
|
||||||
# fastlane
|
|
||||||
#
|
|
||||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
|
||||||
# screenshots whenever they are needed.
|
|
||||||
# For more information about the recommended setup visit:
|
|
||||||
# https://docs.fastlane.tools/best-practices/source-control/
|
|
||||||
|
|
||||||
*/fastlane/report.xml
|
|
||||||
*/fastlane/Preview.html
|
|
||||||
*/fastlane/screenshots
|
|
||||||
|
|
||||||
# Bundle artifact
|
|
||||||
*.jsbundle
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>NavigationPlayground</name>
|
|
||||||
<comment>Project NavigationPlayground created by Buildship.</comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
connection.project.dir=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
|
||||||
<classpathentry kind="output" path="bin/default"/>
|
|
||||||
</classpath>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>app</name>
|
|
||||||
<comment>Project app created by Buildship.</comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
connection.project.dir=..
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
# To learn about Buck see [Docs](https://buckbuild.com/).
|
|
||||||
# To run your application with Buck:
|
|
||||||
# - install Buck
|
|
||||||
# - `npm start` - to start the packager
|
|
||||||
# - `cd android`
|
|
||||||
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
|
|
||||||
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
|
|
||||||
# - `buck install -r android/app` - compile, install and run application
|
|
||||||
#
|
|
||||||
|
|
||||||
lib_deps = []
|
|
||||||
|
|
||||||
for jarfile in glob(['libs/*.jar']):
|
|
||||||
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
|
|
||||||
lib_deps.append(':' + name)
|
|
||||||
prebuilt_jar(
|
|
||||||
name = name,
|
|
||||||
binary_jar = jarfile,
|
|
||||||
)
|
|
||||||
|
|
||||||
for aarfile in glob(['libs/*.aar']):
|
|
||||||
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
|
|
||||||
lib_deps.append(':' + name)
|
|
||||||
android_prebuilt_aar(
|
|
||||||
name = name,
|
|
||||||
aar = aarfile,
|
|
||||||
)
|
|
||||||
|
|
||||||
android_library(
|
|
||||||
name = "all-libs",
|
|
||||||
exported_deps = lib_deps,
|
|
||||||
)
|
|
||||||
|
|
||||||
android_library(
|
|
||||||
name = "app-code",
|
|
||||||
srcs = glob([
|
|
||||||
"src/main/java/**/*.java",
|
|
||||||
]),
|
|
||||||
deps = [
|
|
||||||
":all-libs",
|
|
||||||
":build_config",
|
|
||||||
":res",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
android_build_config(
|
|
||||||
name = "build_config",
|
|
||||||
package = "com.navigationplayground",
|
|
||||||
)
|
|
||||||
|
|
||||||
android_resource(
|
|
||||||
name = "res",
|
|
||||||
package = "com.navigationplayground",
|
|
||||||
res = "src/main/res",
|
|
||||||
)
|
|
||||||
|
|
||||||
android_binary(
|
|
||||||
name = "app",
|
|
||||||
keystore = "//android/keystores:debug",
|
|
||||||
manifest = "src/main/AndroidManifest.xml",
|
|
||||||
package_type = "debug",
|
|
||||||
deps = [
|
|
||||||
":app-code",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
apply plugin: "com.android.application"
|
|
||||||
|
|
||||||
import com.android.build.OutputFile
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
|
||||||
* and bundleReleaseJsAndAssets).
|
|
||||||
* These basically call `react-native bundle` with the correct arguments during the Android build
|
|
||||||
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
|
|
||||||
* bundle directly from the development server. Below you can see all the possible configurations
|
|
||||||
* and their defaults. If you decide to add a configuration block, make sure to add it before the
|
|
||||||
* `apply from: "../../node_modules/react-native/react.gradle"` line.
|
|
||||||
*
|
|
||||||
* project.ext.react = [
|
|
||||||
* // the name of the generated asset file containing your JS bundle
|
|
||||||
* bundleAssetName: "index.android.bundle",
|
|
||||||
*
|
|
||||||
* // the entry file for bundle generation
|
|
||||||
* entryFile: "index.android.js",
|
|
||||||
*
|
|
||||||
* // whether to bundle JS and assets in debug mode
|
|
||||||
* bundleInDebug: false,
|
|
||||||
*
|
|
||||||
* // whether to bundle JS and assets in release mode
|
|
||||||
* bundleInRelease: true,
|
|
||||||
*
|
|
||||||
* // whether to bundle JS and assets in another build variant (if configured).
|
|
||||||
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
|
|
||||||
* // The configuration property can be in the following formats
|
|
||||||
* // 'bundleIn${productFlavor}${buildType}'
|
|
||||||
* // 'bundleIn${buildType}'
|
|
||||||
* // bundleInFreeDebug: true,
|
|
||||||
* // bundleInPaidRelease: true,
|
|
||||||
* // bundleInBeta: true,
|
|
||||||
*
|
|
||||||
* // whether to disable dev mode in custom build variants (by default only disabled in release)
|
|
||||||
* // for example: to disable dev mode in the staging build type (if configured)
|
|
||||||
* devDisabledInStaging: true,
|
|
||||||
* // The configuration property can be in the following formats
|
|
||||||
* // 'devDisabledIn${productFlavor}${buildType}'
|
|
||||||
* // 'devDisabledIn${buildType}'
|
|
||||||
*
|
|
||||||
* // the root of your project, i.e. where "package.json" lives
|
|
||||||
* root: "../../",
|
|
||||||
*
|
|
||||||
* // where to put the JS bundle asset in debug mode
|
|
||||||
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
|
|
||||||
*
|
|
||||||
* // where to put the JS bundle asset in release mode
|
|
||||||
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
|
|
||||||
*
|
|
||||||
* // where to put drawable resources / React Native assets, e.g. the ones you use via
|
|
||||||
* // require('./image.png')), in debug mode
|
|
||||||
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
|
|
||||||
*
|
|
||||||
* // where to put drawable resources / React Native assets, e.g. the ones you use via
|
|
||||||
* // require('./image.png')), in release mode
|
|
||||||
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
|
|
||||||
*
|
|
||||||
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
|
|
||||||
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
|
|
||||||
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
|
|
||||||
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
|
|
||||||
* // for example, you might want to remove it from here.
|
|
||||||
* inputExcludes: ["android/**", "ios/**"],
|
|
||||||
*
|
|
||||||
* // override which node gets called and with what additional arguments
|
|
||||||
* nodeExecutableAndArgs: ["node"],
|
|
||||||
*
|
|
||||||
* // supply additional arguments to the packager
|
|
||||||
* extraPackagerArgs: []
|
|
||||||
* ]
|
|
||||||
*/
|
|
||||||
|
|
||||||
project.ext.react = [
|
|
||||||
entryFile: "index.js"
|
|
||||||
]
|
|
||||||
|
|
||||||
apply from: "../../node_modules/react-native/react.gradle"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set this to true to create two separate APKs instead of one:
|
|
||||||
* - An APK that only works on ARM devices
|
|
||||||
* - An APK that only works on x86 devices
|
|
||||||
* The advantage is the size of the APK is reduced by about 4MB.
|
|
||||||
* Upload all the APKs to the Play Store and people will download
|
|
||||||
* the correct one based on the CPU architecture of their device.
|
|
||||||
*/
|
|
||||||
def enableSeparateBuildPerCPUArchitecture = false
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run Proguard to shrink the Java bytecode in release builds.
|
|
||||||
*/
|
|
||||||
def enableProguardInReleaseBuilds = false
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
||||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId "com.navigationplayground"
|
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
||||||
versionCode 1
|
|
||||||
versionName "1.0"
|
|
||||||
ndk {
|
|
||||||
abiFilters "armeabi-v7a", "x86"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
splits {
|
|
||||||
abi {
|
|
||||||
reset()
|
|
||||||
enable enableSeparateBuildPerCPUArchitecture
|
|
||||||
universalApk false // If true, also generate a universal APK
|
|
||||||
include "armeabi-v7a", "x86"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// applicationVariants are e.g. debug, release
|
|
||||||
applicationVariants.all { variant ->
|
|
||||||
variant.outputs.each { output ->
|
|
||||||
// For each separate APK per architecture, set a unique version code as described here:
|
|
||||||
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
|
||||||
def versionCodes = ["armeabi-v7a":1, "x86":2]
|
|
||||||
def abi = output.getFilter(OutputFile.ABI)
|
|
||||||
if (abi != null) { // null for the universal-debug, universal-release variants
|
|
||||||
output.versionCodeOverride =
|
|
||||||
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compile project(':react-native-blur')
|
|
||||||
compile project(':react-native-vector-icons')
|
|
||||||
compile project(':react-native-gesture-handler')
|
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
||||||
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
|
|
||||||
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run this once to be able to run the application with BUCK
|
|
||||||
// puts all compile dependencies into folder libs for BUCK to use
|
|
||||||
task copyDownloadableDepsToLibs(type: Copy) {
|
|
||||||
from configurations.compile
|
|
||||||
into 'libs'
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# By default, the flags in this file are appended to flags specified
|
|
||||||
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
||||||
# You can edit the include path and order by changing the proguardFiles
|
|
||||||
# directive in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
|
||||||
|
|
||||||
# If your project uses WebView with JS, uncomment the following
|
|
||||||
# and specify the fully qualified class name to the JavaScript interface
|
|
||||||
# class:
|
|
||||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
||||||
# public *;
|
|
||||||
#}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.navigationplayground">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
||||||
|
|
||||||
<application
|
|
||||||
android:name=".MainApplication"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:icon="@mipmap/ic_launcher"
|
|
||||||
android:allowBackup="false"
|
|
||||||
android:theme="@style/AppTheme">
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
|
||||||
android:windowSoftInputMode="adjustResize">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package com.navigationplayground;
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
|
||||||
import com.facebook.react.ReactActivityDelegate;
|
|
||||||
import com.facebook.react.ReactRootView;
|
|
||||||
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
|
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript. This is
|
|
||||||
* used to schedule rendering of the component.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected String getMainComponentName() {
|
|
||||||
return "NavigationPlayground";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
||||||
return new ReactActivityDelegate(this, getMainComponentName()) {
|
|
||||||
@Override
|
|
||||||
protected ReactRootView createRootView() {
|
|
||||||
return new RNGestureHandlerEnabledRootView(MainActivity.this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package com.navigationplayground;
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
|
|
||||||
import com.facebook.react.ReactApplication;
|
|
||||||
import com.cmcewen.blurview.BlurViewPackage;
|
|
||||||
import com.oblador.vectoricons.VectorIconsPackage;
|
|
||||||
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
|
|
||||||
import com.facebook.react.ReactNativeHost;
|
|
||||||
import com.facebook.react.ReactPackage;
|
|
||||||
import com.facebook.react.shell.MainReactPackage;
|
|
||||||
import com.facebook.soloader.SoLoader;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class MainApplication extends Application implements ReactApplication {
|
|
||||||
|
|
||||||
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
|
||||||
@Override
|
|
||||||
public boolean getUseDeveloperSupport() {
|
|
||||||
return BuildConfig.DEBUG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<ReactPackage> getPackages() {
|
|
||||||
return Arrays.<ReactPackage>asList(
|
|
||||||
new MainReactPackage(),
|
|
||||||
new BlurViewPackage(),
|
|
||||||
new VectorIconsPackage(),
|
|
||||||
new RNGestureHandlerPackage()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getJSMainModuleName() {
|
|
||||||
return "index";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReactNativeHost getReactNativeHost() {
|
|
||||||
return mReactNativeHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
super.onCreate();
|
|
||||||
SoLoader.init(this, /* native exopackage */ false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,3 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">NavigationPlayground</string>
|
|
||||||
</resources>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<resources>
|
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
||||||
|
|
||||||
buildscript {
|
|
||||||
ext {
|
|
||||||
buildToolsVersion = "27.0.3"
|
|
||||||
minSdkVersion = 16
|
|
||||||
compileSdkVersion = 27
|
|
||||||
targetSdkVersion = 26
|
|
||||||
supportLibVersion = "27.1.1"
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
|
||||||
// in the individual module build.gradle files
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
maven {
|
|
||||||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
||||||
url "$rootDir/../node_modules/react-native/android"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
|
||||||
gradleVersion = '4.4'
|
|
||||||
distributionUrl = distributionUrl.replace("bin", "all")
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# Project-wide Gradle settings.
|
|
||||||
|
|
||||||
# IDE (e.g. Android Studio) users:
|
|
||||||
# Gradle settings configured through the IDE *will override*
|
|
||||||
# any settings specified in this file.
|
|
||||||
|
|
||||||
# For more details on how to configure your build environment visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
||||||
|
|
||||||
# Specifies the JVM arguments used for the daemon process.
|
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
|
||||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
|
||||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
||||||
# org.gradle.parallel=true
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
|
||||||
distributionPath=wrapper/dists
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
|
||||||
172
examples/NavigationPlayground/android/gradlew
vendored
@@ -1,172 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
##
|
|
||||||
## Gradle start up script for UN*X
|
|
||||||
##
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=`basename "$0"`
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS=""
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
||||||
MAX_FD="maximum"
|
|
||||||
|
|
||||||
warn () {
|
|
||||||
echo "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
die () {
|
|
||||||
echo
|
|
||||||
echo "$*"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
|
||||||
cygwin=false
|
|
||||||
msys=false
|
|
||||||
darwin=false
|
|
||||||
nonstop=false
|
|
||||||
case "`uname`" in
|
|
||||||
CYGWIN* )
|
|
||||||
cygwin=true
|
|
||||||
;;
|
|
||||||
Darwin* )
|
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
||||||
else
|
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
|
||||||
fi
|
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
JAVACMD="java"
|
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
|
||||||
if [ $? -eq 0 ] ; then
|
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
ulimit -n $MAX_FD
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
|
||||||
if $cygwin ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=$((i+1))
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
(0) set -- ;;
|
|
||||||
(1) set -- "$args0" ;;
|
|
||||||
(2) set -- "$args0" "$args1" ;;
|
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Escape application args
|
|
||||||
save () {
|
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
||||||
echo " "
|
|
||||||
}
|
|
||||||
APP_ARGS=$(save "$@")
|
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
@if "%DEBUG%" == "" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS=
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:init
|
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
|
||||||
:win9xME_args
|
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
|
||||||
if "x%~1" == "x" goto execute
|
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
keystore(
|
|
||||||
name = "debug",
|
|
||||||
properties = "debug.keystore.properties",
|
|
||||||
store = "debug.keystore",
|
|
||||||
visibility = [
|
|
||||||
"PUBLIC",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
key.store=debug.keystore
|
|
||||||
key.alias=androiddebugkey
|
|
||||||
key.store.password=android
|
|
||||||
key.alias.password=android
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
rootProject.name = 'NavigationPlayground'
|
|
||||||
include ':react-native-blur'
|
|
||||||
project(':react-native-blur').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-blur/android')
|
|
||||||
include ':react-native-vector-icons'
|
|
||||||
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
|
|
||||||
include ':react-native-gesture-handler'
|
|
||||||
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
|
|
||||||
|
|
||||||
include ':app'
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "NavigationPlayground",
|
|
||||||
"displayName": "NavigationPlayground"
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import App from './App';
|
|
||||||
|
|
||||||
import renderer from 'react-test-renderer';
|
|
||||||
|
|
||||||
it('renders without crashing', () => {
|
|
||||||
const rendered = renderer.create(<App />).toJSON();
|
|
||||||
expect(rendered).toBeDefined();
|
|
||||||
});
|
|
||||||
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |