| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 | 
							- /**
 -  * Copyright (c) Facebook, Inc. and its affiliates.
 -  *
 -  * This source code is licensed under the MIT license found in the
 -  * LICENSE file in the root directory of this source tree.
 -  *
 -  * @format
 -  * @flow
 -  */
 - 
 - import React, {Component} from 'react';
 - import {
 -   StyleSheet,
 -   SafeAreaView,
 -   Text,
 -   TouchableOpacity,
 -   View,
 -   Keyboard,
 -   Button,
 - } from 'react-native';
 - 
 - import InlineWebView from './examples/InlineWebView';
 - 
 - const TESTS = {
 -   InlineWebView: {
 -     title: 'Inline HTML WebView',
 -     testId: 'inline-webview',
 -     description: 'Inline HTML WebView',
 -     render() {
 -       return <InlineWebView />;
 -     },
 -   },
 - };
 - 
 - type Props = {};
 - type State = {restarting: boolean, currentTest: Object};
 - 
 - export default class App extends Component<Props, State> {
 -   state = {
 -     restarting: false,
 -     currentTest: TESTS.InlineWebView,
 -   };
 - 
 -   _simulateRestart = () => {
 -     this.setState({restarting: true}, () => this.setState({restarting: false}));
 -   };
 - 
 -   _changeTest = testName => {
 -     this.setState({currentTest: TESTS[testName]});
 -   };
 - 
 -   render() {
 -     const {restarting, currentTest} = this.state;
 -     return (
 -       <SafeAreaView style={styles.container}>
 -         <TouchableOpacity
 -           style={styles.closeKeyboardView}
 -           onPress={() => Keyboard.dismiss()}
 -           testID="closeKeyboard"
 -         />
 - 
 -         <TouchableOpacity
 -           testID="restart_button"
 -           onPress={this._simulateRestart}
 -           style={styles.restartButton}
 -           activeOpacity={0.6}>
 -           <Text>Simulate Restart</Text>
 -         </TouchableOpacity>
 - 
 -         <View style={styles.testPickerContainer}>
 -           <Button
 -             testID="testType_getSetClear"
 -             title="Get/Set/Clear"
 -             onPress={() => this._changeTest('GetSetClear')}
 -           />
 -           <Button
 -             testID="testType_mergeItem"
 -             title="Merge Item"
 -             onPress={() => this._changeTest('MergeItem')}
 -           />
 -         </View>
 - 
 -         {restarting ? null : (
 -           <View
 -             testID={`example-${currentTest.testId}`}
 -             key={currentTest.title}
 -             style={styles.exampleContainer}>
 -             <Text style={styles.exampleTitle}>{currentTest.title}</Text>
 -             <Text style={styles.exampleDescription}>
 -               {currentTest.description}
 -             </Text>
 -             <View style={styles.exampleInnerContainer}>
 -               {currentTest.render()}
 -             </View>
 -           </View>
 -         )}
 -       </SafeAreaView>
 -     );
 -   }
 - }
 - 
 - const styles = StyleSheet.create({
 -   container: {
 -     flex: 1,
 -     backgroundColor: '#F5FCFF',
 -     padding: 8,
 -   },
 -   exampleContainer: {
 -     padding: 16,
 -     backgroundColor: '#FFF',
 -     borderColor: '#EEE',
 -     borderTopWidth: 1,
 -     borderBottomWidth: 1,
 -     flex: 1,
 -   },
 -   exampleTitle: {
 -     fontSize: 18,
 -   },
 -   exampleDescription: {
 -     color: '#333333',
 -     marginBottom: 16,
 -   },
 -   exampleInnerContainer: {
 -     borderColor: '#EEE',
 -     borderTopWidth: 1,
 -     paddingTop: 10,
 -     flex: 1,
 -   },
 -   restartButton: {
 -     padding: 6,
 -     fontSize: 16,
 -     borderRadius: 5,
 -     backgroundColor: '#F3F3F3',
 -     alignItems: 'center',
 -     justifyContent: 'center',
 -     alignSelf: 'flex-end',
 -   },
 -   closeKeyboardView: {
 -     width: 5,
 -     height: 5,
 -   },
 -   testPickerContainer: {
 -     flexDirection: 'row',
 -     flexWrap: 'wrap',
 -   },
 - });
 
 
  |