123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- const { Navigation } = require('react-native-navigation');
- const { registerScreens } = require('./screens');
- const { Platform } = require('react-native');
-
- if (Platform.OS === 'android') {
- alert = (title) => {
- Navigation.showOverlay({
- component: {
- name: 'navigation.playground.alert',
- passProps: {
- title
- },
- options: {
- overlay: {
- interceptTouchOutside: true
- }
- }
- }
- });
- };
- }
-
- function start() {
- registerScreens();
- Navigation.events().registerAppLaunchedListener(async () => {
- Navigation.setDefaultOptions({
- layout: {
- componentBackgroundColor: '#e8e8e8',
- orientation: ['portrait']
- },
- bottomTab: {
- iconColor: '#1B4C77',
- selectedIconColor: '#0f0',
- textColor: '#1B4C77',
- selectedTextColor: '#0f0',
- fontFamily: 'HelveticaNeue-Italic',
- fontSize: 13
- },
- _animations: {
- push: {
- waitForRender: false,
- }
- },
- animations: {
- setRoot: {
- alpha: {
- from: 0,
- to: 1,
- duration: 300
- }
- },
- _push: {
- topBar: {
- id: 'TEST',
- alpha: {
- from: 0,
- to: 1,
- duration: 500,
- interpolation: 'accelerate'
- }
- },
- bottomTabs: {
- y: {
- from: 1000,
- to: 0,
- duration: 500,
- interpolation: 'decelerate',
- },
- alpha: {
- from: 0,
- to: 1,
- duration: 500,
- interpolation: 'decelerate'
- }
- },
- content: {
- y: {
- from: 1000,
- to: 0,
- duration: 500,
- interpolation: 'accelerate',
- },
- alpha: {
- from: 0,
- to: 1,
- duration: 500,
- interpolation: 'accelerate'
- }
- }
- },
- _pop: {
- topBar: {
- id: 'TEST',
- alpha: {
- from: 1,
- to: 0,
- duration: 500,
- interpolation: 'accelerate'
- }
- },
- bottomTabs: {
- y: {
- from: 0,
- to: 100,
- duration: 500,
- interpolation: 'accelerate',
- },
- alpha: {
- from: 1,
- to: 0,
- duration: 500,
- interpolation: 'accelerate'
- }
- },
- bottomTabs: {
- y: {
- from: 0,
- to: 100,
- duration: 500,
- interpolation: 'decelerate',
- },
- alpha: {
- from: 1,
- to: 0,
- duration: 500,
- interpolation: 'decelerate'
- }
- },
- content: {
- y: {
- from: 0,
- to: 1000,
- duration: 500,
- interpolation: 'decelerate',
- },
- alpha: {
- from: 1,
- to: 0,
- duration: 500,
- interpolation: 'decelerate'
- }
- }
- }
- }
- });
-
- // await Navigation.showModal({
- // stack: {
- // children: [
- // {
- // component: {
- // name: 'navigation.playground.ModalScreen'
- // }
- // }
- // ]
- // }
- // });
-
- Navigation.setRoot({
- root: {
- stack: {
- id: 'TEST',
- children: [
- {
- component: {
- name: 'navigation.playground.WelcomeScreen'
- // name: 'navigation.playground.CustomTransitionOrigin'
- }
- }
- ]
- }
- }
- });
- });
- }
-
- module.exports = {
- start
- };
|