Browse Source

minor adjustments

master
analuizaff 3 years ago
parent
commit
95e73ae621
  1. 56
      src/app/components/FloatButton.js
  2. 2
      src/app/components/MenuItens.js
  3. 2
      src/app/navigation/SharingDataOptionsNavigator.js
  4. 4
      src/app/screens/AccountScreen.js
  5. 4
      src/app/screens/LoginScreen.js
  6. 2
      src/app/screens/MapFeedScreen.js

56
src/app/components/FloatButton.js

@ -18,6 +18,7 @@ import MenuItens from "./MenuItens";
const screenWidth = Dimensions.get("window").width; const screenWidth = Dimensions.get("window").width;
const screenHeight = Dimensions.get("window").height; const screenHeight = Dimensions.get("window").height;
console.log("-----screenHeight: " + screenHeight);
function FloatButton(props) { function FloatButton(props) {
@ -77,7 +78,6 @@ function FloatButton(props) {
}); });
const selectedItens = (item) => { const selectedItens = (item) => {
item.isSelected = !item.isSelected; item.isSelected = !item.isSelected;
setChanged(!changed); setChanged(!changed);
} }
@ -103,18 +103,32 @@ function FloatButton(props) {
return ( return (
<View> <View>
<View style={styles.Menucontainer} > <View style={styles.Menucontainer} >
<View style={{ <View style={{
flex: 1, flex: 1,
height: screenHeight * 0.70,//solução temporária, procurar soluções pro menu se ajustar melhor ao layout
paddingTop: (screenHeight > 600 ? 0 : screenHeight * 0.09)
flexDirection: "column",
height: screenHeight * 0.75,//solução temporária, procurar soluções pro menu se ajustar melhor ao layout
paddingTop: (screenHeight > 600 ? 0 : screenHeight * 0.10)
}}> }}>
<FlatList
data={layers.values}
keyExtractor={(datas) => datas.id.toString()}
renderItem={renderItem}
extraData={changed}
/>
<View style={{
flex: 0.05,
marginTop: screenHeight * 0.09,
paddingBottom: 10,
zIndex:3,
justifyContent: "center"
}}>
<Text style={styles.menuLabel}>
Escolha o que deseja ver no mapa:
</Text>
</View>
<View
style={{ flex: 0.85, flexGrow: 0.85, marginTop: 2 }}>
<FlatList
data={layers.values}
keyExtractor={(datas) => datas.id.toString()}
renderItem={renderItem}
extraData={changed, open}
/>
</View>
<View style={styles.submit_btn}> <View style={styles.submit_btn}>
<TouchableOpacity onPress={() => applyLayers()}> <TouchableOpacity onPress={() => applyLayers()}>
<View style={styles.button}> <View style={styles.button}>
@ -128,19 +142,17 @@ function FloatButton(props) {
); );
} }
/*------------------------------------------------------------------------------------------------------------------------ */ /*------------------------------------------------------------------------------------------------------------------------ */
return ( return (
<View style={[styles.container]}> <View style={[styles.container]}>
<View style={{
width: (open ? screenWidth * 0.70 : 0),
flex: 1,
{open && (<View style={{
width: screenWidth * 0.70,
}}> }}>
<Animated.View> <Animated.View>
{DataMenu()} {DataMenu()}
</Animated.View> </Animated.View>
</View>
<View style={{ margin: 35, alignSelf: "flex-end" }}>
</View>)}
<View style={{ flex: 0.10, margin: 12, alignSelf: "flex-end" }}>
<TouchableWithoutFeedback onPress={toggleMenu}> <TouchableWithoutFeedback onPress={toggleMenu}>
<Animated.View style={[styles.floatButton, styles.menu]}> <Animated.View style={[styles.floatButton, styles.menu]}>
<MaterialCommunityIcons <MaterialCommunityIcons
@ -187,6 +199,7 @@ const styles = StyleSheet.create({
bottom: 0, bottom: 0,
width: "100%", width: "100%",
padding: 20, padding: 20,
flex: 0.10
}, },
button: { button: {
backgroundColor: "#1976D2", backgroundColor: "#1976D2",
@ -212,7 +225,14 @@ const styles = StyleSheet.create({
color: colors.lightBlue, color: colors.lightBlue,
fontSize: dimensions.text.tertiary, fontSize: dimensions.text.tertiary,
fontWeight: "bold", fontWeight: "bold",
}
},
menuLabel: {
color: colors.lightBlue,
fontSize: 16,
fontWeight: "bold",
padding: 10,
backgroundColor: colors.white,
},
}); });
export default FloatButton; export default FloatButton;

2
src/app/components/MenuItens.js

@ -10,7 +10,7 @@ import { Ionicons } from '@expo/vector-icons';
function MenuItens({ item, onPress, icon }) { function MenuItens({ item, onPress, icon }) {
return ( return (
<TouchableOpacity onPress={onPress} style={[styles.item]}> <TouchableOpacity onPress={onPress} style={[styles.item]}>
<View style={{ flexDirection: "row", flex: 1, marginTop: 12 }}>
<View style={{ flexDirection: "row", flex: 1, paddingTop: 20 }}>
<View style={{ flexDirection: "row", flex: 0.20 }}> <View style={{ flexDirection: "row", flex: 0.20 }}>
<Ionicons name="md-rainy" size={24} color={colors.lightBlue} /> <Ionicons name="md-rainy" size={24} color={colors.lightBlue} />
</View> </View>

2
src/app/navigation/SharingDataOptionsNavigator.js

@ -67,7 +67,7 @@ function SharingDataOptionsNavigator() {
name="FormMap" name="FormMap"
component={MapFormScreen} component={MapFormScreen}
options={{ options={{
title: "Voltar",
title: "Selecione o ponto no mapa",
headerStyle: { headerStyle: {
backgroundColor: "white", backgroundColor: "white",
}, },

4
src/app/screens/AccountScreen.js

@ -34,7 +34,7 @@ function AccountScreen(props) {
<Text>{user.name}</Text> <Text>{user.name}</Text>
<Text>{user.email}</Text> <Text>{user.email}</Text>
<TouchableOpacity onPress={()=> props.navigation.navigate("PluviometerRegister")}>
{/* <TouchableOpacity onPress={()=> props.navigation.navigate("PluviometerRegister")}>
<View style={{ <View style={{
flexDirection: "row", flexDirection: "row",
justifyContent: "flex-start", justifyContent: "flex-start",
@ -55,7 +55,7 @@ function AccountScreen(props) {
</Text> </Text>
</View> </View>
</View> </View>
</TouchableOpacity>
</TouchableOpacity>*/}
<View style={{ paddingTop: 40 }}> <View style={{ paddingTop: 40 }}>
<Button <Button
title="Logout" title="Logout"

4
src/app/screens/LoginScreen.js

@ -85,7 +85,7 @@ export default function LoginScreen(props) {
<SubmitButton title="entrar" backgroundColor={colors.primary} /> <SubmitButton title="entrar" backgroundColor={colors.primary} />
<TouchableNativeFeedback
{/* <TouchableNativeFeedback
onPress={() => { onPress={() => {
props.navigation.navigate("Register"); props.navigation.navigate("Register");
}} }}
@ -94,7 +94,7 @@ export default function LoginScreen(props) {
<Text>Não tem uma conta? </Text> <Text>Não tem uma conta? </Text>
<Text style={{ color: colors.lightBlue }}>Cadastre-se</Text> <Text style={{ color: colors.lightBlue }}>Cadastre-se</Text>
</View> </View>
</TouchableNativeFeedback>
</TouchableNativeFeedback>*/}
</Form> </Form>
</Screen> </Screen>
); );

2
src/app/screens/MapFeedScreen.js

@ -16,8 +16,6 @@ function MapFeedScreen(props) {
const datas = useContext(MapDataContext); const datas = useContext(MapDataContext);
const location = context.currentCoordinates; const location = context.currentCoordinates;
const focusChanged = attachFocusToQuery(); const focusChanged = attachFocusToQuery();
console.log("-----------latitude: "+ location.latitude);
console.log("-----------longitude: "+ location.longitude);
const default_location = { const default_location = {
latitude: -12.901799, latitude: -12.901799,

Loading…
Cancel
Save