From 4de616b4c1a9d3556632a93504828f0539fa4fa5 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 6 Jun 2016 08:58:35 -0700 Subject: [PATCH] Remove deprecated calls from StatusBarIOS Reviewed By: nicklockwood Differential Revision: D3346701 fbshipit-source-id: 17809a4cd686f3b431257e85d85770aee640bbc9 --- Examples/UIExplorer/StatusBarIOSExample.js | 118 ------------------ Examples/UIExplorer/UIExplorerList.ios.js | 4 - .../Components/StatusBar/StatusBarIOS.ios.js | 28 +---- 3 files changed, 3 insertions(+), 147 deletions(-) delete mode 100644 Examples/UIExplorer/StatusBarIOSExample.js diff --git a/Examples/UIExplorer/StatusBarIOSExample.js b/Examples/UIExplorer/StatusBarIOSExample.js deleted file mode 100644 index 27a00de49..000000000 --- a/Examples/UIExplorer/StatusBarIOSExample.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * 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'; - -var React = require('react'); -var ReactNative = require('react-native'); -var { - StyleSheet, - View, - Text, - TouchableHighlight, - StatusBarIOS, -} = ReactNative; - -exports.framework = 'React'; -exports.title = 'StatusBarIOS'; -exports.description = 'Module for controlling iOS status bar'; -exports.examples = [{ - title: 'Status Bar Style', - render() { - return ( - - {['default', 'light-content'].map((style) => - StatusBarIOS.setStyle(style)}> - - setStyle('{style}') - - - )} - - ); - }, -}, { - title: 'Status Bar Style Animated', - render() { - return ( - - {['default', 'light-content'].map((style) => - StatusBarIOS.setStyle(style, true)}> - - setStyle('{style}', true) - - - )} - - ); - }, -}, { - title: 'Status Bar Hidden', - render() { - return ( - - {['none', 'fade', 'slide'].map((animation) => - - StatusBarIOS.setHidden(true, animation)}> - - setHidden(true, '{animation}') - - - StatusBarIOS.setHidden(false, animation)}> - - setHidden(false, '{animation}') - - - - )} - - ); - }, -}, { - title: 'Status Bar Network Activity Indicator', - render() { - return ( - - StatusBarIOS.setNetworkActivityIndicatorVisible(true)}> - - setNetworkActivityIndicatorVisible(true) - - - StatusBarIOS.setNetworkActivityIndicatorVisible(false)}> - - setNetworkActivityIndicatorVisible(false) - - - - ); - }, -}]; - -var styles = StyleSheet.create({ - wrapper: { - borderRadius: 5, - marginBottom: 5, - }, - button: { - backgroundColor: '#eeeeee', - padding: 10, - }, -}); diff --git a/Examples/UIExplorer/UIExplorerList.ios.js b/Examples/UIExplorer/UIExplorerList.ios.js index b93518faa..5aefa3288 100644 --- a/Examples/UIExplorer/UIExplorerList.ios.js +++ b/Examples/UIExplorer/UIExplorerList.ios.js @@ -243,10 +243,6 @@ const APIExamples: Array = [ key: 'SnapshotExample', module: require('./SnapshotExample'), }, - { - key: 'StatusBarIOSExample', - module: require('./StatusBarIOSExample'), - }, { key: 'TimerExample', module: require('./TimerExample'), diff --git a/Libraries/Components/StatusBar/StatusBarIOS.ios.js b/Libraries/Components/StatusBar/StatusBarIOS.ios.js index 92e75b1d1..a3aceaac7 100644 --- a/Libraries/Components/StatusBar/StatusBarIOS.ios.js +++ b/Libraries/Components/StatusBar/StatusBarIOS.ios.js @@ -12,33 +12,11 @@ 'use strict'; const NativeEventEmitter = require('NativeEventEmitter'); -const StatusBar = require('StatusBar'); -const StatusBarManager = require('NativeModules').StatusBarManager; - -import type {StatusBarStyle, StatusBarAnimation} from 'StatusBar'; +const { StatusBarManager } = require('NativeModules'); /** - * Deprecated. Use `StatusBar` instead. + * Use `StatusBar` for mutating the status bar. */ -class StatusBarIOS extends NativeEventEmitter { - - setStyle(style: StatusBarStyle, animated?: boolean) { - console.warn('`StatusBarIOS.setStyle` is deprecated. Use `StatusBar.setBarStyle` instead.'); - StatusBar.setBarStyle(style, animated); - } - - setHidden(hidden: boolean, animation?: StatusBarAnimation) { - console.warn('`StatusBarIOS.setHidden` is deprecated. Use `StatusBar.setHidden` instead.'); - StatusBar.setHidden(hidden, animation); - } - - setNetworkActivityIndicatorVisible(visible: boolean) { - console.warn( - '`StatusBarIOS.setNetworkActivityIndicatorVisible` is deprecated. ' + - 'Use `StatusBar.setNetworkActivityIndicatorVisible` instead.' - ); - StatusBar.setNetworkActivityIndicatorVisible(visible); - } -} +class StatusBarIOS extends NativeEventEmitter {} module.exports = new StatusBarIOS(StatusBarManager);