|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { useEffect, useRef, useState } from 'react'; |
|
|
|
import { useEffect, useRef, useState } from 'react'; |
|
|
|
import {View,Text, StyleSheet, ScrollView, TouchableOpacity, Image, Animated, TextInput, Button, Alert} from 'react-native'; |
|
|
|
import {View,Text, StyleSheet, ScrollView, TouchableOpacity, Image, Animated, TextInput, Button, Alert, StatusBar, Pressable, FlatList} from 'react-native'; |
|
|
|
|
|
|
|
|
|
|
|
import MapLibreGL from '@maplibre/maplibre-react-native'; |
|
|
|
import MapLibreGL from '@maplibre/maplibre-react-native'; |
|
|
|
import { MapView,ShapeSource,Camera,UserLocation,PointAnnotation,FillLayer,LineLayer,VectorSource } from "@maplibre/maplibre-react-native"; |
|
|
|
import { MapView,ShapeSource,Camera,UserLocation,PointAnnotation,FillLayer,LineLayer,VectorSource } from "@maplibre/maplibre-react-native"; |
|
|
|
@ -14,6 +14,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; |
|
|
|
import turfcenter from '@turf/center'; |
|
|
|
import turfcenter from '@turf/center'; |
|
|
|
const {points,polygon,lineString} = require('@turf/helpers'); |
|
|
|
const {points,polygon,lineString} = require('@turf/helpers'); |
|
|
|
import RNFetchBlob from 'rn-fetch-blob'; |
|
|
|
import RNFetchBlob from 'rn-fetch-blob'; |
|
|
|
|
|
|
|
import Modal from "react-native-modal"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -56,7 +57,7 @@ export default function CollectLineScreen({route,navigation}:collectLineScreenPr |
|
|
|
const [files, setFiles] = useState([]); |
|
|
|
const [files, setFiles] = useState([]); |
|
|
|
const [pipeName, setPipeName] = useState(''); |
|
|
|
const [pipeName, setPipeName] = useState(''); |
|
|
|
const [selectedPipeType, setselectedPipeType] = useState(""); |
|
|
|
const [selectedPipeType, setselectedPipeType] = useState(""); |
|
|
|
const [checkedStatus, setCheckedStatus] = useState(''); |
|
|
|
const [checkedStatus, setCheckedStatus] = useState('Baik'); |
|
|
|
const [Information, setInformation] = useState(''); |
|
|
|
const [Information, setInformation] = useState(''); |
|
|
|
const [open, setOpen] = useState(false); |
|
|
|
const [open, setOpen] = useState(false); |
|
|
|
const [install_date, setInstallDate] = useState(new Date()); |
|
|
|
const [install_date, setInstallDate] = useState(new Date()); |
|
|
|
@ -67,6 +68,7 @@ export default function CollectLineScreen({route,navigation}:collectLineScreenPr |
|
|
|
const [pipeTyeError, setPipeTypeError] = useState(false); |
|
|
|
const [pipeTyeError, setPipeTypeError] = useState(false); |
|
|
|
const [pipeStatusError, setPipeStatusError] = useState(false); |
|
|
|
const [pipeStatusError, setPipeStatusError] = useState(false); |
|
|
|
const [pipeInfoError, setPipeInfoError] = useState(false); |
|
|
|
const [pipeInfoError, setPipeInfoError] = useState(false); |
|
|
|
|
|
|
|
const [ModalAttachment, setModalAttachment] = useState(false); |
|
|
|
|
|
|
|
|
|
|
|
const openCameraLib = async () => { |
|
|
|
const openCameraLib = async () => { |
|
|
|
const result = await launchCamera({ |
|
|
|
const result = await launchCamera({ |
|
|
|
@ -268,235 +270,240 @@ export default function CollectLineScreen({route,navigation}:collectLineScreenPr |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
console.log(error); |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const renderItem = ({item,index}:any) => { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<View key={index} style={{width:100,height:100,borderRadius:10,borderWidth:1,borderStyle:"dashed",flexDirection:'row'}}> |
|
|
|
|
|
|
|
<Image style={{width: '100%',height: '100%',borderRadius:10}} |
|
|
|
|
|
|
|
source={{uri: `data:image/jpeg;base64,${imgUrl[index]}`}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}; |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View style={styles.mainContainer}> |
|
|
|
<View style={styles.mainContainer}> |
|
|
|
<ScrollView style={styles.container}> |
|
|
|
<StatusBar backgroundColor="#34A6F8" barStyle={'light-content'} /> |
|
|
|
<View> |
|
|
|
<View key={"mainBackground"} style={{backgroundColor:'#34A6F8',width:'100%',height:'93%'}} /> |
|
|
|
<Text style={styles.label}>Image</Text> |
|
|
|
<View key={"background"} style={{backgroundColor:'#FFFFFF',width:'100%',height:'100%',position:'absolute',borderTopRightRadius:50,borderTopLeftRadius:35,paddingTop:25}}> |
|
|
|
<View style={styles.borderImg}> |
|
|
|
<ScrollView style={styles.container}> |
|
|
|
<Text style={{justifyContent: 'center', alignItems: 'center', alignSelf: 'center', color: 'black'}}>{imgUrl.length === 0 ? currentIndex :currentIndex+1}/{imgUrl.length}</Text> |
|
|
|
|
|
|
|
<View style={{flexDirection: 'row'}}> |
|
|
|
|
|
|
|
<PrevImg isIndex={currentIndex}/> |
|
|
|
|
|
|
|
<Animated.FlatList |
|
|
|
|
|
|
|
ref={ref} |
|
|
|
|
|
|
|
data={imgUrl}
|
|
|
|
|
|
|
|
showsHorizontalScrollIndicator={false} |
|
|
|
|
|
|
|
pagingEnabled |
|
|
|
|
|
|
|
onScroll={e=>{ |
|
|
|
|
|
|
|
const x = e.nativeEvent.contentOffset.x; |
|
|
|
|
|
|
|
setCurrentIndex(parseFloat((x/330).toFixed(0))); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
horizontal |
|
|
|
|
|
|
|
renderItem={({item,index}) => { |
|
|
|
|
|
|
|
return( |
|
|
|
|
|
|
|
<Animated.Image resizeMode='center' style={{width: 350, |
|
|
|
|
|
|
|
height: 500, |
|
|
|
|
|
|
|
borderRadius: 6,}} source={{uri: `data:image/jpeg;base64,${imgUrl[index]}`}} /> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<NextImg isIndex={currentIndex}/> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={styles.btnCameraContainer}> |
|
|
|
|
|
|
|
<TouchableOpacity style={styles.btnCamera} onPress={openCameraLib}> |
|
|
|
|
|
|
|
<Image |
|
|
|
|
|
|
|
source={require('../../assets/icon/camera.png')} |
|
|
|
|
|
|
|
style={styles.buttonImageIconStyle} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</TouchableOpacity> |
|
|
|
|
|
|
|
<TouchableOpacity style={styles.btnCamera} onPress={openLib}> |
|
|
|
|
|
|
|
<Image |
|
|
|
|
|
|
|
source={require('../../assets/icon/gallery.png')} |
|
|
|
|
|
|
|
style={styles.buttonImageIconStyle} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</TouchableOpacity> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<View |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
marginTop: 15 |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<View style={{flexDirection:'column'}}> |
|
|
|
<View style={{flexDirection:'column'}}> |
|
|
|
<MapView |
|
|
|
<MapView |
|
|
|
style={{width:'80%',height:160,alignSelf:'center'}} |
|
|
|
style={{width:352,height:200,borderWidth:1,borderColor:'#A6A6A6',overflow:'hidden',alignSelf:'center',borderTopRightRadius:10,borderTopLeftRadius:10}} |
|
|
|
mapStyle={styleURL} |
|
|
|
mapStyle={styleURL} |
|
|
|
zoomEnabled={false} |
|
|
|
rotateEnabled={false} |
|
|
|
scrollEnabled={false} |
|
|
|
zoomEnabled={false} |
|
|
|
|
|
|
|
pitchEnabled={false} |
|
|
|
|
|
|
|
scrollEnabled={false} |
|
|
|
> |
|
|
|
> |
|
|
|
<Camera
|
|
|
|
<Camera
|
|
|
|
centerCoordinate={centerCoords} |
|
|
|
centerCoordinate={centerCoords} |
|
|
|
zoomLevel={15} |
|
|
|
zoomLevel={15} |
|
|
|
minZoomLevel={5} |
|
|
|
minZoomLevel={5} |
|
|
|
maxZoomLevel={20} |
|
|
|
maxZoomLevel={20} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<ShapeSource |
|
|
|
|
|
|
|
id="line" |
|
|
|
|
|
|
|
shape={{ |
|
|
|
|
|
|
|
"type": "FeatureCollection", |
|
|
|
|
|
|
|
"features": [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"type": "Feature", |
|
|
|
|
|
|
|
"properties": {}, |
|
|
|
|
|
|
|
"geometry": { |
|
|
|
|
|
|
|
"type": "LineString", |
|
|
|
|
|
|
|
"coordinates": route.params.coordinates |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<LineLayer
|
|
|
|
|
|
|
|
id="linelayer1" |
|
|
|
|
|
|
|
style={{lineColor:'red',lineWidth:3}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<ShapeSource |
|
|
|
</ShapeSource> |
|
|
|
id="line" |
|
|
|
|
|
|
|
shape={{ |
|
|
|
|
|
|
|
"type": "FeatureCollection", |
|
|
|
|
|
|
|
"features": [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"type": "Feature", |
|
|
|
|
|
|
|
"properties": {}, |
|
|
|
|
|
|
|
"geometry": { |
|
|
|
|
|
|
|
"type": "LineString", |
|
|
|
|
|
|
|
"coordinates": route.params.coordinates |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<LineLayer
|
|
|
|
|
|
|
|
id="linelayer1" |
|
|
|
|
|
|
|
style={{lineColor:'red',lineWidth:3}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</ShapeSource> |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
route.params.coordinates.map((item:any,index:number)=>( |
|
|
|
route.params.coordinates.map((item:any,index:number)=>( |
|
|
|
<PointAnnotation |
|
|
|
<PointAnnotation |
|
|
|
children={<></>} |
|
|
|
children={<></>} |
|
|
|
key={index} |
|
|
|
key={index} |
|
|
|
id={String(index)} |
|
|
|
id={String(index)} |
|
|
|
coordinate={item} |
|
|
|
coordinate={item} |
|
|
|
draggable={false} |
|
|
|
draggable={false} |
|
|
|
/> |
|
|
|
/> |
|
|
|
)) |
|
|
|
)) |
|
|
|
}
|
|
|
|
}
|
|
|
|
</MapView> |
|
|
|
</MapView> |
|
|
|
<TouchableOpacity style={{alignSelf:'center',paddingTop:10}} onPress={()=>navigation.navigate('PDAM Map Collect', { screen: 'PDAM Map Collect'})}> |
|
|
|
{/* </Pressable> */} |
|
|
|
<View style={{backgroundColor:'#217dd3',flexDirection:'row',width:150,height:30,borderRadius:20,justifyContent:'center'}}> |
|
|
|
<TouchableOpacity style={{alignSelf:'center',backgroundColor:'#F9F9F9',width:352,height:50,borderBottomLeftRadius:10,borderBottomRightRadius:10,justifyContent:'center',borderWidth:1,borderColor:'#A6A6A6'}} onPress={()=>navigation.navigate('PDAM Map Collect', { screen: 'PDAM Map Collect'})}> |
|
|
|
<Text style={{alignSelf:'center',fontWeight:'bold',fontSize:16,color:'white'}}>View</Text> |
|
|
|
<Text style={{alignSelf:'center',fontWeight:'semibold',fontSize:16,color:'#434343'}}>Change Location</Text> |
|
|
|
</View> |
|
|
|
</TouchableOpacity> |
|
|
|
</TouchableOpacity> |
|
|
|
|
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
marginTop: 15 |
|
|
|
marginTop: 15 |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<View> |
|
|
|
<View style={{alignSelf:'center'}}> |
|
|
|
<Text style={styles.label}>Pipe Name<Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> |
|
|
|
{/* <Text style={styles.label}>Name<Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> */} |
|
|
|
<TextInput |
|
|
|
<Text style={styles.label}>Pipe Name</Text> |
|
|
|
style={styles.input} |
|
|
|
<TextInput |
|
|
|
onChangeText={(text)=>{ |
|
|
|
style={styles.input} |
|
|
|
setPipeName(text) |
|
|
|
onChangeText={(text) => { |
|
|
|
}} |
|
|
|
setPipeName(text) |
|
|
|
onChange={()=> { |
|
|
|
}} |
|
|
|
setPipeNameError(false) |
|
|
|
onChange={()=> { |
|
|
|
}} |
|
|
|
setPipeNameError(false) |
|
|
|
/> |
|
|
|
}} |
|
|
|
{pipeNameError ? <Text style={styles.errorInput}>Name is Required!</Text>:null} |
|
|
|
/> |
|
|
|
|
|
|
|
{pipeNameError ? <Text style={styles.errorInput}>Pipe Name is Required!</Text>:null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
marginTop: 15 |
|
|
|
marginTop: 15 |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<View> |
|
|
|
<View style={{alignSelf:'center'}}> |
|
|
|
<Text style={styles.label}>Pipe Type <Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> |
|
|
|
{/* <Text style={styles.label}>PJU Type <Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> */} |
|
|
|
<SelectList |
|
|
|
<Text style={styles.label}>PJU Type</Text> |
|
|
|
search={false} |
|
|
|
<SelectList |
|
|
|
placeholder="Select Pipe Type" |
|
|
|
search={false} |
|
|
|
boxStyles={{borderRadius:50,borderWidth:2}} |
|
|
|
placeholder="Select Pipe Type" |
|
|
|
inputStyles={{color:'black'}} |
|
|
|
boxStyles={{borderRadius:10,borderWidth:1,borderColor:'#A6A6A6',width:352,height:45}} |
|
|
|
dropdownTextStyles={{color:'black'}} |
|
|
|
inputStyles={{color:'#6B5E5E'}} |
|
|
|
data={Pipe_Type} |
|
|
|
dropdownTextStyles={{color:'#6B5E5E'}} |
|
|
|
setSelected={setselectedPipeType} |
|
|
|
data={Pipe_Type} |
|
|
|
onSelect={()=> ( |
|
|
|
setSelected={setselectedPipeType} |
|
|
|
setPipeTypeError(false) |
|
|
|
onSelect={()=> ( |
|
|
|
)} |
|
|
|
[setPipeTypeError(false)] |
|
|
|
/> |
|
|
|
)} |
|
|
|
{pipeTyeError ? <Text style={styles.errorInput}>Pipe Type is Required!</Text>:null} |
|
|
|
/> |
|
|
|
|
|
|
|
{pipeTyeError ? <Text style={styles.errorInput}>Pipe Type is Required!</Text>:null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
marginTop: 15 |
|
|
|
marginTop: 15 |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<View> |
|
|
|
<View style={{alignSelf:'center',width:352,height:45}}> |
|
|
|
<Text style={styles.label}>Status <Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> |
|
|
|
{/* <Text style={styles.label}>Status<Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> */} |
|
|
|
<View style={{flexDirection:'row',alignItems:'center'}}> |
|
|
|
<Text style={styles.label}>Status</Text> |
|
|
|
<RadioButton |
|
|
|
<View style={{flexDirection:'row',alignItems:'center'}}> |
|
|
|
value="Baik" |
|
|
|
<RadioButton |
|
|
|
status={ checkedStatus === 'Baik' ? 'checked' : 'unchecked' } |
|
|
|
color='#434343' |
|
|
|
onPress={()=>{ |
|
|
|
value="Baik" |
|
|
|
setCheckedStatus('Baik'); |
|
|
|
status={ checkedStatus === 'Baik' ? 'checked' : 'unchecked' } |
|
|
|
setPipeStatusError(false); |
|
|
|
onPress={() => {setCheckedStatus('Baik'); setPipeStatusError(false)}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<Text style={{color:"#434343",fontWeight:'semibold',fontSize:16}}>Baik</Text> |
|
|
|
<Text style={{color:'black'}}>Baik</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View style={{flexDirection:'row',alignItems:'center'}}> |
|
|
|
<View style={{flexDirection:'row',alignItems:'center'}}> |
|
|
|
<RadioButton |
|
|
|
<RadioButton |
|
|
|
color='#434343' |
|
|
|
value="Rusak" |
|
|
|
value="Rusak" |
|
|
|
status={ checkedStatus === 'Rusak' ? 'checked' : 'unchecked' } |
|
|
|
status={ checkedStatus === 'Rusak' ? 'checked' : 'unchecked' } |
|
|
|
onPress={()=>{ |
|
|
|
onPress={() => {setCheckedStatus('Rusak'); setPipeStatusError(false); }} |
|
|
|
setCheckedStatus('Rusak'); |
|
|
|
/> |
|
|
|
setPipeStatusError(false); |
|
|
|
<Text style={{color:"#434343",fontWeight:'semibold',fontSize:16}}>Rusak</Text> |
|
|
|
}} |
|
|
|
</View> |
|
|
|
/> |
|
|
|
{pipeStatusError ? <Text style={styles.errorInput}>Status is Required!</Text>:null} |
|
|
|
<Text style={{color:'black'}}>Rusak</Text> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{pipeStatusError ? <Text style={styles.errorInput}>Status is Required!</Text>:null} |
|
|
|
|
|
|
|
<View |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
marginTop: 15 |
|
|
|
marginTop: 60 |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<View> |
|
|
|
<View style={{alignSelf:'center'}}> |
|
|
|
<Text style={styles.label}>Information <Text style={{color:'red',fontWeight:'bold'}}>*</Text></Text> |
|
|
|
<Text style={styles.label}>Information</Text> |
|
|
|
<TextInput style={{borderWidth:1,borderRadius:20,padding: 10,color:'black',textAlignVertical:'top'}} |
|
|
|
<TextInput style={{borderWidth:1,borderRadius:20,padding: 10,color:'#6B5E5E',borderColor:'#A6A6A6',textAlignVertical:'top',width:352,height:135}} |
|
|
|
multiline |
|
|
|
multiline |
|
|
|
numberOfLines={5} |
|
|
|
numberOfLines={5} |
|
|
|
maxLength={255} |
|
|
|
maxLength={255} |
|
|
|
onChangeText={(text)=>{ |
|
|
|
onChangeText={(text) => { |
|
|
|
setInformation(text) |
|
|
|
setInformation(text) |
|
|
|
}} |
|
|
|
}} |
|
|
|
onChange={()=> { |
|
|
|
onChange={()=> { |
|
|
|
setPipeInfoError(false) |
|
|
|
setPipeInfoError(false) |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
{pipeInfoError ? <Text style={styles.errorInput}>Information is Required!</Text>:null} |
|
|
|
{pipeInfoError ? <Text style={styles.errorInput}>Information is Required!</Text>:null} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
marginTop: 15 |
|
|
|
marginTop: 15 |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<View style={{alignSelf:'center'}}> |
|
|
|
|
|
|
|
<Text style={styles.label}>Installation Date</Text> |
|
|
|
|
|
|
|
<TextInput |
|
|
|
|
|
|
|
style={styles.input} |
|
|
|
|
|
|
|
onPress={() => setOpen(true)} |
|
|
|
|
|
|
|
value={String(momentDate)} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<DatePicker |
|
|
|
|
|
|
|
locale='en' |
|
|
|
|
|
|
|
theme='light' |
|
|
|
|
|
|
|
mode='date' |
|
|
|
|
|
|
|
modal |
|
|
|
|
|
|
|
open={open} |
|
|
|
|
|
|
|
date={install_date} |
|
|
|
|
|
|
|
onConfirm={(survey_date) => { |
|
|
|
|
|
|
|
setOpen(false) |
|
|
|
|
|
|
|
setInstallDate(survey_date) |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
onCancel={() => { |
|
|
|
|
|
|
|
setOpen(false) |
|
|
|
}} |
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<View |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
marginTop: 15 |
|
|
|
|
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<View> |
|
|
|
<View style={{alignSelf:'center',width:352}}> |
|
|
|
<Text style={styles.label}>Installation Date</Text> |
|
|
|
<Text style={styles.label}>Attachment</Text> |
|
|
|
<TextInput |
|
|
|
<Text style={{fontStyle:'italic',color:'#434343',fontSize:14}}>Lampirkan foto / gambar</Text> |
|
|
|
style={styles.input} |
|
|
|
{
|
|
|
|
onPress={() => setOpen(true)} |
|
|
|
imgUrl.length === 0 ? |
|
|
|
value={String(momentDate)} |
|
|
|
<Pressable onPress={()=>setModalAttachment(true)}> |
|
|
|
/> |
|
|
|
<View style={{width:352,height:70,borderRadius:10,borderStyle:'dashed',borderWidth:2,borderCurve:'continuous',borderColor:'#434343',alignItems:'center',justifyContent:'center',flexDirection:'row',columnGap:5}}> |
|
|
|
<DatePicker |
|
|
|
<Image |
|
|
|
locale='en' |
|
|
|
source={require('../../assets/icon/camorlib.png')} |
|
|
|
theme='dark' |
|
|
|
/> |
|
|
|
mode="date" |
|
|
|
<Text style={{fontStyle:'italic',color:'#434343'}}>Klik untuk menambahkan foto / gambar</Text> |
|
|
|
modal |
|
|
|
</View> |
|
|
|
open={open} |
|
|
|
</Pressable> |
|
|
|
date={install_date} |
|
|
|
: |
|
|
|
onConfirm={(survey_date) => { |
|
|
|
<FlatList |
|
|
|
setOpen(false) |
|
|
|
horizontal={false} |
|
|
|
setInstallDate(survey_date) |
|
|
|
showsHorizontalScrollIndicator={false} |
|
|
|
}} |
|
|
|
scrollEnabled={false} |
|
|
|
onCancel={() => { |
|
|
|
ListFooterComponent={()=> |
|
|
|
setOpen(false) |
|
|
|
<Pressable onPress={()=>setModalAttachment(true)}> |
|
|
|
}} |
|
|
|
<View style={{width:100,height:100,borderRadius:10,borderWidth:1,borderStyle:"dashed",flexDirection:'row',alignItems:'center',justifyContent:'center'}}> |
|
|
|
|
|
|
|
<Image |
|
|
|
|
|
|
|
source={require('../../assets/icon/camorlib.png')} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</Pressable> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
contentContainerStyle={{flexDirection:'row',flexWrap:'wrap',columnGap:25,rowGap:10}} |
|
|
|
|
|
|
|
data={imgUrl} |
|
|
|
|
|
|
|
renderItem={({item,index})=>renderItem({item,index})} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
marginTop: 15 |
|
|
|
marginTop: 30 |
|
|
|
}} |
|
|
|
}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</ScrollView> |
|
|
|
</ScrollView> |
|
|
|
<Button title='Send' onPress={showDialog} /> |
|
|
|
<Button title='Send' onPress={showDialog} /> |
|
|
|
<AwesomeAlert |
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<AwesomeAlert |
|
|
|
show={alertOnline} |
|
|
|
show={alertOnline} |
|
|
|
showProgress={false} |
|
|
|
showProgress={false} |
|
|
|
title="Collecting Data" |
|
|
|
title="Collecting Data" |
|
|
|
@ -544,6 +551,29 @@ export default function CollectLineScreen({route,navigation}:collectLineScreenPr |
|
|
|
titleStyle={{fontSize:20}} |
|
|
|
titleStyle={{fontSize:20}} |
|
|
|
messageStyle={{fontSize:16}} |
|
|
|
messageStyle={{fontSize:16}} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<Modal isVisible={ModalAttachment} animationIn={'fadeInUp'} animationOut={'fadeOutDown'} backdropOpacity={0} onBackdropPress={()=>setModalAttachment(false)} style={{top:'18%',alignSelf:'center'}}> |
|
|
|
|
|
|
|
<View key={"modal container"} style={{width:330,height:220,backgroundColor:'#F9F9F9',borderRadius:25,borderWidth:1,borderColor:'#A6A6A6'}}> |
|
|
|
|
|
|
|
<View style={{flexDirection:'row',alignItems:'center',justifyContent:'space-between',paddingLeft:30,paddingTop:20,paddingRight:10}}> |
|
|
|
|
|
|
|
<Text style={{fontSize:20,fontWeight:'semibold',color: '#434343',}}> |
|
|
|
|
|
|
|
Select Mode |
|
|
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
<Pressable onPress={()=>setModalAttachment(false)} style={{alignSelf:'flex-end',padding:10}}> |
|
|
|
|
|
|
|
<Image style={{tintColor:'#434343'}} |
|
|
|
|
|
|
|
source={require('../../assets/icon/x.png')} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Pressable> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
<View style={{padding:30}}> |
|
|
|
|
|
|
|
<TouchableOpacity onPress={()=>{openCameraLib(),setModalAttachment(false)}} style={{height:50,backgroundColor:'#FFFFFF',alignItems:'center',justifyContent:'center',borderTopLeftRadius:10,borderTopRightRadius:10,borderWidth:1,borderColor:'#A6A6A6'}}> |
|
|
|
|
|
|
|
<Text style={{fontSize:20,fontWeight:'light',color:'#434343'}}>Take photo</Text> |
|
|
|
|
|
|
|
</TouchableOpacity> |
|
|
|
|
|
|
|
<TouchableOpacity onPress={()=>{openLib(),setModalAttachment(false)}} style={{height:50,backgroundColor:'#FFFFFF',alignItems:'center',justifyContent:'center',borderBottomLeftRadius:10,borderBottomRightRadius:10,borderWidth:1,borderColor:'#A6A6A6'}}> |
|
|
|
|
|
|
|
<Text style={{fontSize:20,fontWeight:'light',color:'#434343'}}>Choose photo</Text> |
|
|
|
|
|
|
|
</TouchableOpacity> |
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
</Modal> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
) |
|
|
|
) |
|
|
|
}; |
|
|
|
}; |
|
|
|
@ -569,23 +599,25 @@ const styles = StyleSheet.create({ |
|
|
|
color: 'black' |
|
|
|
color: 'black' |
|
|
|
}, |
|
|
|
}, |
|
|
|
input: { |
|
|
|
input: { |
|
|
|
height: 40, |
|
|
|
width:352, |
|
|
|
|
|
|
|
height: 45, |
|
|
|
borderWidth: 1, |
|
|
|
borderWidth: 1, |
|
|
|
padding: 10, |
|
|
|
padding: 10, |
|
|
|
borderRadius: 50, |
|
|
|
borderRadius: 10, |
|
|
|
color: 'black' |
|
|
|
color: '#6B5E5E', |
|
|
|
|
|
|
|
borderColor:'#A6A6A6' |
|
|
|
}, |
|
|
|
}, |
|
|
|
container: { |
|
|
|
container: { |
|
|
|
flex: 1, |
|
|
|
|
|
|
|
backgroundColor: '#ecf0f1', |
|
|
|
|
|
|
|
padding: 10, |
|
|
|
padding: 10, |
|
|
|
|
|
|
|
flexGrow: 1 |
|
|
|
}, |
|
|
|
}, |
|
|
|
mainContainer: { |
|
|
|
mainContainer: { |
|
|
|
flex: 1, |
|
|
|
flex: 1, |
|
|
|
}, |
|
|
|
}, |
|
|
|
label: { |
|
|
|
label: { |
|
|
|
fontSize: 21, |
|
|
|
fontSize: 16, |
|
|
|
color: 'black', |
|
|
|
fontWeight:'semibold', |
|
|
|
|
|
|
|
color: '#434343', |
|
|
|
// marginBottom: 20
|
|
|
|
// marginBottom: 20
|
|
|
|
}, |
|
|
|
}, |
|
|
|
title: { |
|
|
|
title: { |
|
|
|
|