update animation times to align with material design guidelines

This commit is contained in:
Stanislav Miklik 2017-01-10 14:39:33 +01:00
parent 90aa192879
commit 3a3b66010d
3 changed files with 5 additions and 9 deletions

View File

@ -5,6 +5,7 @@ Extensible popup menu component for React Native for both Android and iOS.
Features:
* Simple to use popup/context menu
* Multiple modes: animated, not animated or slide in from bottom
* By default opening and closing animations
* Easy styling
* Customizable on various levels - menu options, positioning, animations
* Can work as controlled as well as uncontrolled component

View File

@ -37,8 +37,6 @@ export const computePosition = ({ windowLayout, triggerLayout, optionsLayout })
return { top, left };
};
const DURATION = 80;
export default class ContextMenu extends React.Component {
constructor(props) {
@ -50,7 +48,7 @@ export default class ContextMenu extends React.Component {
componentDidMount() {
Animated.timing(this.state.scaleAnim, {
duration: DURATION,
duration: 225,
toValue: 1
}).start();
}
@ -58,7 +56,7 @@ export default class ContextMenu extends React.Component {
close() {
return new Promise(resolve => {
Animated.timing(this.state.scaleAnim, {
duration: DURATION,
duration: 195,
toValue: 0
}).start(resolve);
});

View File

@ -9,8 +9,6 @@ export const computePosition = ({ windowLayout, optionsLayout }) => {
return { top, left };
}
const DURATION = 100;
export default class SlideInMenu extends React.Component {
constructor(props) {
@ -22,7 +20,7 @@ export default class SlideInMenu extends React.Component {
componentDidMount() {
Animated.timing(this.state.slide, {
duration: DURATION,
duration: 225,
toValue: 1
}).start();
}
@ -30,7 +28,7 @@ export default class SlideInMenu extends React.Component {
close() {
return new Promise(resolve => {
Animated.timing(this.state.slide, {
duration: DURATION,
duration: 195,
toValue: 0
}).start(resolve);
});
@ -72,4 +70,3 @@ const styles = StyleSheet.create({
elevation: 5,
},
});