Splash screen, discover and file Pages #30
6 changed files with 68 additions and 9 deletions
|
@ -13,7 +13,6 @@ install:
|
|||
- git clone https://github.com/akinwale/buildozer.git
|
||||
- cd app
|
||||
- npm install --silent --save react@16.2.0 react-native@0.52.0
|
||||
- npm install
|
||||
- cd ..
|
||||
- cd buildozer
|
||||
- sudo python setup.py install
|
||||
|
|
|
@ -5,7 +5,7 @@ import SplashScreen from '../page/splash';
|
|||
import { addNavigationHelpers, DrawerNavigator, StackNavigator } from 'react-navigation';
|
||||
import { connect } from 'react-redux';
|
||||
import { addListener } from '../utils/redux';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import { BackHandler } from 'react-native';
|
||||
import Feather from 'react-native-vector-icons/Feather';
|
||||
import discoverStyle from '../styles/discover';
|
||||
|
||||
|
@ -17,7 +17,12 @@ const discoverStack = StackNavigator({
|
|||
headerLeft: <Feather name="menu" size={24} style={discoverStyle.drawerHamburger} onPress={() => navigation.navigate('DrawerOpen')} />
|
||||
})
|
||||
},
|
||||
File: { screen: FilePage }
|
||||
File: {
|
||||
screen: FilePage,
|
||||
navigationOptions: {
|
||||
header: null
|
||||
}
|
||||
}
|
||||
}, {
|
||||
headerMode: 'screen',
|
||||
});
|
||||
|
@ -41,6 +46,23 @@ export const AppNavigator = new StackNavigator({
|
|||
});
|
||||
|
||||
class AppWithNavigationState extends React.Component {
|
||||
componentWillMount() {
|
||||
BackHandler.addEventListener('hardwareBackPress', function() {
|
||||
const { dispatch, navigation, nav } = this.props;
|
||||
if (nav.routes.length === 2 && nav.routes[1].routeName === 'Main') {
|
||||
if (nav.routes[1].routes[0].routes[0].index > 0) {
|
||||
dispatch({ type: 'Navigation/BACK' });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
BackHandler.removeEventListener('hardwareBackPress');
|
||||
}
|
||||
|
||||
render() {
|
||||
const { dispatch, nav } = this.props;
|
||||
return (
|
||||
|
|
|
@ -63,7 +63,7 @@ class FilePage extends React.PureComponent {
|
|||
|
||||
return (
|
||||
<View style={filePageStyle.pageContainer}>
|
||||
<View>
|
||||
<View style={filePageStyle.mediaContainer}>
|
||||
<FileItemMedia style={filePageStyle.thumbnail} title={title} thumbnail={metadata.thumbnail} />
|
||||
</View>
|
||||
<ScrollView style={filePageStyle.scrollContainer}>
|
||||
|
|
|
@ -11,6 +11,10 @@ const filePageStyle = StyleSheet.create({
|
|||
pageContainer: {
|
||||
flex: 1
|
||||
},
|
||||
mediaContainer: {
|
||||
backgroundColor: '#000000',
|
||||
paddingTop: 24
|
||||
},
|
||||
emptyClaimText: {
|
||||
textAlign: 'center',
|
||||
fontSize: 20,
|
||||
|
|
|
@ -74549,7 +74549,10 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
}
|
||||
},
|
||||
File: {
|
||||
screen: _file2.default
|
||||
screen: _file2.default,
|
||||
navigationOptions: {
|
||||
header: null
|
||||
}
|
||||
}
|
||||
}, {
|
||||
headerMode: 'screen'
|
||||
|
@ -74582,11 +74585,37 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
}
|
||||
|
||||
babelHelpers.createClass(AppWithNavigationState, [{
|
||||
key: "componentWillMount",
|
||||
value: function componentWillMount() {
|
||||
_reactNative.BackHandler.addEventListener('hardwareBackPress', function () {
|
||||
var _props = this.props,
|
||||
dispatch = _props.dispatch,
|
||||
navigation = _props.navigation,
|
||||
nav = _props.nav;
|
||||
|
||||
if (nav.routes.length === 2 && nav.routes[1].routeName === 'Main') {
|
||||
if (nav.routes[1].routes[0].routes[0].index > 0) {
|
||||
dispatch({
|
||||
type: 'Navigation/BACK'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}.bind(this));
|
||||
}
|
||||
}, {
|
||||
key: "componentWillUnmount",
|
||||
value: function componentWillUnmount() {
|
||||
_reactNative.BackHandler.removeEventListener('hardwareBackPress');
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _props = this.props,
|
||||
dispatch = _props.dispatch,
|
||||
nav = _props.nav;
|
||||
var _props2 = this.props,
|
||||
dispatch = _props2.dispatch,
|
||||
nav = _props2.nav;
|
||||
return _react2.default.createElement(AppNavigator, {
|
||||
navigation: (0, _reactNavigation.addNavigationHelpers)({
|
||||
dispatch: dispatch,
|
||||
|
@ -74595,7 +74624,7 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
}),
|
||||
__source: {
|
||||
fileName: _jsxFileName,
|
||||
lineNumber: 47
|
||||
lineNumber: 69
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -74759,6 +74788,7 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
_react2.default.createElement(
|
||||
_reactNative.View,
|
||||
{
|
||||
style: _filePage2.default.mediaContainer,
|
||||
__source: {
|
||||
fileName: _jsxFileName,
|
||||
lineNumber: 66
|
||||
|
@ -74847,6 +74877,10 @@ __d(function (global, require, module, exports, _dependencyMap) {
|
|||
pageContainer: {
|
||||
flex: 1
|
||||
},
|
||||
mediaContainer: {
|
||||
backgroundColor: '#000000',
|
||||
paddingTop: 24
|
||||
},
|
||||
emptyClaimText: {
|
||||
textAlign: 'center',
|
||||
fontSize: 20,
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue