@jescon-technologies/react-native-ui-kit 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +70 -0
- package/package.json +26 -3
- package/src/Alerts/AAlert.js +1 -1
- package/src/HOC/ConfirmOverlay.js +192 -0
- package/src/HOC/HAbsolute.js +56 -0
- package/src/HOC/HDiscontinue.js +105 -0
- package/src/HOC/HHeading.js +70 -0
- package/src/HOC/HMoreButton.js +88 -0
- package/src/HOC/HNatureHeading.js +402 -0
- package/src/HOC/HOCIcons.js +80 -0
- package/src/HOC/HOverlay.js +99 -0
- package/src/HOC/HOverlayCentered.js +140 -0
- package/src/HOC/HShadowButton.js +45 -0
- package/src/HOC/HShadowCountButton.js +82 -0
- package/src/HOC/OptionOverlay.js +48 -0
- package/src/Media/AudioScreen.js +347 -0
- package/src/Media/BarcodeScan.js +145 -0
- package/src/Media/CAudioPlay.js +228 -0
- package/src/Media/CCaptureImageWithoutEdit.js +330 -0
- package/src/Media/CImageGallery.js +289 -0
- package/src/Media/CImageZoom.js +82 -0
- package/src/Media/CSingleImage.js +391 -0
- package/src/Media/CSketchCanvas.js +76 -0
- package/src/Media/CVideoPlay.js +31 -0
- package/src/Media/DocumentScreen.js +367 -0
- package/src/Media/DrawingScreen.js +582 -0
- package/src/Media/ImageScreen.js +313 -0
- package/src/Media/RecordAudio.js +250 -0
- package/src/Media/RecordVideo.js +223 -0
- package/src/Media/VideoScreen.js +383 -0
- package/src/StaticComponents/SAlphabet.js +47 -0
- package/src/StaticComponents/SCheckBox.js +42 -0
- package/src/StaticComponents/SDatePicker.js +208 -0
- package/src/StaticComponents/SDatePickerLabel.js +253 -0
- package/src/StaticComponents/SDatePickerNew.js +258 -0
- package/src/StaticComponents/SDateTimePickerNew.js +381 -0
- package/src/StaticComponents/SDropDownGenerate.js +450 -0
- package/src/StaticComponents/SDropDownHoc.js +636 -0
- package/src/StaticComponents/SDropDownIcon.js +500 -0
- package/src/StaticComponents/SMenuBox.js +131 -0
- package/src/StaticComponents/SOverlay.js +177 -0
- package/src/StaticComponents/SOverlayTextInput.js +109 -0
- package/src/StaticComponents/SSearch.js +438 -0
- package/src/StaticComponents/SSearchBar.js +53 -0
- package/src/StaticComponents/SSpeedDial.js +303 -0
- package/src/StaticComponents/STextInput.js +289 -0
- package/src/StaticComponents/STextInputProps.js +36 -0
- package/src/StaticComponents/STimePicker.js +171 -0
- package/src/StaticComponents/STimingDropDownNew.js +1589 -0
- package/src/StaticComponents/STimingSwitch.js +34 -0
- package/src/layout/CContainerView.js +21 -0
- package/src/layout/CDetailView.js +81 -0
- package/src/layout/FooterBlock.js +0 -3
- package/src/layout/HeaderBlock.js +353 -0
- package/src/index.js +0 -15
- package/src/screens/ForgotPassword.js +0 -346
- package/src/screens/Login.js +0 -328
- package/src/screens/Splash.js +0 -788
- /package/src/{components → layout}/Loader.js +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Text, View, TouchableOpacity } from 'react-native';
|
|
3
|
+
// import { RNCamera } from 'react-native-camera';
|
|
4
|
+
import { colors } from '../CommonStyle/commonStyle';
|
|
5
|
+
import Overlay from 'react-native-modal-overlay';
|
|
6
|
+
import ComponentStyles,{normalize} from '../CommonStyle/componentStyle';
|
|
7
|
+
import popupStyles from '../CommonStyle/PopupStyle';
|
|
8
|
+
|
|
9
|
+
class BarcodeScan extends Component {
|
|
10
|
+
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.camera = null;
|
|
14
|
+
this.barcodeCodes = [];
|
|
15
|
+
|
|
16
|
+
this.state = {
|
|
17
|
+
camera: {
|
|
18
|
+
type: RNCamera.Constants.Type.back,
|
|
19
|
+
flashMode: RNCamera.Constants.FlashMode.auto,
|
|
20
|
+
},
|
|
21
|
+
isLoading: false,
|
|
22
|
+
isshowOK: false,
|
|
23
|
+
scannedBarCode: {},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
onSubmit(scanResult) {
|
|
28
|
+
if (scanResult.data != null) {
|
|
29
|
+
this.props.route.params.onSelect({
|
|
30
|
+
data: scanResult.data,
|
|
31
|
+
type: scanResult.type,
|
|
32
|
+
});
|
|
33
|
+
this.props.navigation.goBack();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
onBarCodeRead(scanResult) {
|
|
38
|
+
if (scanResult.data != null) {
|
|
39
|
+
if (!this.barcodeCodes.includes(scanResult.data)) {
|
|
40
|
+
if (!this.state.isshowOK) {
|
|
41
|
+
this.setState({ scannedBarCode: scanResult });
|
|
42
|
+
this.setState({ isshowOK: true });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async takePicture() {
|
|
50
|
+
if (this.camera) {
|
|
51
|
+
const options = { quality: 0.5, base64: true };
|
|
52
|
+
const data = await this.camera.takePictureAsync(options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
pendingView() {
|
|
57
|
+
return (
|
|
58
|
+
<View
|
|
59
|
+
style={{
|
|
60
|
+
flex: 1,
|
|
61
|
+
backgroundColor: 'lightgreen',
|
|
62
|
+
justifyContent: 'center',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<Text>Waiting</Text>
|
|
67
|
+
</View>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
render() {
|
|
72
|
+
return (
|
|
73
|
+
<View style={layoutstyles.container}>
|
|
74
|
+
<RNCamera
|
|
75
|
+
ref={ref => {
|
|
76
|
+
this.camera = ref;
|
|
77
|
+
}}
|
|
78
|
+
defaultTouchToFocus
|
|
79
|
+
flashMode={this.state.camera.flashMode}
|
|
80
|
+
mirrorImage={false}
|
|
81
|
+
onBarCodeRead={this.onBarCodeRead.bind(this)}
|
|
82
|
+
onFocusChanged={() => { }}
|
|
83
|
+
onZoomChanged={() => { }}
|
|
84
|
+
permissionDialogTitle={'Permission to use camera'}
|
|
85
|
+
permissionDialogMessage={'We need your permission to use your camera phone'}
|
|
86
|
+
style={layoutstyles.preview}
|
|
87
|
+
type={this.state.camera.type}
|
|
88
|
+
/>
|
|
89
|
+
{this.state.isshowOK ?
|
|
90
|
+
<Overlay visible={this.state.isshowOK}
|
|
91
|
+
onClose={() => this.setState({ isshowOK: false })}
|
|
92
|
+
closeOnTouchOutside
|
|
93
|
+
animationType="zoomIn"
|
|
94
|
+
containerStyle={layoutstyles.overlay_containerstyle}
|
|
95
|
+
animationDuration={500}
|
|
96
|
+
childrenWrapperStyle={layoutstyles.overlay_childwrapper_style}
|
|
97
|
+
>
|
|
98
|
+
<View style={ComponentStyles.View_col_center}>
|
|
99
|
+
<Text style={ComponentStyles.popup_heading}>Data Scanned Successfully</Text>
|
|
100
|
+
<View style={layoutstyles.overlay_screen_button_view}>
|
|
101
|
+
<TouchableOpacity
|
|
102
|
+
style={popupStyles.overlay_screen_small_button_style}
|
|
103
|
+
onPress={() => this.onSubmit(this.state.scannedBarCode)}>
|
|
104
|
+
<Text style={popupStyles.overlay_screen_button_text}>OK</Text>
|
|
105
|
+
</TouchableOpacity>
|
|
106
|
+
<TouchableOpacity
|
|
107
|
+
style={popupStyles.overlay_screen_small_button_style}
|
|
108
|
+
onPress={() => this.setState({ isshowOK: false })}
|
|
109
|
+
>
|
|
110
|
+
<Text style={popupStyles.overlay_screen_button_text}>CANCEL</Text>
|
|
111
|
+
</TouchableOpacity>
|
|
112
|
+
</View>
|
|
113
|
+
</View>
|
|
114
|
+
</Overlay>
|
|
115
|
+
: null}
|
|
116
|
+
</View>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const layoutstyles = {
|
|
122
|
+
container: {
|
|
123
|
+
flex: 1,
|
|
124
|
+
},
|
|
125
|
+
preview: {
|
|
126
|
+
flex: 1,
|
|
127
|
+
justifyContent: 'flex-end',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
},
|
|
130
|
+
overlay_containerstyle: {
|
|
131
|
+
backgroundColor: 'rgba(0, 0, 0, 0.50)',
|
|
132
|
+
},
|
|
133
|
+
overlay_childwrapper_style: {
|
|
134
|
+
borderRadius: 20,
|
|
135
|
+
width: '100%',
|
|
136
|
+
backgroundColor: colors.color_Background_color,
|
|
137
|
+
|
|
138
|
+
},
|
|
139
|
+
overlay_screen_button_view: {
|
|
140
|
+
flexDirection: 'row', justifyContent: 'space-evenly', margin: 5,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default BarcodeScan;
|
|
145
|
+
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Image, Text, TouchableOpacity, StyleSheet, Platform, Dimensions } from 'react-native';
|
|
3
|
+
import Slider from '@react-native-community/slider';
|
|
4
|
+
import Sound from 'react-native-sound';
|
|
5
|
+
import { colors } from '../CommonStyle/commonStyle';
|
|
6
|
+
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
7
|
+
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
8
|
+
|
|
9
|
+
export default class PlayerScreen extends React.Component {
|
|
10
|
+
static navigationOptions = props => ({
|
|
11
|
+
title: props.navigation.state.params.title,
|
|
12
|
+
});
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.state = {
|
|
16
|
+
playState: 'paused', //playing, paused
|
|
17
|
+
playSeconds: 0,
|
|
18
|
+
duration: 0,
|
|
19
|
+
};
|
|
20
|
+
this.sliderEditing = false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
componentDidMount() {
|
|
24
|
+
// this.play();
|
|
25
|
+
|
|
26
|
+
this.timeout = setInterval(() => {
|
|
27
|
+
if (this.sound && this.sound.isLoaded() && this.state.playState == 'playing' && !this.sliderEditing) {
|
|
28
|
+
this.sound.getCurrentTime((seconds, isPlaying) => {
|
|
29
|
+
this.setState({ playSeconds: seconds });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, 100);
|
|
33
|
+
}
|
|
34
|
+
componentWillUnmount() {
|
|
35
|
+
if (this.sound) {
|
|
36
|
+
this.sound.release();
|
|
37
|
+
this.sound = null;
|
|
38
|
+
}
|
|
39
|
+
if (this.timeout) {
|
|
40
|
+
clearInterval(this.timeout);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
onSliderEditStart = () => {
|
|
45
|
+
this.sliderEditing = true;
|
|
46
|
+
};
|
|
47
|
+
onSliderEditEnd = () => {
|
|
48
|
+
this.sliderEditing = false;
|
|
49
|
+
};
|
|
50
|
+
onSliderEditing = value => {
|
|
51
|
+
if (this.sound) {
|
|
52
|
+
this.sound.setCurrentTime(value);
|
|
53
|
+
this.setState({ playSeconds: value });
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
play = async () => {
|
|
57
|
+
if (this.sound) {
|
|
58
|
+
this.sound.play(this.playComplete);
|
|
59
|
+
this.setState({ playState: 'playing' });
|
|
60
|
+
} else {
|
|
61
|
+
const filepath = this.props.audio;
|
|
62
|
+
this.sound = new Sound(filepath,'', (error) => {
|
|
63
|
+
if (error) {
|
|
64
|
+
this.setState({ playState: 'paused' });
|
|
65
|
+
} else {
|
|
66
|
+
this.setState({ playState: 'playing', duration: this.sound.getDuration() });
|
|
67
|
+
this.sound.play(this.playComplete);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
playComplete = (success) => {
|
|
73
|
+
if (this.sound) {
|
|
74
|
+
if (success) {
|
|
75
|
+
} else {
|
|
76
|
+
}
|
|
77
|
+
this.setState({ playState: 'paused', playSeconds: 0 });
|
|
78
|
+
this.sound.setCurrentTime(0);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
pause = () => {
|
|
83
|
+
if (this.sound) {
|
|
84
|
+
this.sound.pause();
|
|
85
|
+
}
|
|
86
|
+
this.setState({ playState: 'paused' });
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
jumpPrev15Seconds = () => { this.jumpSeconds(-15); };
|
|
90
|
+
jumpNext15Seconds = () => { this.jumpSeconds(15); };
|
|
91
|
+
jumpSeconds = (secsDelta) => {
|
|
92
|
+
if (this.sound) {
|
|
93
|
+
this.sound.getCurrentTime((secs, isPlaying) => {
|
|
94
|
+
let nextSecs = secs + secsDelta;
|
|
95
|
+
if (nextSecs < 0) {nextSecs = 0;}
|
|
96
|
+
else if (nextSecs > this.state.duration) {nextSecs = this.state.duration;}
|
|
97
|
+
this.sound.setCurrentTime(nextSecs);
|
|
98
|
+
this.setState({ playSeconds: nextSecs });
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
getAudioTimeString(seconds) {
|
|
103
|
+
const h = parseInt(seconds / (60 * 60));
|
|
104
|
+
const m = parseInt(seconds % (60 * 60) / 60);
|
|
105
|
+
const s = parseInt(seconds % 60);
|
|
106
|
+
return ((h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s));
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
const currentTimeString = this.getAudioTimeString(this.state.playSeconds);
|
|
110
|
+
const durationString = this.getAudioTimeString(this.state.duration);
|
|
111
|
+
return (
|
|
112
|
+
<View style={layoutstyles.main_container}>
|
|
113
|
+
<View style={layoutstyles.main_child_container}>
|
|
114
|
+
{/* {this.props.component != undefined && this.props.component != null ?
|
|
115
|
+
<TouchableOpacity
|
|
116
|
+
onLongPress={() => this.props.deleterequest(this.props.component)}
|
|
117
|
+
style={layoutstyles.left_container}>
|
|
118
|
+
{this.props.component.hasOwnProperty("filestatus") && this.props.component.filestatus == 3 ?
|
|
119
|
+
<Image
|
|
120
|
+
source={{ uri: "https://cdn.iconscout.com/icon/premium/png-256-thumb/restore-3313724-2794064.png" }}
|
|
121
|
+
style={layoutstyles.delete_restore_icon}
|
|
122
|
+
/>
|
|
123
|
+
:
|
|
124
|
+
<Image
|
|
125
|
+
source={{ uri: "https://cdn.iconscout.com/icon/premium/png-256-thumb/restore-3313724-2794064.png" }}
|
|
126
|
+
style={layoutstyles.delete_restore_icon}
|
|
127
|
+
/>
|
|
128
|
+
}
|
|
129
|
+
</TouchableOpacity>
|
|
130
|
+
: null} */}
|
|
131
|
+
<View style={layoutstyles.right_container}>
|
|
132
|
+
<View style={layoutstyles.right_child_container}>
|
|
133
|
+
<TouchableOpacity
|
|
134
|
+
onPress={this.jumpPrev15Seconds}
|
|
135
|
+
style={ComponentStyles.View_col_center}
|
|
136
|
+
>
|
|
137
|
+
<FontAwesome name="rotate-left" size={25} />
|
|
138
|
+
</TouchableOpacity>
|
|
139
|
+
|
|
140
|
+
{this.state.playState == 'playing' &&
|
|
141
|
+
<TouchableOpacity onPress={this.pause}
|
|
142
|
+
style={layoutstyles.play_or_pause_container}
|
|
143
|
+
>
|
|
144
|
+
<FontAwesome name="pause" size={25} />
|
|
145
|
+
</TouchableOpacity>}
|
|
146
|
+
{this.state.playState == 'paused' &&
|
|
147
|
+
<TouchableOpacity onPress={this.play}
|
|
148
|
+
style={layoutstyles.play_or_pause_container}>
|
|
149
|
+
<FontAwesome name="play" size={25} />
|
|
150
|
+
</TouchableOpacity>}
|
|
151
|
+
<TouchableOpacity onPress={this.jumpNext15Seconds}
|
|
152
|
+
style={ComponentStyles.View_col_center}>
|
|
153
|
+
<FontAwesome name="rotate-right" size={25} />
|
|
154
|
+
</TouchableOpacity>
|
|
155
|
+
</View>
|
|
156
|
+
<View style={layoutstyles.slider_bar_container}>
|
|
157
|
+
<Text style={layoutstyles.duration_text}>
|
|
158
|
+
{currentTimeString}</Text>
|
|
159
|
+
<Slider
|
|
160
|
+
onTouchStart={this.onSliderEditStart}
|
|
161
|
+
onTouchEnd={this.onSliderEditEnd}
|
|
162
|
+
onValueChange={this.onSliderEditing}
|
|
163
|
+
value={this.state.playSeconds} maximumValue={this.state.duration}
|
|
164
|
+
maximumTrackTintColor={colors.color_audio_minimumTrackTintColor}
|
|
165
|
+
minimumTrackTintColor={colors.color_audio_maximumTrackTintColor} thumbTintColor={colors.color_audio_maximumTrackTintColor}
|
|
166
|
+
style={layoutstyles.slider_bar_style}
|
|
167
|
+
/>
|
|
168
|
+
<Text style={layoutstyles.duration_text}>
|
|
169
|
+
{durationString}
|
|
170
|
+
</Text>
|
|
171
|
+
</View>
|
|
172
|
+
</View>
|
|
173
|
+
</View>
|
|
174
|
+
</View>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const layoutstyles = StyleSheet.create({
|
|
180
|
+
main_container: {
|
|
181
|
+
width: Dimensions.get('window').width * 0.7,
|
|
182
|
+
marginLeft:10,
|
|
183
|
+
},
|
|
184
|
+
slider_bar_style: {
|
|
185
|
+
flex: 1, alignSelf: 'center',
|
|
186
|
+
marginHorizontal: Platform.select({ ios: 5 }),
|
|
187
|
+
},
|
|
188
|
+
main_child_container: {
|
|
189
|
+
backgroundColor:'#DAF0FF',
|
|
190
|
+
padding: 5,
|
|
191
|
+
borderColor: colors.color_componentBordercolor, borderWidth: 0.5,
|
|
192
|
+
marginTop: Dimensions.get('window').height * 0.005,
|
|
193
|
+
borderRadius: 7,
|
|
194
|
+
justifyContent: 'center',
|
|
195
|
+
width: Dimensions.get('window').width * 0.7,
|
|
196
|
+
justifyContent: 'center', flexDirection: 'row',
|
|
197
|
+
},
|
|
198
|
+
right_container: {
|
|
199
|
+
flex: 5,
|
|
200
|
+
},
|
|
201
|
+
delete_restore_icon: {
|
|
202
|
+
width: 50, height: 50, margin: 5, alignSelf: 'center',
|
|
203
|
+
},
|
|
204
|
+
right_child_container: {
|
|
205
|
+
flexDirection: 'row', justifyContent: 'center', marginVertical: 5,
|
|
206
|
+
},
|
|
207
|
+
left_container: {
|
|
208
|
+
flex: 1, justifyContent: 'center', alignItems: 'center',
|
|
209
|
+
},
|
|
210
|
+
duration_text: {
|
|
211
|
+
color: 'black', alignSelf: 'center', fontSize: normalize(10),
|
|
212
|
+
},
|
|
213
|
+
slider_bar_container: {
|
|
214
|
+
marginVertical: 2, marginHorizontal: 2, flexDirection: 'row',
|
|
215
|
+
paddingRight: Dimensions.get('window').width * 0.02,
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
jumpleft_or_right_icon: {
|
|
219
|
+
width: 30, height: 30,
|
|
220
|
+
},
|
|
221
|
+
play_or_pause_container: {
|
|
222
|
+
marginHorizontal: 20, marginLeft: 25, marginRight: 25,
|
|
223
|
+
},
|
|
224
|
+
play_or_pause_icon: {
|
|
225
|
+
width: 35, height: 35,
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
|