Animated
The Animated library is designed to make animations fluid, powerful, and easy to build and maintain. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple start/stop methods to control time-based animation execution.
Animated
The Animated library is designed to make animations fluid, powerful, and painless to build and maintain. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and start/stop methods to control time-based animation execution.
The simplest workflow for creating an animation is to create an Animated.Value, hook it up to one or more style attributes of an animated component, and then drive updates via animations using Animated.timing():
Animated.timing(
// Animate value over time
@@ -90,7 +90,7 @@
Animated provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
Animated.decay() starts with an initial velocity and gradually slows to a stop.
-Animated.spring() provides a simple spring physics model.
+Animated.spring() provides a basic spring physics model.
Animated.timing() animates a value over time using easing functions.
In most cases, you will be using timing(). By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
@@ -100,7 +100,7 @@
By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
Animatable components
-Only animatable components can be animated. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
+Only animatable components can be animated. These unique components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
createAnimatedComponent() can be used to make a component animatable.
@@ -119,7 +119,7 @@
Animated.sequence() starts the animations in order, waiting for each to complete before starting the next.
Animated.stagger() starts animations in order and in parallel, but with successive delays.
-Animations can also be chained together simply by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
+Animations can also be chained together by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
Combining animated values
You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value:
@@ -213,14 +213,14 @@
Animates a value according to an analytical spring model based on damped harmonic oscillation. Tracks velocity state to create fluid motions as the toValue updates, and can be chained together.
Config is an object that may have the following options.
Note that you can only define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one:
-The friction/tension or bounciness/speed options match the spring model in Facebook Pop, Rebound, and Origami.
+The friction/tension or bounciness/speed options match the spring model in Facebook Pop, Rebound, and Origami.
friction: Controls "bounciness"/overshoot. Default 7.
tension: Controls speed. Default 40.
speed: Controls speed of the animation. Default 12.
bounciness: Controls bounciness. Default 8.
-Specifying stiffness/damping/mass as parameters makes Animated.spring use an analytical spring model based on the motion equations of a damped harmonic oscillator. This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation primitive.
+Specifying stiffness/damping/mass as parameters makes Animated.spring use an analytical spring model based on the motion equations of a damped harmonic oscillator. This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation.
stiffness: The spring stiffness coefficient. Default 100.
damping: Defines how the spring’s motion should be damped due to the forces of friction. Default 10.
diff --git a/docs/0.50/animated/index.html b/docs/0.50/animated/index.html
index 139f21df615..a8d4c6a25fe 100644
--- a/docs/0.50/animated/index.html
+++ b/docs/0.50/animated/index.html
@@ -1,4 +1,4 @@
-Animated · React Native
Animated
The Animated library is designed to make animations fluid, powerful, and easy to build and maintain. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple start/stop methods to control time-based animation execution.
Animated
The Animated library is designed to make animations fluid, powerful, and painless to build and maintain. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and start/stop methods to control time-based animation execution.
The simplest workflow for creating an animation is to create an Animated.Value, hook it up to one or more style attributes of an animated component, and then drive updates via animations using Animated.timing():
Animated.timing(
// Animate value over time
@@ -90,7 +90,7 @@
Animated provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
Animated.decay() starts with an initial velocity and gradually slows to a stop.
-Animated.spring() provides a simple spring physics model.
+Animated.spring() provides a basic spring physics model.
Animated.timing() animates a value over time using easing functions.
In most cases, you will be using timing(). By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
@@ -100,7 +100,7 @@
By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
Animatable components
-Only animatable components can be animated. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
+Only animatable components can be animated. These unique components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
createAnimatedComponent() can be used to make a component animatable.
@@ -119,7 +119,7 @@
Animated.sequence() starts the animations in order, waiting for each to complete before starting the next.
Animated.stagger() starts animations in order and in parallel, but with successive delays.
-Animations can also be chained together simply by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
+Animations can also be chained together by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
Combining animated values
You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value:
@@ -213,14 +213,14 @@
Animates a value according to an analytical spring model based on damped harmonic oscillation. Tracks velocity state to create fluid motions as the toValue updates, and can be chained together.
Config is an object that may have the following options.
Note that you can only define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one:
-The friction/tension or bounciness/speed options match the spring model in Facebook Pop, Rebound, and Origami.
+The friction/tension or bounciness/speed options match the spring model in Facebook Pop, Rebound, and Origami.
friction: Controls "bounciness"/overshoot. Default 7.
tension: Controls speed. Default 40.
speed: Controls speed of the animation. Default 12.
bounciness: Controls bounciness. Default 8.
-Specifying stiffness/damping/mass as parameters makes Animated.spring use an analytical spring model based on the motion equations of a damped harmonic oscillator. This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation primitive.
+Specifying stiffness/damping/mass as parameters makes Animated.spring use an analytical spring model based on the motion equations of a damped harmonic oscillator. This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation.
stiffness: The spring stiffness coefficient. Default 100.
damping: Defines how the spring’s motion should be damped due to the forces of friction. Default 10.
diff --git a/docs/0.50/flatlist.html b/docs/0.50/flatlist.html
index a217cc7ad2d..361588055e9 100644
--- a/docs/0.50/flatlist.html
+++ b/docs/0.50/flatlist.html
@@ -1,4 +1,4 @@
-FlatList · React Native
FlatList
A performant interface for rendering simple, flat lists, supporting the most handy features:
+FlatList
A performant interface for rendering, flat lists, supporting the most handy features:
- Fully cross-platform.
- Optional horizontal mode. diff --git a/docs/0.50/flatlist/index.html b/docs/0.50/flatlist/index.html index a217cc7ad2d..361588055e9 100644 --- a/docs/0.50/flatlist/index.html +++ b/docs/0.50/flatlist/index.html @@ -1,4 +1,4 @@ -
FlatList
A performant interface for rendering simple, flat lists, supporting the most handy features:
+FlatList
A performant interface for rendering, flat lists, supporting the most handy features:
- Fully cross-platform.
- Optional horizontal mode. diff --git a/docs/0.50/safeareaview.html b/docs/0.50/safeareaview.html index f6b2a6cd87e..e92d38b0281 100644 --- a/docs/0.50/safeareaview.html +++ b/docs/0.50/safeareaview.html @@ -71,7 +71,7 @@
SafeAreaView
The purpose of SafeAreaView is to render content within the safe area boundaries of a device. It is currently only applicable to iOS devices.
SafeAreaView renders nested content and automatically applies paddings reflect the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. Moreover, and most importantly, Safe Area's paddings reflect the physical limitation of the screen, such as rounded corners or camera notches (i.e. the sensor housing area on iPhone X).
Usage Example
-Simply wrap your top level view with a SafeAreaView with a flex: 1 style applied to it. You may also want to use a background color that matches your application's design.
Wrap your top level view with a SafeAreaView with a flex: 1 style applied to it. You may also want to use a background color that matches your application's design.
<SafeAreaView style={{flex: 1, backgroundColor: '#fff'}}>
<View style={{flex: 1}}>
<Text>Hello World!</Text>
diff --git a/docs/0.50/safeareaview/index.html b/docs/0.50/safeareaview/index.html
index f6b2a6cd87e..e92d38b0281 100644
--- a/docs/0.50/safeareaview/index.html
+++ b/docs/0.50/safeareaview/index.html
@@ -71,7 +71,7 @@
SafeAreaView
The purpose of SafeAreaView is to render content within the safe area boundaries of a device. It is currently only applicable to iOS devices.
SafeAreaView renders nested content and automatically applies paddings reflect the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. Moreover, and most importantly, Safe Area's paddings reflect the physical limitation of the screen, such as rounded corners or camera notches (i.e. the sensor housing area on iPhone X).
Usage Example
-Simply wrap your top level view with a SafeAreaView with a flex: 1 style applied to it. You may also want to use a background color that matches your application's design.
Wrap your top level view with a SafeAreaView with a flex: 1 style applied to it. You may also want to use a background color that matches your application's design.
<SafeAreaView style={{flex: 1, backgroundColor: '#fff'}}>
<View style={{flex: 1}}>
<Text>Hello World!</Text>
diff --git a/docs/0.50/scrollview.html b/docs/0.50/scrollview.html
index dad607ebb4e..4878fda8b81 100644
--- a/docs/0.50/scrollview.html
+++ b/docs/0.50/scrollview.html
@@ -69,12 +69,12 @@
}
});
ScrollView
Component that wraps platform ScrollView while providing integration with touch locking "responder" system.
-Keep in mind that ScrollViews must have a bounded height in order to work, since they contain unbounded-height children into a bounded container (via a scroll interaction). In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent views have bounded height. Forgetting to transfer {flex: 1} down the view stack can lead to errors here, which the element inspector makes easy to debug.
Keep in mind that ScrollViews must have a bounded height in order to work, since they contain unbounded-height children into a bounded container (via a scroll interaction). In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent views have bounded height. Forgetting to transfer {flex: 1} down the view stack can lead to errors here, which the element inspector can help to debug.
Doesn't yet support other contained responders from blocking this scroll view from becoming the responder.
<ScrollView> vs <FlatList> - which one to use?
ScrollView simply renders all its react child components at once. That makes it very easy to understand and use.
On the other hand, this has a performance downside. Imagine you have a very long list of items you want to display, maybe several screens worth of content. Creating JS components and native views for everything all at once, much of which may not even be shown, will contribute to slow rendering and increased memory usage.
-This is where FlatList comes into play. FlatList renders items lazily, just when they are about to appear, and removes items that scroll way off screen to save memory and processing time.
ScrollView renders all its react child components at once, but this has a performance downside.
Imagine you have a very long list of items you want to display, maybe several screens worth of content. Creating JS components and native views for everything all at once, much of which may not even be shown, will contribute to slow rendering and increased memory usage.
+This is where FlatList comes into play. FlatList renders items lazily, when they are about to appear, and removes items that scroll way off screen to save memory and processing time.
FlatList is also handy if you want to render separators between your items, multiple columns, infinite scroll loading, or any number of other features it supports out of the box.
Props
-
@@ -557,8 +557,8 @@ const styles = StyleSheet.create({
'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator isblack. This style is good against a light background.
+'white', scroll indicator iswhite. This style is good against a dark background.'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator isblack. This style is good against a light background.
+'white', scroll indicator iswhite. This style is good against a dark background.- Scroll loading.
- Scroll loading.
'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator is dark. This style is good against a light background.
+'white', scroll indicator is light. This style is good against a dark background.'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator is dark. This style is good against a light background.
+'white', scroll indicator is light. This style is good against a dark background.- Fully cross-platform.
- Optional horizontal mode. @@ -231,7 +231,7 @@ class MultiSelectList extends React.PureComponent {
- Fully cross-platform.
- Optional horizontal mode. @@ -231,7 +231,7 @@ class MultiSelectList extends React.PureComponent {
'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator is dark. This style is good against a light background.
+'white', scroll indicator is light. This style is good against a dark background.'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator is dark. This style is good against a light background.
+'white', scroll indicator is light. This style is good against a dark background.- Scroll loading.
- Scroll loading.
'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator is dark. This style is good against a light background.
+'white', scroll indicator is light. This style is good against a dark background.'default'(the default), same asblack.
-'black', scroll indicator is black. This style is good against a light background.
-'white', scroll indicator is white. This style is good against a dark background.
+'black', scroll indicator is dark. This style is good against a light background.
+'white', scroll indicator is light. This style is good against a dark background.
The style of the scroll indicators.
defaultValue
-Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
+Provides an initial value that will change when the user starts typing. Useful for use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
| Type | Required |
|---|
value
-The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to simply setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
| Type | Required |
|---|
defaultValue
-Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
+Provides an initial value that will change when the user starts typing. Useful for use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
| Type | Required |
|---|
value
-The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to simply setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
| Type | Required |
|---|
defaultValue
-Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
+Provides an initial value that will change when the user starts typing. Useful for use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
| Type | Required |
|---|
value
-The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to simply setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
| Type | Required |
|---|
defaultValue
-Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
+Provides an initial value that will change when the user starts typing. Useful for use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
| Type | Required |
|---|
value
-The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to simply setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
| Type | Required |
|---|
| Type | Required |
|---|
| Type | Required |
|---|
defaultValue
-Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
+Provides an initial value that will change when the user starts typing. Useful for use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
| Type | Required |
|---|
value
-The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to simply setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
| Type | Required |
|---|
defaultValue
-Provides an initial value that will change when the user starts typing. Useful for simple use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
+Provides an initial value that will change when the user starts typing. Useful for use-cases where you do not want to deal with listening to events and updating the value prop to keep the controlled state in sync.
| Type | Required |
|---|
value
-The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to simply setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
The value to show for the text input. TextInput is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set editable={false}, or set/update maxLength to prevent unwanted edits without flicker.
| Type | Required |
|---|