Last active
August 29, 2015 14:23
-
-
Save grabbou/7a860fe69f842572effb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Some predefined animations for you usage | |
export const animations = { | |
layout: { | |
spring: { | |
duration: 500, | |
create: { | |
duration: 300, | |
type: LayoutAnimation.Types.easeInEaseOut, | |
property: LayoutAnimation.Properties.opacity | |
}, | |
update: { | |
type: LayoutAnimation.Types.spring, | |
springDamping: 200 | |
} | |
}, | |
easeInEaseOut: { | |
duration: 300, | |
create: { | |
type: LayoutAnimation.Types.easeInEaseOut, | |
property: LayoutAnimation.Properties.scaleXY | |
}, | |
update: { | |
delay: 100, | |
type: LayoutAnimation.Types.easeInEaseOut | |
} | |
} | |
} | |
}; | |
const FormComponent = React.createClass({ | |
componentWillUpdate(props, state) { | |
if (state.isKeyboardOpened !== this.state.isKeyboardOpened) { | |
LayoutAnimation.configureNext(animations.layout.spring); | |
} | |
} | |
// Please assume render is present ;) | |
}); | |
return FormComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment