Commit 021bd1f6 authored by Trisno's avatar Trisno

build 130 dan fixing bug tambah alamat, keyboard nutupin textinput

parent de43f201
{ {
"expo": { "expo": {
"extra" : { "extra" : {
"buildNumber" : "128", "buildNumber" : "130",
"remarks": "" "remarks": ""
}, },
......
...@@ -219,107 +219,113 @@ class AddreesDetail extends React.Component { ...@@ -219,107 +219,113 @@ class AddreesDetail extends React.Component {
render() { render() {
return ( return (
<KeyboardAvoidingView behavior={Platform.OS == "ios" ? 40 : 0} style={styles.container}> <KeyboardAvoidingView
<ScrollView> behavior={Platform.OS == 'ios' ? "padding" : "height"}
<View style={styles.content}> style={{ flex: 1 }}>
<View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row', marginTop: 15, marginLeft: 10, marginRight: 10 }}>
<View style={{ flex: 1, top: 5 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> <View style={styles.container}>
</View> <ScrollView>
<View style={{ flex: 6 }}> <View style={styles.content}>
<TextInput style={{ height: 45 }} placeholder={i18n.t('findAddress')} <View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row', marginTop: 15, marginLeft: 10, marginRight: 10 }}>
caretHidden={this.state.caretHidden} <View style={{ flex: 1, top: 5 }}>
onFocus={() => this.setState({ caretHidden: false })} <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
onChangeText={(address) => this.setState({ address })}> </View>
</TextInput> <View style={{ flex: 6 }}>
</View> <TextInput style={{ height: 45 }} placeholder={i18n.t('findAddress')}
<View style={{ flex: 1, margin: 5 }}> caretHidden={this.state.caretHidden}
<TouchableOpacity onPress={() => this._searchLocation()}> onFocus={() => this.setState({ caretHidden: false })}
<Ionicons name="ios-search" size={32} color="#ccb46c" /> onChangeText={(address) => this.setState({ address })}>
</TouchableOpacity> </TextInput>
</View>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity onPress={() => this._searchLocation()}>
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</TouchableOpacity>
</View>
</View> </View>
</View> <View style={styles.cont_google_map}>
<View style={styles.cont_google_map}> <MapView
<MapView region={{
region={{
latitude: this.state.latitude,
longitude: this.state.longitude,
latitudeDelta: 0.1,
longitudeDelta: 0.1,
}}
zoomEnabled={true}
showsMyLocationButton={true}
loadingEnabled={true}
showsUserLocation={true}
showsScale={true}
provider={PROVIDER_GOOGLE}
style={styles.cont_google_map}>
<MapView.Marker
coordinate={{
latitude: this.state.latitude, latitude: this.state.latitude,
longitude: this.state.longitude longitude: this.state.longitude,
latitudeDelta: 0.1,
longitudeDelta: 0.1,
}} }}
title={i18n.t('yourLocation')} zoomEnabled={true}
description={this.state.street} showsMyLocationButton={true}
/> loadingEnabled={true}
</MapView> showsUserLocation={true}
<View style={{ position: 'absolute', top: '50%', alignSelf: 'flex-end' }}> showsScale={true}
<View style={{ margin: 15 }}> provider={PROVIDER_GOOGLE}
<TouchableOpacity style={{ height: 30, width: 30, backgroundColor: '#e6e6e6' }} onPress={() => this._getLocationAsync()}> style={styles.cont_google_map}>
{/* <Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> */} <MapView.Marker
</TouchableOpacity> coordinate={{
latitude: this.state.latitude,
longitude: this.state.longitude
}}
title={i18n.t('yourLocation')}
description={this.state.street}
/>
</MapView>
<View style={{ position: 'absolute', top: '50%', alignSelf: 'flex-end' }}>
<View style={{ margin: 15 }}>
<TouchableOpacity style={{ height: 30, width: 30, backgroundColor: '#e6e6e6' }} onPress={() => this._getLocationAsync()}>
{/* <Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> */}
</TouchableOpacity>
</View>
</View> </View>
</View> </View>
</View> <View style={styles.name_addrees_input}>
<View style={styles.name_addrees_input}> <View style={{ flexDirection: 'row', top: 10, justifyContent: 'center' }}>
<View style={{ flexDirection: 'row', top: 10, justifyContent: 'center' }}> <View style={{ flex: 1, justifyContent: 'center', flexDirection: 'row' }}>
<View style={{ flex: 1, justifyContent: 'center', flexDirection: 'row' }}> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> </View>
{this.state.indicator == true ? (
<ActivityIndicator size="large" color="#c9af6d" />
) : (
<View style={{ flex: 3, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.street}</Text>
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.city} </Text>
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.region}</Text>
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.postalCode}</Text>
</View>
)}
<View style={{ flex: 1 }}>
</View>
</View> </View>
{this.state.indicator == true ? ( <View style={styles.field_name_addrees}>
<ActivityIndicator size="large" color="#c9af6d" /> <Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('label')}</Text>
) : ( <TextInput style={{ color: 'grey', fontFamily: 'Gotham-Black', height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey', textAlign: 'center' }}
<View style={{ flex: 3, justifyContent: 'center' }}> onChangeText={(name) => this.setState({ name })}
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.street}</Text> caretHidden={this.state.caretHidden}
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.city} </Text> onFocus={() => this.setState({ caretHidden: false })} />
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.region}</Text>
<Text style={{ fontFamily: 'Gotham-Light', textAlign: 'center' }}>{this.state.postalCode}</Text>
</View>
)}
<View style={{ flex: 1 }}>
</View> </View>
</View>
<View style={styles.field_name_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('label')}</Text>
<TextInput style={{ color: 'grey', fontFamily: 'Gotham-Black', height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey', textAlign: 'center' }}
onChangeText={(name) => this.setState({ name })}
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })} />
</View>
<View style={styles.field_detail_addrees}> <View style={styles.field_detail_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('detail')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('detail')}</Text>
<TextInput <TextInput
style={{ color: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', height: 70, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} style={{ color: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', height: 70, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }}
onChangeText={(description) => this.setState({ description })} onChangeText={(description) => this.setState({ description })}
numberOfLines={10} numberOfLines={10}
multiline={true} multiline={true}
caretHidden={this.state.caretHidden} caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })} /> onFocus={() => this.setState({ caretHidden: false })} />
</View> </View>
<View style={{ margin: 50, justifyContent: 'center' }}> <View style={{ margin: 50, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.saveAddress()}> <TouchableOpacity onPress={() => this.saveAddress()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('addaddress')}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('addaddress')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View>
<View style={{ height: 20 }}></View>
</View> </View>
<View style={{ height: 20 }}></View>
</View> </View>
</View> </ScrollView>
</ScrollView> </View>
</KeyboardAvoidingView> </KeyboardAvoidingView>
) )
} }
......
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