Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

Commit

Permalink
Vendor NavigationExperimental, update example to sdk15
Browse files Browse the repository at this point in the history
fbshipit-source-id: 0eeba9e
  • Loading branch information
janicduplessis authored and expbot committed Apr 13, 2017
1 parent c65a31c commit 6908c9e
Show file tree
Hide file tree
Showing 45 changed files with 3,071 additions and 36 deletions.
2 changes: 1 addition & 1 deletion example/components/AboutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
StyleSheet,
StatusBar,
} from 'react-native';
import pak from '@exponent/ex-navigation/package.json';
import pak from '@expo/ex-navigation/package.json';

export default class HomeScreen extends Component {
/**
Expand Down
7 changes: 2 additions & 5 deletions example/components/CustomNavigationBarExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class CustomNavigationBarExample extends Component {
navigationBar: {
title: 'Custom NavigationBar',
tintColor: "#FFF",
renderBackground: (props) => <View><Image style={[styles.bgImage]} source={{uri: 'http://il9.picdn.net/shutterstock/videos/3951179/thumb/1.jpg'}} resizeMode={'cover'} /></View>,
renderBackground: (props) => <Image style={styles.bgImage} source={{uri: 'http://il9.picdn.net/shutterstock/videos/3951179/thumb/1.jpg'}} resizeMode={'cover'} />,
},
}

Expand Down Expand Up @@ -68,9 +68,6 @@ const styles = StyleSheet.create({
fontSize: 18,
},
bgImage: {
top: 0,
left: 0,
right: 0,
height: Platform.OS === 'ios' ? 64 : 65,
flex: 1,
},
});
4 changes: 2 additions & 2 deletions example/components/DrawerNavigationExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
StackNavigation,
DrawerNavigation,
DrawerNavigationItem,
} from '@exponent/ex-navigation';
import { Ionicons } from '@exponent/vector-icons';
} from '@expo/ex-navigation';
import { Ionicons } from '@expo/vector-icons';
import { Router } from '../main';

export default class DrawerNavigationExample extends Component {
Expand Down
4 changes: 2 additions & 2 deletions example/components/SlidingTabNavigationExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
import {
SlidingTabNavigation,
SlidingTabNavigationItem,
} from '@exponent/ex-navigation';
import { Ionicons } from '@exponent/vector-icons';
} from '@expo/ex-navigation';
import { Ionicons } from '@expo/vector-icons';

export default class SlidingTabNavigationExample extends Component {
static route = {
Expand Down
4 changes: 2 additions & 2 deletions example/components/TabNavigationExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
import {
TabNavigation,
TabNavigationItem,
} from '@exponent/ex-navigation';
import { Ionicons } from '@exponent/vector-icons';
} from '@expo/ex-navigation';
import { Ionicons } from '@expo/vector-icons';

function getColor(isSelected) {
return isSelected ? '#fff' : '#000';
Expand Down
4 changes: 2 additions & 2 deletions example/components/TranslucentBarExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
import {
TabNavigation,
TabNavigationItem,
} from '@exponent/ex-navigation';
import { Ionicons } from '@exponent/vector-icons';
} from '@expo/ex-navigation';
import { Ionicons } from '@expo/vector-icons';

function getColor(isSelected) {
return isSelected ? '#fff' : '#000';
Expand Down
8 changes: 4 additions & 4 deletions example/exp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
name: "ExNavigationExample",
description: "Demonstrate usage of ex-navigation: https://github.com/exponent/ex-navigation",
slug: "ex-navigation-example",
sdkVersion: "12.0.0",
sdkVersion: "15.0.0",
version: "1.0.0",
orientation: "portrait",
primaryColor: "#cccccc",
iconUrl: "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png",
icon: "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png",
notification: {
iconUrl: "https://s3.amazonaws.com/exp-us-standard/placeholder-push-icon.png",
icon: "https://s3.amazonaws.com/exp-us-standard/placeholder-push-icon.png",
color: "#000000"
},
loading: {
iconUrl: "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png",
icon: "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png",
},
packagerOpts: {
assetExts: ["ttf"]
Expand Down
6 changes: 3 additions & 3 deletions example/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Exponent, { Asset, Components } from 'exponent';
import Exponent, { Asset, AppLoading } from 'expo';
import React, { Component } from 'react';
import { StatusBar } from 'react-native';
import DrawerNavigationExample from './components/DrawerNavigationExample';
Expand All @@ -14,7 +14,7 @@ import CustomNavigationBarExample from './components/CustomNavigationBarExample'
import {
createRouter,
NavigationProvider,
} from '@exponent/ex-navigation';
} from '@expo/ex-navigation';

const assets = [
require('./assets/beetle.jpg'),
Expand Down Expand Up @@ -61,7 +61,7 @@ class App extends Component {

render() {
if (!this.state.bootstrapped) {
return <Components.AppLoading />;
return <AppLoading />;
}

/**
Expand Down
10 changes: 5 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"private": true,
"main": "main.js",
"dependencies": {
"@exponent/ex-navigation": "file:../",
"@exponent/vector-icons": "~2.0.0",
"exponent": "~12.0.3",
"@expo/ex-navigation": "file:../",
"@expo/vector-icons": "~4.0.0",
"expo": "^15.0.2",
"lodash": "^4.13.1",
"react": "~15.3.2",
"react-native": "git+https://github.com/exponent/react-native#sdk-12.0.0"
"react": "~15.4.2",
"react-native": "https://github.com/exponent/react-native/archive/sdk-15.0.0.tar.gz"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"invariant": "^2.2.1",
"lodash": "^4.6.1",
"mirror-creator": "^1.1.0",
"react-addons-pure-render-mixin": "^15.5.2",
"react-addons-shallow-compare": "15.3.2",
"react-clone-referenced-element": "^1.0.1",
"react-mixin": "^3.0.5",
Expand All @@ -54,7 +55,7 @@
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-react": "^6.8.0",
"flow-bin": "^0.30.0",
"react": "^15.4.0",
"react-native": "https://github.com/exponent/react-native/archive/sdk-14.0.0.tar.gz"
"react": "~15.4.2",
"react-native": "https://github.com/exponent/react-native/archive/sdk-15.0.0.tar.gz"
}
}
4 changes: 1 addition & 3 deletions src/ExNavigationReducer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import _ from 'lodash';

import {
NavigationExperimental,
} from 'react-native';
import NavigationExperimental from './navigation-experimental';

import invariant from 'invariant';

Expand Down
4 changes: 2 additions & 2 deletions src/ExNavigationStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
Platform,
StyleSheet,
View,
NavigationExperimental,
} from 'react-native';
import NavigationExperimental from './navigation-experimental';

import _ from 'lodash';
import invariant from 'invariant';
Expand All @@ -34,7 +34,7 @@ const {

import type {
NavigationSceneRendererProps, NavigationScene, NavigationTransitionProps,
} from 'NavigationTypeDefinition';
} from './navigation-experimental/NavigationTypeDefinition';
import type { ExNavigationRoute, ExNavigationRouter } from './ExNavigationRouter';
import type ExNavigationContext from './ExNavigationContext';
import type { ExNavigationConfig } from './ExNavigationTypeDefinition';
Expand Down
2 changes: 1 addition & 1 deletion src/ExNavigationStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
Animated,
Easing,
I18nManager,
NavigationExperimental,
} from 'react-native';
import NavigationExperimental from './navigation-experimental';

const {
CardStackStyleInterpolator,
Expand Down
2 changes: 1 addition & 1 deletion src/ExNavigationTypeDefinition.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
NavigationSceneRendererProps,
NavigationTransitionProps,
NavigationTransitionSpec,
} from 'NavigationTypeDefinition';
} from './navigation-experimental/NavigationTypeDefinition';

export type ExNavigationStyles = {
applyAnimation: ?((position: Animated.Value, navigationState: Object) => void),
Expand Down
55 changes: 55 additions & 0 deletions src/navigation-experimental/NavigationAbstractPanResponder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/
'use strict';

const {PanResponder} = require('react-native');

const invariant = require('fbjs/lib/invariant');

import type {
NavigationPanPanHandlers,
} from './NavigationTypeDefinition';

const EmptyPanHandlers = {
onMoveShouldSetPanResponder: null,
onPanResponderGrant: null,
onPanResponderMove: null,
onPanResponderRelease: null,
onPanResponderTerminate: null,
};

/**
* Abstract class that defines the common interface of PanResponder that handles
* the gesture actions.
*/
class NavigationAbstractPanResponder {

panHandlers: NavigationPanPanHandlers;

constructor() {
const config = {};
Object.keys(EmptyPanHandlers).forEach(name => {
const fn: any = (this: any)[name];

invariant(
typeof fn === 'function',
'subclass of `NavigationAbstractPanResponder` must implement method %s',
name
);

config[name] = fn.bind(this);
}, this);

this.panHandlers = PanResponder.create(config).panHandlers;
}
}

module.exports = NavigationAbstractPanResponder;
47 changes: 47 additions & 0 deletions src/navigation-experimental/NavigationAnimatedValueSubscription.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright (c) 2015, Facebook, Inc. All rights reserved.
*
* Facebook, Inc. ("Facebook") owns all right, title and interest, including
* all intellectual property and other proprietary rights, in and to the React
* Native CustomComponents software (the "Software"). Subject to your
* compliance with these terms, you are hereby granted a non-exclusive,
* worldwide, royalty-free copyright license to (1) use and copy the Software;
* and (2) reproduce and distribute the Software as part of your own software
* ("Your Software"). Facebook reserves all rights not expressly granted to
* you in this license agreement.
*
* THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "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 FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR
* EMPLOYEES 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 THE SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @flow
*/
'use strict';

import type {
NavigationAnimatedValue
} from './NavigationTypeDefinition';

class NavigationAnimatedValueSubscription {
_value: NavigationAnimatedValue;
_token: string;

constructor(value: NavigationAnimatedValue, callback: Function) {
this._value = value;
this._token = value.addListener(callback);
}

remove(): void {
this._value.removeListener(this._token);
}
}

module.exports = NavigationAnimatedValueSubscription;
Loading

0 comments on commit 6908c9e

Please sign in to comment.