Explorar el Código

Update example

Guy Carmeli hace 8 años
padre
commit
1865df194f

+ 11
- 2
example-redux/src/screens/FirstTabScreen.js Ver fichero

@@ -40,8 +40,9 @@ class FirstTabScreen extends Component {
40 40
       }
41 41
     ],
42 42
     fab: {
43
-      id: 'share',
43
+      collapsedId: 'share',
44 44
       collapsedIcon: require('../../img/ic_share.png'),
45
+      expendedId: 'clear',
45 46
       expendedIcon: require('../../img/ic_clear.png'),
46 47
       backgroundColor: '#3F51B5',
47 48
       actions: [
@@ -66,16 +67,24 @@ class FirstTabScreen extends Component {
66 67
           backgroundColor: '#FF5722'
67 68
         }
68 69
       ]
69
-
70 70
     }
71 71
   };
72 72
 
73 73
   constructor(props) {
74 74
     super(props);
75
+    console.log('FirstTabScreen', 'constructor');
75 76
     // if you want to listen on navigator events, set this up
76 77
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
77 78
   }
78 79
 
80
+  componentWillMount() {
81
+    console.log('FirstTabScreen', 'componentWillMount');
82
+  }
83
+
84
+  componentWillUnmount() {
85
+    console.log('FirstTabScreen', 'componentWillUnmount');
86
+  }
87
+
79 88
   onNavigatorEvent(event) {
80 89
     if (event.type == 'DeepLink') {
81 90
       this.handleDeepLink(event);

+ 8
- 0
example-redux/src/screens/ListScreen.js Ver fichero

@@ -47,6 +47,14 @@ class ListScreen extends Component {
47 47
     console.log('ListScreen', 'Unhandled event ' + event.id);
48 48
   }
49 49
 
50
+  componentWillMount() {
51
+    console.log('ListScreen', 'componentWillMount');
52
+  }
53
+
54
+  componentWillUnmount() {
55
+    console.log('ListScreen', 'componentWillUnmount');
56
+  }
57
+
50 58
   onTabSelected() {
51 59
     console.log('ListScreen', 'onTabSelected');
52 60
     this.props.navigator.setButtons({

+ 7
- 2
example-redux/src/screens/PushedScreen.js Ver fichero

@@ -31,7 +31,7 @@ class PushedScreen extends Component {
31 31
       color: '#00ff00'
32 32
     },
33 33
     fab: {
34
-      id: 'share',
34
+      collapsedId: 'home',
35 35
       collapsedIcon: require('../../img/ic_home.png'),
36 36
       backgroundColor: '#607D8B'
37 37
     }
@@ -39,6 +39,7 @@ class PushedScreen extends Component {
39 39
 
40 40
   constructor(props) {
41 41
     super(props);
42
+    console.log('PushedScreen', 'constructor');
42 43
     this.bgColor = this.getRandomColor();
43 44
     console.log(`constructor ${this.bgColor}`);
44 45
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
@@ -46,7 +47,11 @@ class PushedScreen extends Component {
46 47
   }
47 48
 
48 49
   componentWillUnmount() {
49
-    console.log(`componentWillUnmount ${this.bgColor}`);
50
+    console.log('PushedScreen', `componentWillUnmount ${this.bgColor}`);
51
+  }
52
+
53
+  componentWillMount() {
54
+    console.log('PushedScreen', 'componentWillMount');
50 55
   }
51 56
 
52 57
   getRandomColor() {

+ 9
- 0
example-redux/src/screens/SecondTabScreen.js Ver fichero

@@ -29,10 +29,19 @@ class SecondTabScreen extends Component {
29 29
 
30 30
   constructor(props) {
31 31
     super(props);
32
+    console.log('SecondTabScreen', 'constructor');
32 33
     this.buttonsCounter = 0;
33 34
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
34 35
   }
35 36
 
37
+  componentWillMount() {
38
+    console.log('SecondTabScreen', 'componentWillMount');
39
+  }
40
+
41
+  componentWillUnmount() {
42
+    console.log('SecondTabScreen', 'componentWillUnmount');
43
+  }
44
+
36 45
   render() {
37 46
     return (
38 47
       <ScrollView style={{flex: 1}}>