Skip to content

Instantly share code, notes, and snippets.

@philipshen
Last active August 28, 2018 06:14
Show Gist options
  • Save philipshen/c8224fb818cc6a3ef09ba01ab6eca195 to your computer and use it in GitHub Desktop.
Save philipshen/c8224fb818cc6a3ef09ba01ab6eca195 to your computer and use it in GitHub Desktop.
const animationConfigs = new Map([
[AnimationType.spring, {
duration: 300,
update: {
type: LayoutAnimation.Types.spring,
springDamping: 0.5
},
}],
[AnimationType.linear, {
duration: 300,
update: {
type: LayoutAnimation.Types.linear
}
}],
[AnimationType.ease, {
duration: 800,
update: {
type: LayoutAnimation.Types.easeInEaseOut
}
}],
[AnimationType.keyboard, {
duration: 10000, // Doesn't matter
update: {
type: LayoutAnimation.Types.keyboard
}
}],
[AnimationType.scaleLinear, {
duration: 600,
update: {
type: LayoutAnimation.Types.linear,
property: LayoutAnimation.Properties.scaleXY
}
}],
[AnimationType.scaleSpring, {
duration: 600,
update: {
type: LayoutAnimation.Types.spring,
property: LayoutAnimation.Properties.scaleXY,
springDamping: 0.6
}
}],
[AnimationType.fade, {
duration: 600,
create: {
type: LayoutAnimation.Types.linear,
property: LayoutAnimation.Properties.opacity
},
update: {
type: LayoutAnimation.Types.linear,
property: LayoutAnimation.Properties.opacity
},
delete: {
type: LayoutAnimation.Types.linear,
property: LayoutAnimation.Properties.opacity
}
}]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment