-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppNav.js
More file actions
executable file
·152 lines (140 loc) · 6.42 KB
/
AppNav.js
File metadata and controls
executable file
·152 lines (140 loc) · 6.42 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import {createDrawerNavigator} from 'react-navigation-drawer';
import React from "react";
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import FIcon from 'react-native-vector-icons/FontAwesome5';
import { View, Text, Dimensions, FlatList, TouchableOpacity, Linking, Alert, Image, ScrollView, Platform, } from "react-native";
import HomeScreen from './screens/Home';
import QRScanScreen from './screens/QRScan';
import QRScanResultScreen from './screens/QRScanResult';
import SettingsScreen from './screens/Settings';
import QRGeneratorScreen from './screens/QRGenerator';
import QRScanGalleryScreen from './screens/QRScanGallery';
import HistoryScreen from './screens/History';
const { width, height } = Dimensions.get('screen');
const AppNavigator = createStackNavigator({
Home: HomeScreen,
Settings: SettingsScreen,
History: HistoryScreen,
QRScan: QRScanScreen,
QRScanResult: QRScanResultScreen,
QRGenerator: QRGeneratorScreen,
QRScanGallery: QRScanGalleryScreen,
});
const DrawNavigator = createDrawerNavigator({
Home: {
screen: AppNavigator,
navigationOptions: {
drawerIcon: () => <Icon name="home" size={24} color="#444444" />,
drawerLabel: "Home"
},
}
},
{
drawerWidth: width * 0.8,
contentComponent: (props) => (
<ScrollView>
<Image
source={require('./assets/qrflogo.png')}
style={{ width: width * 0.8, height: height * 0.25 }}
/>
<View>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { props.navigation.navigate("History") }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="history" size={24} color="#888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>History</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { props.navigation.navigate("Settings") }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="settings" size={24} color="#888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>Settings</Text>
</View>
</TouchableOpacity>
{
Platform.OS === "android" ?
<View>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { Linking.openURL(Platform.OS === 'android' ? "https://play.google.com/store/apps/details?id=com.kaya.qr_reader_and_generator" : "itms-apps://itunes.apple.com/app/apple-store/id1498310082?mt=8"); }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="star" size={24} color="#888888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>Rate App</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { Linking.openURL("https://play.google.com/store/apps/details?id=com.kaya.qr_reader_and_generator_pro"); }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<FIcon name="ad" size={24} color="#888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>Ad Free Version</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { Linking.openURL("https://play.google.com/store/apps/developer?id=IBK+Apps"); }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="google-play" size={24} color="#888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>View Other Apps</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { Linking.openURL("mailto:ibraberatkaya@gmail.com?subject=Feedback"); }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="email" size={24} color="#888888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>Feedback</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{ paddingLeft: 16, paddingVertical: 14.5 }}
onPress={() => { Alert.alert("Help", "Click the scan button to scan a QR Code with your camera. You can click the icon below the text in the result screen to call or text a number, add an event etc.\n\nClick the generate button to generate a QR Code (requires internet connection). Click on the QR Code to download it."); }}
>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Icon name="help-circle" size={24} color="#888888" />
<Text style={{ fontSize: 14, fontWeight: 'bold', paddingLeft: 32, color: 'black' }}>Help</Text>
</View>
</TouchableOpacity>
</View>
: <View/>
}
</View>
</ScrollView>
)
}
);
AppNavigator.navigationOptions = ({
drawerIcon: (<Icon name="home" />),
});
AppNavigator.navigationOptions = ({ navigation }) => { //Locks drawer when not in the home screen
let drawerLockMode = 'unlocked';
if (navigation.state.index > 0) {
drawerLockMode = 'locked-closed';
}
return {
drawerLockMode,
};
};
const Enter = createStackNavigator({
Home: {
screen: DrawNavigator,
navigationOptions: {
header: null,
headerStyle: {
backgroundColor: 'rgb(105, 156, 195)',
},
}
}
});
export default createAppContainer(Enter);