Skip to content

Commit 4a6f5d3

Browse files
author
Pavlo Aksonov
committed
include none animation by default
1 parent 08ddf02 commit 4a6f5d3

File tree

7 files changed

+94
-72
lines changed

7 files changed

+94
-72
lines changed

Animations.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,26 @@ var FlatFadeToTheUp = {
5151
round: PixelRatio.get(),
5252
},
5353
};
54+
5455
FlatFloatFromBottom.animationInterpolators.out = buildStyleInterpolator(FlatFadeToTheUp);
5556
FlatFloatFromRight.animationInterpolators.out = buildStyleInterpolator(FlatFadeToTheLeft);
5657

57-
module.exports = {FlatFloatFromRight, FlatFloatFromBottom};
58+
var None = {
59+
gestures: {
60+
},
61+
62+
// Rebound spring parameters when transitioning FROM this scene
63+
springFriction: 0,
64+
springTension: 2000,
65+
66+
// Velocity to start at when transitioning without gesture
67+
defaultTransitionVelocity: 1.5,
68+
69+
// Animation interpolators for horizontal transitioning:
70+
animationInterpolators: {
71+
into: buildStyleInterpolator(FlatFadeToTheUp),
72+
out: buildStyleInterpolator(FlatFadeToTheUp),
73+
},
74+
};
75+
76+
module.exports = {FlatFloatFromRight, FlatFloatFromBottom, None};

Example/.idea/workspace.xml

Lines changed: 64 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/components/Launch.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Launch extends React.Component {
1212
<Text>Launch page</Text>
1313
<Button onPress={()=>Actions.login({data:"Custom data", title:'Custom title' })}>Go to Login page</Button>
1414
<Button onPress={Actions.register}>Go to Register page</Button>
15+
<Button onPress={Actions.register2}>Go to Register page without animation</Button>
1516
<Button onPress={()=>Actions.error("Error message")}>Go to Error page</Button>
1617
</View>
1718
);

Example/index.ios.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ var Example = React.createClass({
2121
<Router>
2222
<Schema name="modal" sceneConfig={Animations.FlatFloatFromBottom} navBar={NavBarModal} />
2323
<Schema name="default" sceneConfig={Animations.FlatFloatFromRight} navBar={NavBar} />
24+
<Schema name="withoutAnimation" navBar={NavBar} />
2425

2526
<Route name="launch" component={Launch} initial={true} hideNavBar={false} title="Launch"/>
2627
<Route name="register" component={Register} title="Register" />
2728
<Route name="login" component={Login} schema="modal"/>
28-
<Route name="error" component={Error} schema="popup" />
29+
<Route name="register2" component={Register} schema="withoutAnimation" />
30+
<Route name="login" component={Login} schema="modal"/>
2931
</Router>
3032
);
3133
}

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"react-native": "^0.9.0",
1010
"react-native-button": "^1.2.1",
1111
"react-native-navbar": "^0.8.0",
12-
"react-native-router-flux": "0.0.5"
12+
"react-native-router-flux": "^0.0.8"
1313
}
1414
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Router extends React.Component {
167167

168168
getRoute(route, data) {
169169
var schema = this.schemas[route.schema || 'default'] || {};
170-
var sceneConfig = route.sceneConfig || schema.sceneConfig || Animations.FlatFloatFromRight;
170+
var sceneConfig = route.sceneConfig || schema.sceneConfig || Animations.None;
171171
var NavBar = route.navBar || schema.navBar;
172172
var navBar;
173173
if (NavBar){

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-router-flux",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"description": "React Native Router using Flux architecture",
55
"main": "index.js",
66
"scripts": {
@@ -27,7 +27,7 @@
2727
"readme": "# react-native-router-flux\nReact Native Router using Flux architecture\n",
2828
"readmeFilename": "README.md",
2929
"gitHead": "ac054cfda0894ba1db6c4901ebdddc83b3b2d083",
30-
"_id": "[email protected].4",
31-
"_shasum": "f8d8d0a00c62ebda70885e1a7c2d7032d46edd83",
32-
"_from": "[email protected].4"
30+
"_id": "[email protected].8",
31+
"_shasum": "72baceefed84d1a164408279b611bad7b2ff3b57",
32+
"_from": "react-native-router-flux@>=0.0.8 <0.0.9"
3333
}

0 commit comments

Comments
 (0)