/** * The examples provided by Facebook are for non-commercial testing and * evaluation purposes only. * * Facebook reserves all rights not expressly granted. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * @flow */ 'use strict'; const React = require('react-native'); const { StyleSheet, View, Text, TouchableHighlight, StatusBar, } = React; type BarStyle = 'default' | 'light-content'; type ShowHideTransition = 'fade' | 'slide'; type State = { animated: boolean, backgroundColor: string, hidden?: boolean, showHideTransition: ShowHideTransition, translucent?: boolean, barStyle?: BarStyle, networkActivityIndicatorVisible?: boolean }; exports.framework = 'React'; exports.title = ''; exports.description = 'Component for controlling the status bar'; const colors = [ '#ff0000', '#00ff00', '#0000ff', ]; const barStyles = [ 'default', 'light-content', ]; const showHideTransitions = [ 'fade', 'slide', ]; const StatusBarExample = React.createClass({ getInitialState(): State { return { animated: true, backgroundColor: this._getValue(colors, 0), showHideTransition: this._getValue(showHideTransitions, 0), }; }, _colorIndex: 0, _barStyleIndex: 0, _showHideTransitionIndex: 0, _getValue(values: Array, index: number): any { return values[index % values.length]; }, render() { return ( ); }, }); exports.examples = [{ title: 'Status Bar', render() { return ; }, }]; var styles = StyleSheet.create({ wrapper: { borderRadius: 5, marginBottom: 5, }, button: { borderRadius: 5, backgroundColor: '#eeeeee', padding: 10, }, title: { marginTop: 16, marginBottom: 8, fontWeight: 'bold', } });