|
@ -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}> |
|
@ -131,16 +145,14 @@ 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; |