1 Star 0 Fork 7

御守 / oschina_for_react_native

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.android.js 1.31 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
thanatosx 提交于 2016-05-17 22:36 . init commit
/**
* OschinaApp For React-Native
*/
'use strict';
import * as React from 'react-native';
import * as Color from './app/node_modules/values/color';
import Router from './app/node_modules/views/Router';
import Application from './app/node_modules/public/Application';
let {
AppRegistry,
View,
BackAndroid,
StatusBar,
Navigator
} = React;
BackAndroid.addEventListener('hardwareBackPress', function() {
let nav = Application.Navigation;
if (nav && nav.getCurrentRoutes().length > 1) {
nav.pop();
return true;
}
return false;
});
let app = React.createClass({
render () {
return (
<View style={{flex: 1}}>
<StatusBar
backgroundColor={Color.darkPrimaryColor}
barStyle="light-content"/>
<Navigator
initialRoute={{id: 'SplashScene', name: '启动页', index: 0}}
configureScene={(route, routeStack) => Navigator.SceneConfigs.HorizontalSwipeJumpFromRight}
renderScene={this.renderMapper}/>
</View>
)
},
renderMapper (router, navigator) {
Application.Navigation = navigator;
return Router(router, navigator)
}
});
AppRegistry.registerComponent('OschinaAppForReactNative', () => app);
JavaScript
1
https://gitee.com/fengmengchang/oschina_for_react_native.git
git@gitee.com:fengmengchang/oschina_for_react_native.git
fengmengchang
oschina_for_react_native
oschina_for_react_native
master

搜索帮助