Skip to content

Commit

Permalink
Rename and fix errors in 0.60 and 0.61 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
teikjun committed Aug 28, 2020
1 parent 6e1ee9c commit 0a314ba
Show file tree
Hide file tree
Showing 322 changed files with 38,312 additions and 259 deletions.
297 changes: 297 additions & 0 deletions website/versioned_docs/version-0.60/accessibility.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions website/versioned_docs/version-0.60/accessibilityinfo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-0.60-accessibilityinfo
id: accessibilityinfo
title: AccessibilityInfo
original_id: accessibilityinfo
---

Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The `AccessibilityInfo` API is designed for this purpose. You can use it to query the current state of the screen reader as well as to register to be notified when the state of the screen reader changes.
Expand Down
3 changes: 1 addition & 2 deletions website/versioned_docs/version-0.60/actionsheetios.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-0.60-actionsheetios
id: actionsheetios
title: ActionSheetIOS
original_id: actionsheetios
---

# Reference
Expand Down
3 changes: 1 addition & 2 deletions website/versioned_docs/version-0.60/activityindicator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-0.60-activityindicator
id: activityindicator
title: ActivityIndicator
original_id: activityindicator
---

Displays a circular loading indicator.
Expand Down
11 changes: 5 additions & 6 deletions website/versioned_docs/version-0.60/alert.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-0.60-alert
id: alert
title: Alert
original_id: alert
---

Launches an alert dialog with the specified title and message.
Expand All @@ -14,14 +13,14 @@ This is an API that works both on Android and iOS and can show static alerts. To

<table>
<tr>
<th style="width: 50%;">iOS</th>
<th style="width: 50%;">Android</th>
<th style={{width: "50%"}}>iOS</th>
<th style={{width: "50%"}}>Android</th>
</tr>
<tr>
<td style="width: 50%;">
<td style={{width: "50%"}}>
<center><img src="/docs/assets/Alert/exampleios.gif"></img></center>
</td>
<td style="width: 50%;">
<td style={{width: "50%"}}>
<center><img src="/docs/assets/Alert/exampleandroid.gif"></img></center>
</td>
</tr>
Expand Down
3 changes: 1 addition & 2 deletions website/versioned_docs/version-0.60/alertios.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-0.60-alertios
id: alertios
title: AlertIOS
original_id: alertios
---

> **Deprecated.** `AlertIOS` has been moved to [`Alert`](alert.md)
Expand Down
3 changes: 1 addition & 2 deletions website/versioned_docs/version-0.60/animated.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
id: version-0.60-animated
id: animated
title: Animated
original_id: 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.
Expand Down
228 changes: 228 additions & 0 deletions website/versioned_docs/version-0.60/animatedvalue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
---
id: animatedvalue
title: AnimatedValue
---

Standard value for driving animations. One `Animated.Value` can drive multiple properties in a synchronized fashion, but can only be driven by one mechanism at a time. Using a new mechanism (e.g. starting a new animation, or calling `setValue`) will stop any previous ones.

Typically initialized with `new Animated.Value(0);`

See also [`Animated`](animated.md).

### Methods

- [`setValue`](animatedvalue.md#setvalue)
- [`setOffset`](animatedvalue.md#setoffset)
- [`flattenOffset`](animatedvalue.md#flattenoffset)
- [`extractOffset`](animatedvalue.md#extractoffset)
- [`addListener`](animatedvalue.md#addlistener)
- [`removeListener`](animatedvalue.md#removelistener)
- [`removeAllListeners`](animatedvalue.md#removealllisteners)
- [`stopAnimation`](animatedvalue.md#stopanimation)
- [`resetAnimation`](animatedvalue.md#resetanimation)
- [`interpolate`](animatedvalue.md#interpolate)
- [`animate`](animatedvalue.md#animate)
- [`stopTracking`](animatedvalue.md#stoptracking)
- [`track`](animatedvalue.md#track)

---

# Reference

## Methods

### `setValue()`

```jsx
setValue(value);
```

Directly set the value. This will stop any animations running on the value and update all the bound properties.

**Parameters:**

| Name | Type | Required | Description |
| ----- | ------ | -------- | ----------- |
| value | number | Yes | Value |

---

### `setOffset()`

```jsx
setOffset(offset);
```

Sets an offset that is applied on top of whatever value is set, whether via `setValue`, an animation, or `Animated.event`. Useful for compensating things like the start of a pan gesture.

**Parameters:**

| Name | Type | Required | Description |
| ------ | ------ | -------- | ------------ |
| offset | number | Yes | Offset value |

---

### `flattenOffset()`

```jsx
flattenOffset();
```

Merges the offset value into the base value and resets the offset to zero. The final output of the value is unchanged.

---

### `extractOffset()`

```jsx
extractOffset();
```

Sets the offset value to the base value, and resets the base value to zero. The final output of the value is unchanged.

---

### `addListener()`

```jsx
addListener(callback);
```

Adds an asynchronous listener to the value so you can observe updates from animations. This is useful because there is no way to synchronously read the value because it might be driven natively.

Returns a string that serves as an identifier for the listener.

**Parameters:**

| Name | Type | Required | Description |
| -------- | -------- | -------- | ------------------------------------------------------------------------------------------- |
| callback | function | Yes | The callback function which will receive an object with a `value` key set to the new value. |

---

### `removeListener()`

```jsx
removeListener(id);
```

Unregister a listener. The `id` param shall match the identifier previously returned by `addListener()`.

**Parameters:**

| Name | Type | Required | Description |
| ---- | ------ | -------- | ---------------------------------- |
| id | string | Yes | Id for the listener being removed. |

---

### `removeAllListeners()`

```jsx
removeAllListeners();
```

Remove all registered listeners.

---

### `stopAnimation()`

```jsx
stopAnimation([callback]);
```

Stops any running animation or tracking. `callback` is invoked with the final value after stopping the animation, which is useful for updating state to match the animation position with layout.

**Parameters:**

| Name | Type | Required | Description |
| -------- | -------- | -------- | --------------------------------------------- |
| callback | function | No | A function that will receive the final value. |

---

### `resetAnimation()`

```jsx
resetAnimation([callback]);
```

Stops any animation and resets the value to its original.

**Parameters:**

| Name | Type | Required | Description |
| -------- | -------- | -------- | ------------------------------------------------ |
| callback | function | No | A function that will receive the original value. |

---

### `interpolate()`

```jsx
interpolate(config);
```

Interpolates the value before updating the property, e.g. mapping 0-1 to 0-10.

See `AnimatedInterpolation.js`

**Parameters:**

| Name | Type | Required | Description |
| ------ | ------ | -------- | ----------- |
| config | object | Yes | See below. |

The `config` object is composed of the following keys:

- `inputRange`: an array of numbers
- `outputRange`: an array of numbers or strings
- `easing` (optional): a function that returns a number, given an input number
- `extrapolate` (optional): a string such as 'extend', 'identity', or 'clamp'
- `extrapolateLeft` (optional): a string such as 'extend', 'identity', or 'clamp'
- `extrapolateRight` (optional): a string such as 'extend', 'identity', or 'clamp'

---

### `animate()`

```jsx
animate(animation, callback);
```

Typically only used internally, but could be used by a custom Animation class.

**Parameters:**

| Name | Type | Required | Description |
| --------- | --------- | -------- | ------------------- |
| animation | Animation | Yes | See `Animation.js`. |
| callback | function | Yes | Callback function. |

---

### `stopTracking()`

```jsx
stopTracking();
```

Typically only used internally.

---

### `track()`

```jsx
track(tracking);
```

Typically only used internally.

**Parameters:**

| Name | Type | Required | Description |
| -------- | ------------ | -------- | --------------------- |
| tracking | AnimatedNode | Yes | See `AnimatedNode.js` |

0 comments on commit 0a314ba

Please sign in to comment.