'use strict'; var React = require('react'); var ReactNative = require('react-native'); var { AppRegistry, StyleSheet, Text, ScrollView, TouchableOpacity } = ReactNative; require('./LightBox'); require('./Notification'); var Controllers = require('react-native-controllers'); var { Modal, ControllerRegistry, Constants, Notification } = Controllers; var MovieListScreen = React.createClass({ componentDidMount: function() { Controllers.NavigationControllerIOS("movies_nav").setLeftButtons([{ title: "Burger", onPress: function() { Controllers.DrawerControllerIOS("drawer").toggle({side:"left"}); } }]); Controllers.NavigationControllerIOS("movies_nav").setRightButtons([{ title: "MegaBurger", onPress: function() { Controllers.DrawerControllerIOS("drawer").toggle({side:"right"}); } }]); }, onButtonClick: function(val) { Controllers.DrawerControllerIOS("drawer").setStyle({ animationType: val }); }, onShowLightBoxClick: function(backgroundBlur, backgroundColor = undefined) { Modal.showLightBox({ component: 'LightBox', passProps: { greeting: 'hello world' }, style: { backgroundBlur: backgroundBlur, backgroundColor: backgroundColor } }); }, onShowNotificationClick: function(animationParams, shadowRadius, position) { Notification.show({ component: 'NotificationExample', passProps: { greeting: 'This is a Notification!' }, position: position, animation: animationParams, dismissWithSwipe: true, autoDismissTimerSec: 5, shadowRadius: shadowRadius }); }, onShowModalVcClick: async function() { // defaults: Modal.showController('ModalScreenTester'); // this example shows animation type and passProps Modal.showController('ModalScreenTester', 'slide-up', { greeting: 'hi there!' }); }, onShowModalMoreDrawerOptionsVcClick: async function() { //Modal.showController('MoreDrawerScreenTester'); ControllerRegistry.setRootController('MoreDrawerScreenTester', 'slide-down', { greeting: 'how you doin?' }); }, onToggleTabBarClick: async function() { this.setState({ tabBarHidden: !this.state.tabBarHidden }); Controllers.TabBarControllerIOS("main").setHidden({hidden: this.state.tabBarHidden, animated: true}); }, onReplaceRootAnimatedClick: function() { // this example shows animation type and passProps ControllerRegistry.setRootController('ModalScreenTester', 'slide-down', { greeting: 'how you doin?' }); }, render: function() { return ( Side Menu Example There's a right and a left side menu in this example. Control the side menu animation using the options below: Door Parallax Slide Slide & Scale More... Modal Example Use the various options below to bring up modal screens: LightBox (dark blur) LightBox (light blur) LightBox (light blur + color overlay) LightBox (no blur, no color overlay) Show Modal ViewController Replace root animated Show Default Notification Show Simple Notification Show Notification With Shadow Show Swing Notification Show Bottom Notification ); }, }); var styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#F5FCFF' }, button: { textAlign: 'center', fontSize: 18, marginBottom: 10, marginTop:10, color:'blue' }, lineView: { height: 1, marginTop: 4, marginBottom: 4, marginLeft: 8, marginRight: 8, backgroundColor:'gray' } }); AppRegistry.registerComponent('MovieListScreen', () => MovieListScreen); module.exports = MovieListScreen;