Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ DerivedData
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.idea
.gradle
local.properties

# node.js
#
node_modules/
Expand Down
7 changes: 1 addition & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Example/
.idea

126 changes: 98 additions & 28 deletions Animations.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
'use strict';
import React from 'react-native';
const {PixelRatio, Navigator, Dimensions} = React;
import buildStyleInterpolator from 'react-native/Libraries/Utilities/buildStyleInterpolator';

// Scene Config
var {Navigator,Dimensions,PixelRatio} = require('react-native');
var buildStyleInterpolator = require('react-native/Libraries/Utilities/buildStyleInterpolator');
var FlatFloatFromRight = Object.assign({}, Navigator.SceneConfigs.FloatFromRight);
var FlatFloatFromBottom = Object.assign({}, Navigator.SceneConfigs.FloatFromBottom);
FlatFloatFromRight.gestures = {};
var NoTransition = {
opacity: {
from: 1,
to: 1,
min: 1,
max: 1,
type: 'linear',
extrapolate: false,
round: 100,
},
};

var FlatFadeToTheLeft = {
var FadeToTheLeft = {
// Rotate *requires* you to break out each individual component of
// rotation (x, y, z, w)
transformTranslate: {
from: {x: 0, y: 0, z: 0},
to: {x: -Math.round(Dimensions.get('window').width * 0.3), y: 0, z: 0},
Expand All @@ -17,6 +26,25 @@ var FlatFadeToTheLeft = {
extrapolate: true,
round: PixelRatio.get(),
},
// Uncomment to try rotation:
// Quick guide to reasoning about rotations:
// http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-17-quaternions/#Quaternions
// transformRotateRadians: {
// from: {x: 0, y: 0, z: 0, w: 1},
// to: {x: 0, y: 0, z: -0.47, w: 0.87},
// min: 0,
// max: 1,
// type: 'linear',
// extrapolate: true
// },
transformScale: {
from: {x: 1, y: 1, z: 1},
to: {x: 0.95, y: 1, z: 1},
min: 0,
max: 1,
type: 'linear',
extrapolate: true
},
opacity: {
from: 1,
to: 0.3,
Expand All @@ -35,43 +63,85 @@ var FlatFadeToTheLeft = {
extrapolate: true,
round: PixelRatio.get(),
},
scaleX: {
from: 1,
to: 0.95,
min: 0,
max: 1,
type: 'linear',
extrapolate: true
},
scaleY: {
from: 1,
to: 0.95,
min: 0,
max: 1,
type: 'linear',
extrapolate: true
},
};
var FlatFadeToTheUp = {



var FromTheRight = {
opacity: {
value: 1.0,
type: 'constant',
},

translateY: {
from: 0,
to: -Math.round(Dimensions.get('window').height * 0.3),
transformTranslate: {
from: {x: Dimensions.get('window').width, y: 0, z: 0},
to: {x: 0, y: 0, z: 0},
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},
};

FlatFloatFromBottom.animationInterpolators.out = buildStyleInterpolator(FlatFadeToTheUp);
FlatFloatFromRight.animationInterpolators.out = buildStyleInterpolator(FlatFadeToTheLeft);
translateX: {
from: Dimensions.get('window').width,
to: 0,
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},

var None = {
gestures: {
scaleX: {
value: 1,
type: 'constant',
},
scaleY: {
value: 1,
type: 'constant',
},
};

// Rebound spring parameters when transitioning FROM this scene
springFriction: 0,
springTension: 2000,

// Velocity to start at when transitioning without gesture
defaultTransitionVelocity: 1.5,

// Animation interpolators for horizontal transitioning:
animationInterpolators: {
into: buildStyleInterpolator(FlatFadeToTheUp),
out: buildStyleInterpolator(FlatFadeToTheUp),
const Animations = {
FlatFloatFromRight: {
...Navigator.SceneConfigs.FloatFromRight,
// Animation interpolators for horizontal transitioning:
animationInterpolators: {
into: buildStyleInterpolator(FromTheRight),
out: buildStyleInterpolator(FadeToTheLeft),
},
// We will want to customize this soon
},
};

module.exports = {FlatFloatFromRight, FlatFloatFromBottom, None};

None: {
...Navigator.SceneConfigs.FloatFromRight,
gestures: null,
defaultTransitionVelocity: 100,
animationInterpolators: {
into: buildStyleInterpolator(NoTransition),
out: buildStyleInterpolator(NoTransition),
}
}
}

export default Animations;
162 changes: 0 additions & 162 deletions Container.js

This file was deleted.

23 changes: 0 additions & 23 deletions ContainerStore.js

This file was deleted.

Loading