Browse Source

Update example

Guy Carmeli 8 years ago
parent
commit
1865df194f

+ 11
- 2
example-redux/src/screens/FirstTabScreen.js View File

40
       }
40
       }
41
     ],
41
     ],
42
     fab: {
42
     fab: {
43
-      id: 'share',
43
+      collapsedId: 'share',
44
       collapsedIcon: require('../../img/ic_share.png'),
44
       collapsedIcon: require('../../img/ic_share.png'),
45
+      expendedId: 'clear',
45
       expendedIcon: require('../../img/ic_clear.png'),
46
       expendedIcon: require('../../img/ic_clear.png'),
46
       backgroundColor: '#3F51B5',
47
       backgroundColor: '#3F51B5',
47
       actions: [
48
       actions: [
66
           backgroundColor: '#FF5722'
67
           backgroundColor: '#FF5722'
67
         }
68
         }
68
       ]
69
       ]
69
-
70
     }
70
     }
71
   };
71
   };
72
 
72
 
73
   constructor(props) {
73
   constructor(props) {
74
     super(props);
74
     super(props);
75
+    console.log('FirstTabScreen', 'constructor');
75
     // if you want to listen on navigator events, set this up
76
     // if you want to listen on navigator events, set this up
76
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
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
   onNavigatorEvent(event) {
88
   onNavigatorEvent(event) {
80
     if (event.type == 'DeepLink') {
89
     if (event.type == 'DeepLink') {
81
       this.handleDeepLink(event);
90
       this.handleDeepLink(event);

+ 8
- 0
example-redux/src/screens/ListScreen.js View File

47
     console.log('ListScreen', 'Unhandled event ' + event.id);
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
   onTabSelected() {
58
   onTabSelected() {
51
     console.log('ListScreen', 'onTabSelected');
59
     console.log('ListScreen', 'onTabSelected');
52
     this.props.navigator.setButtons({
60
     this.props.navigator.setButtons({

+ 7
- 2
example-redux/src/screens/PushedScreen.js View File

31
       color: '#00ff00'
31
       color: '#00ff00'
32
     },
32
     },
33
     fab: {
33
     fab: {
34
-      id: 'share',
34
+      collapsedId: 'home',
35
       collapsedIcon: require('../../img/ic_home.png'),
35
       collapsedIcon: require('../../img/ic_home.png'),
36
       backgroundColor: '#607D8B'
36
       backgroundColor: '#607D8B'
37
     }
37
     }
39
 
39
 
40
   constructor(props) {
40
   constructor(props) {
41
     super(props);
41
     super(props);
42
+    console.log('PushedScreen', 'constructor');
42
     this.bgColor = this.getRandomColor();
43
     this.bgColor = this.getRandomColor();
43
     console.log(`constructor ${this.bgColor}`);
44
     console.log(`constructor ${this.bgColor}`);
44
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
45
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
46
   }
47
   }
47
 
48
 
48
   componentWillUnmount() {
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
   getRandomColor() {
57
   getRandomColor() {

+ 9
- 0
example-redux/src/screens/SecondTabScreen.js View File

29
 
29
 
30
   constructor(props) {
30
   constructor(props) {
31
     super(props);
31
     super(props);
32
+    console.log('SecondTabScreen', 'constructor');
32
     this.buttonsCounter = 0;
33
     this.buttonsCounter = 0;
33
     this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent.bind(this));
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
   render() {
45
   render() {
37
     return (
46
     return (
38
       <ScrollView style={{flex: 1}}>
47
       <ScrollView style={{flex: 1}}>