-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.android.js
More file actions
50 lines (43 loc) · 1.17 KB
/
Copy pathindex.android.js
File metadata and controls
50 lines (43 loc) · 1.17 KB
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
43
44
45
46
47
48
49
50
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var App = require('./module/app');
var Wecome = require('./componets/welcome/welcome-slider');
var BaiduMap =require('./componets/view/baidumap-view');
var {
StyleSheet,
View,
Text,
AppRegistry,
DeviceEventEmitter,
} = React;
var { NativeModules } = require('react-native');
var HuanxinModule = NativeModules.HuanxinModule;
var guy_app = React.createClass({
getInitialState: function() {
return {
};
},
render: function() {
return <BaiduMap style={{flex: 1}}/>
//return (<App />);
},
componentDidMount: function() {
HuanxinModule.show('xunge ni hao ! i‘m come from android Toast', HuanxinModule.LONG);
HuanxinModule.showByCallback('xun', function(str){
HuanxinModule.show(str, HuanxinModule.LONG);
}, function(str){
HuanxinModule.show(str, HuanxinModule.LONG);
});
//event
DeviceEventEmitter.addListener('myEvent', function(e, params) {
HuanxinModule.show('yes', HuanxinModule.LONG);
// handle event.
});
HuanxinModule.triggerEvent('myEvent');
},
});
AppRegistry.registerComponent('guy_app', () => guy_app);