Commit 84273d69 by Tonk

remove grid from history bar chart, update ios qrcode scanner

parent dc862415
......@@ -783,7 +783,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.nexpie.safetcut;
PRODUCT_NAME = rn_safetcutapp;
VERSIONING_SYSTEM = "apple-generic";
};
......@@ -803,7 +803,7 @@
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_BUNDLE_IDENTIFIER = com.nexpie.safetcut;
PRODUCT_NAME = rn_safetcutapp;
VERSIONING_SYSTEM = "apple-generic";
};
......
......@@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>rn_safetcutapp</string>
<string>SafeTCut</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......
......@@ -3,12 +3,13 @@ import { Text, View, Button, Icon } from 'native-base';
import { HeaderButtons, Item } from 'react-navigation-header-buttons';
import IoniconsHeaderButton from '../../components/IoniconsHeaderButton';
import { width } from '../../constants/Layout';
import { StyleSheet } from 'react-native';
import { StyleSheet, Platform } from 'react-native';
import { RNCamera } from 'react-native-camera';
import BarcodeMask from 'react-native-barcode-mask';
import { withNavigationFocus } from 'react-navigation';
import Permissions from 'react-native-permissions';
import { TouchableNativeFeedback } from 'react-native-gesture-handler';
import { TouchableNativeFeedback, TouchableOpacity } from 'react-native-gesture-handler';
import QRCodeScanner from 'react-native-qrcode-scanner';
class CameraScreen extends Component {
static navigationOptions = ({ navigation }) => ({
......@@ -46,26 +47,77 @@ class CameraScreen extends Component {
this.setState({ cameraPermission: response });
};
renderCamera = () => (
<RNCamera
ref={ref => {
this.camera = ref;
}}
style={StyleSheet.absoluteFill}
type={RNCamera.Constants.Type.back}
onBarCodeScanned={this.state.scanned ? undefined : this.handleBarCodeScanned}
flashMode={this.state.flashMode}
>
<>
<BarcodeMask
width={width / 1.5}
height={width / 1.5}
edgeColor={'lightgreen'}
showAnimatedLine={false}
transparency={0.7}
/>
renderCamera = () =>
Platform.OS === 'android' ? (
<RNCamera
ref={ref => {
this.camera = ref;
}}
style={StyleSheet.absoluteFill}
type={RNCamera.Constants.Type.back}
onBarCodeScanned={this.state.scanned ? undefined : this.handleBarCodeScanned}
flashMode={this.state.flashMode}
>
<>
<BarcodeMask
width={width / 1.5}
height={width / 1.5}
edgeColor={'lightgreen'}
showAnimatedLine={false}
transparency={0.7}
/>
<View style={styles.container}>
<View style={styles.container}>
<View style={[styles.center, { flex: 1, paddingHorizontal: 50 }]}>
<Text style={{ fontSize: 18, color: 'white', textAlign: 'center', marginBottom: '5%' }}>
Scanning
</Text>
<Text style={{ fontSize: 16, color: 'white', textAlign: 'center' }}>
Scan for Create smart meter, Place the QR code inside are.
</Text>
</View>
<View style={[styles.center, { flex: 2 }]} />
<View style={[styles.center, { flex: 1 }]}>
<TouchableNativeFeedback
style={[styles.torchBtn, styles.center]}
onPress={() => {
this.setState({
flashMode:
this.state.flashMode === RNCamera.Constants.FlashMode.off
? RNCamera.Constants.FlashMode.torch
: RNCamera.Constants.FlashMode.off,
});
}}
>
<Icon
type="MaterialCommunityIcons"
name={
this.state.flashMode === RNCamera.Constants.FlashMode.off
? 'flashlight-off'
: 'flashlight'
}
style={{
zIndex: -1,
color:
this.state.flashMode === RNCamera.Constants.FlashMode.off
? 'white'
: '#f8e71c',
fontSize: 26,
textAlign: 'center',
}}
/>
</TouchableNativeFeedback>
</View>
</View>
</>
</RNCamera>
) : (
<QRCodeScanner
onRead={this.handleBarCodeScanned}
ref={ref => {
this.camera = ref;
}}
topContent={
<View style={[styles.center, { flex: 1, paddingHorizontal: 50 }]}>
<Text style={{ fontSize: 18, color: 'white', textAlign: 'center', marginBottom: '5%' }}>
Scanning
......@@ -74,40 +126,42 @@ class CameraScreen extends Component {
Scan for Create smart meter, Place the QR code inside are.
</Text>
</View>
<View style={[styles.center, { flex: 2 }]} />
<View style={[styles.center, { flex: 1 }]}>
<TouchableNativeFeedback
style={[styles.torchBtn, styles.center]}
onPress={() => {
this.setState({
flashMode:
this.state.flashMode === RNCamera.Constants.FlashMode.off
? RNCamera.Constants.FlashMode.torch
: RNCamera.Constants.FlashMode.off,
});
}}
>
<Icon
type="MaterialCommunityIcons"
name={
}
bottomContent={
<TouchableOpacity
style={[styles.torchBtn, styles.center]}
onPress={() => {
this.setState({
flashMode:
this.state.flashMode === RNCamera.Constants.FlashMode.off
? 'flashlight-off'
: 'flashlight'
}
style={{
zIndex: -1,
color:
this.state.flashMode === RNCamera.Constants.FlashMode.off ? 'white' : '#f8e71c',
fontSize: 26,
textAlign: 'center',
}}
/>
</TouchableNativeFeedback>
</View>
</View>
</>
</RNCamera>
);
? RNCamera.Constants.FlashMode.torch
: RNCamera.Constants.FlashMode.off,
});
}}
>
<Icon
type="MaterialCommunityIcons"
name={
this.state.flashMode === RNCamera.Constants.FlashMode.off
? 'flashlight-off'
: 'flashlight'
}
style={{
zIndex: -1,
color: this.state.flashMode === RNCamera.Constants.FlashMode.off ? 'white' : '#f8e71c',
fontSize: 26,
textAlign: 'center',
}}
/>
</TouchableOpacity>
}
containerStyle={{ backgroundColor: 'rgba(51,51,61,0.65)' }}
cameraStyle={{ width: width / 1.5, height: width / 1.5, alignSelf: 'center', borderRadius: 11 }}
cameraProps={{
flashMode: this.state.flashMode,
}}
/>
);
render() {
const { cameraPermission, isWaiting } = this.state;
......
......@@ -116,8 +116,6 @@ export default class HistoryScreen extends React.Component {
dataLength={data.length}
/>
)}
<Grid />
</BarChart>
)}
{graphType === 'area' && (
......@@ -131,13 +129,14 @@ export default class HistoryScreen extends React.Component {
curve={shape.curveMonotoneX}
>
<ChartPoints />
<Tooltip
tooltipX={tooltipX}
tooltipY={tooltipY}
color="#003F5A"
index={tooltipIndex}
dataLength={data.length}
/>
{tooltipIndex && (
<Tooltip
tooltipX={tooltipX}
tooltipY={tooltipY}
index={tooltipIndex}
dataLength={data.length}
/>
)}
</AreaChart>
)}
......
......@@ -6134,7 +6134,7 @@ react-native-modalbox@^1.7.1:
create-react-class "^15.6.0"
prop-types "^15.5.10"
react-native-permissions@^1.2.0:
react-native-permissions@^1.1.1, react-native-permissions@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-1.2.0.tgz#0deb616bf1565c17c91f1cb1f953809b2892c29e"
integrity sha512-+KrP1JZ30RI9p30wsGlGQx22qwiClDnznSQZPpvBMkOIZQ9kXOkLAFXS+vwiHRiiRu/pBMBXYHfI7ng6t2+LbQ==
......@@ -6151,6 +6151,14 @@ react-native-platform-touchable@^1.1.1:
resolved "https://registry.yarnpkg.com/react-native-platform-touchable/-/react-native-platform-touchable-1.1.1.tgz#fde4acc65eea585d28b164d0c3716a42129a68e4"
integrity sha1-/eSsxl7qWF0osWTQw3FqQhKaaOQ=
react-native-qrcode-scanner@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/react-native-qrcode-scanner/-/react-native-qrcode-scanner-1.2.1.tgz#aa3949a77f6eee063a3ca25796a1f0ce17f9c4dd"
integrity sha512-JLX6iCmvUkBmbXcHHjtRS+OFr2onp9IFE9FXSPGZUuXib78afNEIg+qiWJdKfhQvtPKffRf55TH/WHxD3XDwKQ==
dependencies:
prop-types "^15.5.10"
react-native-permissions "^1.1.1"
react-native-ratings@^6.3.0:
version "6.3.1"
resolved "https://registry.yarnpkg.com/react-native-ratings/-/react-native-ratings-6.3.1.tgz#4e4bd87f376423dc62c933f570fc1932c78adaa4"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment