From 2424711a03260652c5e904e54905c18fd23ec4cf Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Wed, 11 Mar 2015 13:53:30 -0700 Subject: [PATCH] Unforked ExceptionsManager, AlertManager and AppState --- Examples/UIExplorer/AppStateExample.js | 60 ++++++++++ Examples/UIExplorer/UIExplorerList.js | 1 + Libraries/AppState/AppState.js | 58 ++++++++++ .../RCTNetwork.xcodeproj/project.pbxproj | 6 + Libraries/Network/RCTReachability.h | 11 ++ Libraries/Network/RCTReachability.m | 85 ++++++++++++++ Libraries/react-native/react-native.js | 1 + ReactKit/Modules/RCTAppState.h | 7 ++ ReactKit/Modules/RCTAppState.m | 105 ++++++++++++++++++ ReactKit/Modules/RCTExceptionsManager.h | 10 +- ReactKit/Modules/RCTExceptionsManager.m | 22 +++- ReactKit/ReactKit.xcodeproj/project.pbxproj | 20 ++-- 12 files changed, 376 insertions(+), 10 deletions(-) create mode 100644 Examples/UIExplorer/AppStateExample.js create mode 100644 Libraries/AppState/AppState.js create mode 100644 Libraries/Network/RCTReachability.h create mode 100644 Libraries/Network/RCTReachability.m create mode 100644 ReactKit/Modules/RCTAppState.h create mode 100644 ReactKit/Modules/RCTAppState.m diff --git a/Examples/UIExplorer/AppStateExample.js b/Examples/UIExplorer/AppStateExample.js new file mode 100644 index 000000000..ea6400b91 --- /dev/null +++ b/Examples/UIExplorer/AppStateExample.js @@ -0,0 +1,60 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var React = require('react-native'); +var { + AppState, + StyleSheet, + Text, + TouchableHighlight, + View, +} = React; + +var Button = React.createClass({ + render: function() { + return ( + + + {this.props.label} + + + ); + } +}); + +var styles = StyleSheet.create({ + button: { + padding: 10, + alignItems: 'center', + justifyContent: 'center', + }, + buttonLabel: { + color: 'blue', + }, +}); + +exports.title = 'AppState'; +exports.description = 'App background status and badge value'; +exports.examples = [ +{ + title: 'Set Badge Number', + render: function() { + return ( + +