diff --git a/docs/next/getting-started.html b/docs/next/getting-started.html index 5629c9ac445..8399c73d7a5 100644 --- a/docs/next/getting-started.html +++ b/docs/next/getting-started.html @@ -157,7 +157,8 @@ npm start # you can also use: expo start
We recommend installing Node, Watchman, and JDK using Homebrew. Run the following commands in a Terminal after installing Homebrew:
-brew install node
+brew install yarn
+brew install node
brew install watchman
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
diff --git a/docs/next/getting-started/index.html b/docs/next/getting-started/index.html
index 5629c9ac445..8399c73d7a5 100644
--- a/docs/next/getting-started/index.html
+++ b/docs/next/getting-started/index.html
@@ -157,7 +157,8 @@ npm start # you can also use: expo start
Node, Watchman, JDK
We recommend installing Node, Watchman, and JDK using Homebrew. Run the following commands in a Terminal after installing Homebrew:
-brew install node
+brew install yarn
+brew install node
brew install watchman
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
diff --git a/docs/next/layoutanimation.html b/docs/next/layoutanimation.html
index 24bf8450b3c..682ef7defa2 100644
--- a/docs/next/layoutanimation.html
+++ b/docs/next/layoutanimation.html
@@ -79,6 +79,36 @@
}
}
+Example usage:
+import React, {Component} from 'react';
+import {View, Text, TouchableOpacity, Platform, UIManager} from 'react-native';
+
+if (
+ Platform.OS === 'android' &&
+ UIManager.setLayoutAnimationEnabledExperimental
+) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+}
+class AnimatedCollapsible extends React.Component {
+ state = {expanded: false};
+ render() {
+ return (
+ <View style={{overflow: 'hidden'}}>
+ <TouchableOpacity
+ onPress={() => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
+ this.setState({expanded: !this.state.expanded});
+ }}>
+ <Text>
+ Press me to {this.state.expanded ? 'collapse' : 'expand'}!
+ </Text>
+ </TouchableOpacity>
+ {this.state.expanded && <Text>I disappear sometimes!</Text>}
+ </View>
+ );
+ }
+}
+
Methods
configureNext
@@ -106,24 +136,43 @@
Name Type Required Description
-config object Yes See config parameters below.
+config object Yes See config description below.
onAnimationDidEnd function No Called when the animation finished. Only supported on iOS.
-config
+The config parameter is an object with the keys below. create returns a valid object for config, and the Presets objects can also all be passed as the config.
duration in milliseconds
-create, config for animating in new views (see Anim type)
-update, config for animating views that have been updated (see Anim type)
+create, optional config for animating in new views
+update, optional config for animating views that have been updated
+delete, optional config for animating views as they are removed
+
+The config that's passed to create, update, or delete has the following keys:
+
+type, the animation type to use
+property, the layout property to animate (optional, but recommended for create and delete)
+springDamping (number, optional and only for use with type: Type.spring)
+initialVelocity (number, optional)
+delay (number, optional)
+duration (number, optional)
create()
static create(duration, type, creationProp)
-Helper for creating a config for configureNext.
+Helper that creates an object (with create, update, and delete fields) to pass into configureNext. The type parameter is an animation type, and the creationProp parameter is a layout property.
+Example usage:
+LayoutAnimation.configureNext(
+ LayoutAnimation.create(
+ 500,
+ LayoutAnimation.Types.spring,
+ LayoutAnimation.Properties.scaleXY,
+ ),
+);
+
Properties
Types
-An enumerate of animation types to be used in create method.
+An enumeration of animation types to be used in the create method, or in the create/update/delete configs for configureNext. (example usage: LayoutAnimation.Types.easeIn)
Types
@@ -139,7 +188,7 @@
Properties
-An enumerate of object property to be animated, used in create method.
+An enumeration of layout properties to be animated to be used in the create method, or in the create/update/delete configs for configureNext. (example usage: LayoutAnimation.Properties.opacity)
Properties
@@ -153,7 +202,7 @@
Presets
-A set of predefined animation config.
+A set of predefined animation configs to pass into configureNext.
Presets Value
@@ -165,14 +214,14 @@
-easeInEaseOut
-Shortcut to bind configureNext() methods with Presets.easeInEaseOut.
+easeInEaseOut()
+Calls configureNext() with Presets.easeInEaseOut.
-linear
-Shortcut to bind configureNext() methods with Presets.linear.
+linear()
+Calls configureNext() with Presets.linear.
-spring
-Shortcut to bind configureNext() methods with Presets.spring.
+spring()
+Calls configureNext() with Presets.spring.