-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.android.js
42 lines (37 loc) · 951 Bytes
/
index.android.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
Navigator,
BackAndroid,
} from 'react-native';
var _navigator;
BackAndroid.addEventListener('hardwareBackPress', () => {
if (_navigator.getCurrentRoutes().length === 1 ) {
return false;
}
_navigator.pop();
return true;
});
var ChatListView = require('./ChatListView');
class ChatApp extends Component {
render() {
return (
<Navigator
initialRoute={{name: 'Chat List', component: ChatListView}}
configureScene={() => {
return Navigator.SceneConfigs.FloatFromRight;
}}
renderScene={(route, navigator) => {
_navigator = navigator;
return React.createElement(route.component, { navigator , ...route.passProps});
}}
/>
)
};
}
AppRegistry.registerComponent('ChatApp', () => ChatApp);