Ver código fonte

Merge branch 'Android_implementation' of https://github.com/wix/react-native-navigation into Android_implementation

Yedidya Kennard 9 anos atrás
pai
commit
d3646eb434
1 arquivos alterados com 17 adições e 2 exclusões
  1. 17
    2
      example-redux/src/screens/PushedScreen.js

+ 17
- 2
example-redux/src/screens/PushedScreen.js Ver arquivo

4
   View,
4
   View,
5
   ScrollView,
5
   ScrollView,
6
   TouchableOpacity,
6
   TouchableOpacity,
7
-  StyleSheet
7
+  StyleSheet,
8
+  TextInput
8
 } from 'react-native';
9
 } from 'react-native';
9
 import { connect } from 'react-redux';
10
 import { connect } from 'react-redux';
10
 import * as counterActions from '../reducers/counter/actions';
11
 import * as counterActions from '../reducers/counter/actions';
13
 class PushedScreen extends Component {
14
 class PushedScreen extends Component {
14
   constructor(props) {
15
   constructor(props) {
15
     super(props);
16
     super(props);
17
+    this.bgColor = this.getRandomColor();
18
+    console.log('constructor');
16
   }
19
   }
20
+
21
+  getRandomColor() {
22
+    var letters = '0123456789ABCDEF'.split('');
23
+    var color = '#';
24
+    for (var i = 0; i < 6; i++ ) {
25
+      color += letters[Math.floor(Math.random() * 16)];
26
+    }
27
+    return color;
28
+  }
29
+
17
   render() {
30
   render() {
18
     return (
31
     return (
19
-      <View style={{flex: 1, padding: 20}}>
32
+      <View style={{flex: 1, padding: 20, backgroundColor: this.bgColor}}>
20
 
33
 
21
         <Text style={styles.text}>
34
         <Text style={styles.text}>
22
           <Text style={{fontWeight: '500'}}>Counter: </Text> {this.props.counter.count}
35
           <Text style={{fontWeight: '500'}}>Counter: </Text> {this.props.counter.count}
34
           <Text style={styles.button}>Pop Screen</Text>
47
           <Text style={styles.button}>Pop Screen</Text>
35
         </TouchableOpacity>
48
         </TouchableOpacity>
36
 
49
 
50
+        <TextInput style={{height: 40, borderColor: 'gray', borderWidth: 1}}/>
51
+
37
       </View>
52
       </View>
38
     );
53
     );
39
   }
54
   }