From db7a1543608f45a0ad39b80564f22f5eca135822 Mon Sep 17 00:00:00 2001 From: Dave Miller Date: Fri, 18 Mar 2016 04:20:36 -0700 Subject: [PATCH] Open source Modal Summary: This open sources an internal Modal View Reviewed By: mkonicek Differential Revision: D3065229 fb-gh-sync-id: 763996aef375883d94f70e617bfc7835a9cecb6f shipit-source-id: 763996aef375883d94f70e617bfc7835a9cecb6f --- Examples/UIExplorer/ModalExample.js | 10 +- Examples/UIExplorer/UIExplorerList.android.js | 4 + Libraries/Modal/Modal.js | 2 - ReactAndroid/build.gradle | 2 +- .../java/com/facebook/react/views/modal/BUCK | 25 ++ .../views/modal/ModalHostShadowNode.java | 66 +++++ .../views/modal/ReactModalHostManager.java | 103 +++++++ .../react/views/modal/ReactModalHostView.java | 253 ++++++++++++++++++ .../react/views/modal/RequestCloseEvent.java | 35 +++ .../facebook/react/views/modal/ShowEvent.java | 35 +++ ReactAndroid/src/main/res/BUCK | 9 + .../main/res/views/modal/anim/slide_down.xml | 6 + .../main/res/views/modal/anim/slide_up.xml | 6 + .../main/res/views/modal/values/themes.xml | 20 ++ 14 files changed, 569 insertions(+), 7 deletions(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK create mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/modal/ModalHostShadowNode.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostManager.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/modal/RequestCloseEvent.java create mode 100644 ReactAndroid/src/main/java/com/facebook/react/views/modal/ShowEvent.java create mode 100644 ReactAndroid/src/main/res/views/modal/anim/slide_down.xml create mode 100644 ReactAndroid/src/main/res/views/modal/anim/slide_up.xml create mode 100644 ReactAndroid/src/main/res/views/modal/values/themes.xml diff --git a/Examples/UIExplorer/ModalExample.js b/Examples/UIExplorer/ModalExample.js index eb925b5eb..a3238c76f 100644 --- a/Examples/UIExplorer/ModalExample.js +++ b/Examples/UIExplorer/ModalExample.js @@ -19,7 +19,7 @@ var React = require('react-native'); var { Modal, StyleSheet, - SwitchIOS, + Switch, Text, TouchableHighlight, View, @@ -96,7 +96,9 @@ var ModalExample = React.createClass({ + visible={this.state.modalVisible} + onRequestClose={() => {this._setModalVisible(false)}} + > This modal was presented {this.state.animated ? 'with' : 'without'} animation. @@ -111,12 +113,12 @@ var ModalExample = React.createClass({ Animated - + Transparent - +