[ReactNative] Androidized Navigator animations

Summary:
Added configurations for android-like animations, with gestures disabled.

@public

Test Plan: Tested on AdsManager Android
This commit is contained in:
Eric Vicenti 2015-04-28 13:07:55 -07:00
Родитель 48297753cf
Коммит 9209c444c7
1 изменённых файлов: 77 добавлений и 0 удалений

Просмотреть файл

@ -101,6 +101,30 @@ var FadeToTheLeft = {
},
};
var FadeIn = {
opacity: {
from: 0,
to: 1,
min: 0.5,
max: 1,
type: 'linear',
extrapolate: false,
round: 100,
},
};
var FadeOut = {
opacity: {
from: 1,
to: 0,
min: 0,
max: 0.5,
type: 'linear',
extrapolate: false,
round: 100,
},
};
var ToTheLeft = {
transformTranslate: {
from: {x: 0, y: 0, z: 0},
@ -236,6 +260,43 @@ var FromTheFront = {
},
};
var ToTheBackAndroid = {
opacity: {
value: 1,
type: 'constant',
},
};
var FromTheFrontAndroid = {
opacity: {
from: 0,
to: 1,
min: 0,
max: 1,
type: 'linear',
extrapolate: false,
round: 100,
},
transformTranslate: {
from: {x: 0, y: 50, z: 0},
to: {x: 0, y: 0, z: 0},
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},
translateY: {
from: 50,
to: 0,
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},
};
var BaseOverswipeConfig = {
frictionConstant: 1,
frictionByDistance: 1.5,
@ -319,6 +380,22 @@ var NavigatorSceneConfigs = {
out: buildStyleInterpolator(ToTheBack),
},
},
FloatFromBottomAndroid: {
...BaseConfig,
gestures: null,
animationInterpolators: {
into: buildStyleInterpolator(FromTheFrontAndroid),
out: buildStyleInterpolator(ToTheBackAndroid),
},
},
FadeAndroid: {
...BaseConfig,
gestures: null,
animationInterpolators: {
into: buildStyleInterpolator(FadeIn),
out: buildStyleInterpolator(FadeOut),
},
},
HorizontalSwipeJump: {
...BaseConfig,
gestures: {