From b75b2eb92ff319b922dd582f4010747dbee23665 Mon Sep 17 00:00:00 2001 From: Rajendran Nadar Date: Wed, 12 Jun 2019 18:10:53 +0530 Subject: [PATCH] update statusbar.md (#978) * sort alphabetically * new apis added --- docs/statusbar.md | 162 ++++++++++++++++++++++++++++++---------------- 1 file changed, 107 insertions(+), 55 deletions(-) diff --git a/docs/statusbar.md b/docs/statusbar.md index 30c072a08c3b5a..14750ea0e4aa2b 100644 --- a/docs/statusbar.md +++ b/docs/statusbar.md @@ -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) --- @@ -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. @@ -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 | --- @@ -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. | --- @@ -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. | --- @@ -209,9 +261,9 @@ Control the translucency of the status bar. Android-only. ## Type Definitions -### StatusBarStyle +### StatusBarAnimation -Status bar style +Status bar animation | Type | | ------ | @@ -219,17 +271,17 @@ Status bar style **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 | | ------ | @@ -237,8 +289,8 @@ Status bar animation **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) |