Skip to content

Commit

Permalink
update statusbar.md (facebook#978)
Browse files Browse the repository at this point in the history
* sort alphabetically

* new apis added
  • Loading branch information
raajnadar authored and cpojer committed Jun 12, 2019
1 parent 8cd56f3 commit b75b2eb
Showing 1 changed file with 107 additions and 55 deletions.
162 changes: 107 additions & 55 deletions docs/statusbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,28 @@ For cases where using a component is not ideal, there is also an imperative API
### Props

- [`animated`](statusbar.md#animated)
- [`backgroundColor`](statusbar.md#backgroundcolor)
- [`barStyle`](statusbar.md#barstyle)
- [`hidden`](statusbar.md#hidden)
- [`backgroundColor`](statusbar.md#backgroundcolor)
- [`translucent`](statusbar.md#translucent)
- [`networkActivityIndicatorVisible`](statusbar.md#networkactivityindicatorvisible)
- [`showHideTransition`](statusbar.md#showhidetransition)
- [`translucent`](statusbar.md#translucent)

### Methods

- [`setHidden`](statusbar.md#sethidden)
- [`popStackEntry`](statusbar.md#popstackentry)
- [`pushStackEntry`](statusbar.md#pushstackentry)
- [`replaceStackEntry`](statusbar.md#replacestackentry)
- [`setBackgroundColor`](statusbar.md#setbackgroundcolor)
- [`setBarStyle`](statusbar.md#setbarstyle)
- [`setHidden`](statusbar.md#sethidden)
- [`setNetworkActivityIndicatorVisible`](statusbar.md#setnetworkactivityindicatorvisible)
- [`setBackgroundColor`](statusbar.md#setbackgroundcolor)
- [`setTranslucent`](statusbar.md#settranslucent)

### Type Definitions

- [`StatusBarStyle`](statusbar.md#statusbarstyle)
- [`StatusBarAnimation`](statusbar.md#statusbaranimation)
- [`StatusBarStyle`](statusbar.md#statusbarstyle)

---

Expand All @@ -66,6 +69,16 @@ If the transition between status bar property changes should be animated. Suppor

---

### `backgroundColor`

The background color of the status bar.

| Type | Required | Platform |
| ------------------ | -------- | -------- |
| [color](colors.md) | No | Android |

---

### `barStyle`

Sets the color of the status bar text.
Expand All @@ -86,13 +99,23 @@ If the status bar is hidden.

---

### `backgroundColor`
### `networkActivityIndicatorVisible`

The background color of the status bar.
If the network activity indicator should be visible.

| Type | Required | Platform |
| ------------------ | -------- | -------- |
| [color](colors.md) | No | Android |
| Type | Required | Platform |
| ---- | -------- | -------- |
| bool | No | iOS |

---

### `showHideTransition`

The transition effect when showing and hiding the status bar using the `hidden` prop. Defaults to 'fade'.

| Type | Required | Platform |
| --------------------- | -------- | -------- |
| enum('fade', 'slide') | No | iOS |

---

Expand All @@ -104,42 +127,71 @@ If the status bar is translucent. When translucent is set to true, the app will
| ---- | -------- | -------- |
| bool | No | Android |

## Methods

### `popStackEntry()`

```javascript
static popStackEntry(entry: any)
```

Pop a StatusBar entry from the stack.

**Parameters:**

| Name | Type | Required | Description |
| ----- | ---- | -------- | ------------------------------------- |
| entry | any | Yes | Entry returned from `pushStackEntry`. |

---

### `networkActivityIndicatorVisible`
### `pushStackEntry()`

If the network activity indicator should be visible.
```javascript
static pushStackEntry(props: any)
```

| Type | Required | Platform |
| ---- | -------- | -------- |
| bool | No | iOS |
Push a StatusBar entry onto the stack. The return value should be passed to `popStackEntry` when complete.

**Parameters:**

| Name | Type | Required | Description |
| ----- | ---- | -------- | ---------------------------------------------------------------- |
| props | any | Yes | Object containing the StatusBar props to use in the stack entry. |

---

### `showHideTransition`
### `replaceStackEntry()`

The transition effect when showing and hiding the status bar using the `hidden` prop. Defaults to 'fade'.
```javascript
static replaceStackEntry(entry: any, props: any)
```

| Type | Required | Platform |
| --------------------- | -------- | -------- |
| enum('fade', 'slide') | No | iOS |
Replace an existing StatusBar stack entry with new props.

## Methods
**Parameters:**

### `setHidden()`
| Name | Type | Required | Description |
| ----- | ---- | -------- | ---------------------------------------------------------------------------- |
| entry | any | Yes | Entry returned from `pushStackEntry` to replace. |
| props | any | Yes | Object containing the StatusBar props to use in the replacement stack entry. |

---

### `setBackgroundColor()`

```javascript
static setHidden(hidden: boolean, [animation]: StatusBarAnimation)
static setBackgroundColor(color: string, [animated]: boolean)
```

Show or hide the status bar
Set the background color for the status bar. Android-only

**Parameters:**

| Name | Type | Required | Description |
| --------- | ----------------------------------------------------- | -------- | ---------------------------------------------------------------- |
| hidden | boolean | Yes | Hide the status bar. |
| animation | [StatusBarAnimation](statusbar.md#statusbaranimation) | No | Optional animation when changing the status bar hidden property. |
| Name | Type | Required | Description |
| -------- | ------- | -------- | ------------------------- |
| color | string | Yes | Background color. |
| animated | boolean | No | Animate the style change. |

---

Expand All @@ -160,36 +212,36 @@ Set the status bar style

---

### `setNetworkActivityIndicatorVisible()`
### `setHidden()`

```javascript
static setNetworkActivityIndicatorVisible(visible: boolean)
static setHidden(hidden: boolean, [animation]: StatusBarAnimation)
```

Control the visibility of the network activity indicator. iOS-only.
Show or hide the status bar

**Parameters:**

| Name | Type | Required | Description |
| ------- | ------- | -------- | ------------------- |
| visible | boolean | Yes | Show the indicator. |
| Name | Type | Required | Description |
| --------- | ----------------------------------------------------- | -------- | ---------------------------------------------------------------- |
| hidden | boolean | Yes | Hide the status bar. |
| animation | [StatusBarAnimation](statusbar.md#statusbaranimation) | No | Optional animation when changing the status bar hidden property. |

---

### `setBackgroundColor()`
### `setNetworkActivityIndicatorVisible()`

```javascript
static setBackgroundColor(color: string, [animated]: boolean)
static setNetworkActivityIndicatorVisible(visible: boolean)
```

Set the background color for the status bar. Android-only
Control the visibility of the network activity indicator. iOS-only.

**Parameters:**

| Name | Type | Required | Description |
| -------- | ------- | -------- | ------------------------- |
| color | string | Yes | Background color. |
| animated | boolean | No | Animate the style change. |
| Name | Type | Required | Description |
| ------- | ------- | -------- | ------------------- |
| visible | boolean | Yes | Show the indicator. |

---

Expand All @@ -209,36 +261,36 @@ Control the translucency of the status bar. Android-only.

## Type Definitions

### StatusBarStyle
### StatusBarAnimation

Status bar style
Status bar animation

| Type |
| ------ |
| \$Enum |

**Constants:**

| Value | Description |
| ------------- | -------------------------------------------------------------------- |
| default | Default status bar style (dark for iOS, light for Android) |
| light-content | Dark background, white texts and icons |
| dark-content | Light background, dark texts and icons (requires API>=23 on Android) |
| Value | Description |
| ----- | --------------- |
| none | No animation |
| fade | Fade animation |
| slide | Slide animation |

---

### StatusBarAnimation
### StatusBarStyle

Status bar animation
Status bar style

| Type |
| ------ |
| \$Enum |

**Constants:**

| Value | Description |
| ----- | --------------- |
| none | No animation |
| fade | Fade animation |
| slide | Slide animation |
| Value | Description |
| ------------- | -------------------------------------------------------------------- |
| default | Default status bar style (dark for iOS, light for Android) |
| light-content | Dark background, white texts and icons |
| dark-content | Light background, dark texts and icons (requires API>=23 on Android) |

0 comments on commit b75b2eb

Please sign in to comment.