Browse Source

Minor change to example project

Added startSingleScreenApp button
Guy Carmeli 8 years ago
parent
commit
9df47ac60c
2 changed files with 22 additions and 9 deletions
  1. 21
    8
      example/src/screens/FirstTabScreen.js
  2. 1
    1
      example/src/screens/PushedScreen.js

+ 21
- 8
example/src/screens/FirstTabScreen.js View File

7
   Alert,
7
   Alert,
8
   Platform
8
   Platform
9
 } from 'react-native';
9
 } from 'react-native';
10
+import {Navigation} from 'react-native-navigation';
10
 
11
 
11
 export default class FirstTabScreen extends Component {
12
 export default class FirstTabScreen extends Component {
12
   static navigatorButtons = {
13
   static navigatorButtons = {
26
     ]
27
     ]
27
   };
28
   };
28
   static navigatorStyle = {
29
   static navigatorStyle = {
29
-      navBarBackgroundColor: '#4dbce9',
30
-      navBarTextColor: '#ffff00',
31
-      navBarSubtitleTextColor: '#ff0000',
32
-      navBarButtonColor: '#ffffff',
33
-      statusBarTextColorScheme: 'light',
34
-      tabBarBackgroundColor: '#4dbce9',
35
-      tabBarButtonColor: '#ffffff',
36
-      tabBarSelectedButtonColor: '#ffff00'
30
+    navBarBackgroundColor: '#4dbce9',
31
+    navBarTextColor: '#ffff00',
32
+    navBarSubtitleTextColor: '#ff0000',
33
+    navBarButtonColor: '#ffffff',
34
+    statusBarTextColorScheme: 'light',
35
+    tabBarBackgroundColor: '#4dbce9',
36
+    tabBarButtonColor: '#ffffff',
37
+    tabBarSelectedButtonColor: '#ffff00'
37
   };
38
   };
38
 
39
 
39
   constructor(props) {
40
   constructor(props) {
85
               <Text style={styles.button}>Show In-App Notification</Text>
86
               <Text style={styles.button}>Show In-App Notification</Text>
86
             </TouchableOpacity> : false
87
             </TouchableOpacity> : false
87
         }
88
         }
89
+
90
+        <TouchableOpacity onPress={ this.onStartSingleScreenApp.bind(this) }>
91
+          <Text style={styles.button}>Show Single Screen App</Text>
92
+        </TouchableOpacity>
88
       </View>
93
       </View>
89
     );
94
     );
90
   }
95
   }
124
       screen: "example.NotificationScreen"
129
       screen: "example.NotificationScreen"
125
     });
130
     });
126
   }
131
   }
132
+
133
+  onStartSingleScreenApp() {
134
+    Navigation.startSingleScreenApp({
135
+      screen: {
136
+        screen: 'example.FirstTabScreen'
137
+      }
138
+    });
139
+  }
127
 }
140
 }
128
 
141
 
129
 const styles = StyleSheet.create({
142
 const styles = StyleSheet.create({

+ 1
- 1
example/src/screens/PushedScreen.js View File

60
   onResetToPress() {
60
   onResetToPress() {
61
     this.props.navigator.resetTo({
61
     this.props.navigator.resetTo({
62
       title: "New Root",
62
       title: "New Root",
63
-      screen: "example.FirstTabScreen"
63
+      screen: "example.ThirdTabScreen"
64
     });
64
     });
65
   }
65
   }
66
 }
66
 }