wpを削除して配置を変更
This commit is contained in:
parent
6a58263e94
commit
73ed5480c1
@ -14,7 +14,6 @@ import ActionSheet, { SheetManager } from "react-native-actions-sheet";
|
|||||||
import Sign from "../../components/駅名表/Sign";
|
import Sign from "../../components/駅名表/Sign";
|
||||||
|
|
||||||
import { TicketBox } from "../atom/TicketBox";
|
import { TicketBox } from "../atom/TicketBox";
|
||||||
import { widthPercentageToDP as wp } from "react-native-responsive-screen";
|
|
||||||
import { getPDFViewURL } from "../../lib/getPdfViewURL";
|
import { getPDFViewURL } from "../../lib/getPdfViewURL";
|
||||||
import { useBusAndTrainData } from "../../stateBox/useBusAndTrainData";
|
import { useBusAndTrainData } from "../../stateBox/useBusAndTrainData";
|
||||||
import { AS } from "../../storageControl";
|
import { AS } from "../../storageControl";
|
||||||
@ -27,13 +26,14 @@ import { StationTimeTableButton } from "./StationDeteilView/StationTimeTableButt
|
|||||||
export const StationDeteilView = (props) => {
|
export const StationDeteilView = (props) => {
|
||||||
if (!props.payload) return <></>;
|
if (!props.payload) return <></>;
|
||||||
const { currentStation, navigate, onExit, goTo, useShow } = props.payload;
|
const { currentStation, navigate, onExit, goTo, useShow } = props.payload;
|
||||||
|
const { width } = useWindowDimensions();
|
||||||
const { busAndTrainData } = useBusAndTrainData();
|
const { busAndTrainData } = useBusAndTrainData();
|
||||||
const [trainBus, setTrainBus] = useState();
|
const [trainBus, setTrainBus] = useState();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!currentStation) return () => {};
|
if (!currentStation) return () => {};
|
||||||
const data = busAndTrainData.filter((d) =>
|
const data = busAndTrainData.filter(
|
||||||
d.name === currentStation[0].Station_JP
|
(d) => d.name === currentStation[0].Station_JP
|
||||||
);
|
);
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
setTrainBus();
|
setTrainBus();
|
||||||
@ -89,7 +89,7 @@ export const StationDeteilView = (props) => {
|
|||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
{currentStation && (
|
{currentStation && (
|
||||||
<View style={{ margin: 10, marginHorizontal: wp("10%") }}>
|
<View style={{ margin: 10, marginHorizontal: width * 0.1 }}>
|
||||||
<Sign
|
<Sign
|
||||||
stationID={currentStation[0].StationNumber}
|
stationID={currentStation[0].StationNumber}
|
||||||
oP={() => {
|
oP={() => {
|
||||||
|
@ -1,9 +1,22 @@
|
|||||||
import React, { CSSProperties, FC } from "react";
|
import React, { CSSProperties, FC } from "react";
|
||||||
import { widthPercentageToDP as wp } from "react-native-responsive-screen";
|
import {
|
||||||
import { Platform, Text, TextStyle, View, ViewStyle } from "react-native";
|
Platform,
|
||||||
|
Text,
|
||||||
|
TextStyle,
|
||||||
|
useWindowDimensions,
|
||||||
|
View,
|
||||||
|
ViewStyle,
|
||||||
|
} from "react-native";
|
||||||
import { StationName } from "./StationName";
|
import { StationName } from "./StationName";
|
||||||
import lineColorList from "../../assets/originData/lineColorList";
|
import lineColorList from "../../assets/originData/lineColorList";
|
||||||
export const NextPreStationLine = ({ nexStation, preStation, isMatsuyama }) => {
|
export const NextPreStationLine = ({ nexStation, preStation, isMatsuyama }) => {
|
||||||
|
const 下枠フレーム: ViewStyle = {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: "row",
|
||||||
|
alignContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={下枠フレーム}>
|
<View style={下枠フレーム}>
|
||||||
<View style={下枠フレーム}>
|
<View style={下枠フレーム}>
|
||||||
@ -49,12 +62,40 @@ type FCimport = {
|
|||||||
children: string;
|
children: string;
|
||||||
};
|
};
|
||||||
const BottomSideArrow: FC<FCimport> = ({ isMatsuyama, children }) => {
|
const BottomSideArrow: FC<FCimport> = ({ isMatsuyama, children }) => {
|
||||||
|
const 下枠左右マーク: TextStyle = {
|
||||||
|
fontWeight: "bold",
|
||||||
|
fontSize: parseInt("20%"),
|
||||||
|
color: "white",
|
||||||
|
paddingHorizontal: 5,
|
||||||
|
textAlignVertical: "center",
|
||||||
|
};
|
||||||
return !isMatsuyama && <Text style={下枠左右マーク}>{children}</Text>;
|
return !isMatsuyama && <Text style={下枠左右マーク}>{children}</Text>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const BottomStationNumberView: FC<FCimport> = ({ isMatsuyama, children }) => {
|
const BottomStationNumberView: FC<FCimport> = ({ isMatsuyama, children }) => {
|
||||||
|
const { width } = useWindowDimensions();
|
||||||
const lineID = children.slice(0, 1);
|
const lineID = children.slice(0, 1);
|
||||||
const lineName = children.slice(1);
|
const lineName = children.slice(1);
|
||||||
|
const 下枠駅ナンバー: ViewStyle = {
|
||||||
|
alignContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
width: width * 0.08,
|
||||||
|
height: width * 0.08,
|
||||||
|
margin: width * 0.01,
|
||||||
|
backgroundColor: "white",
|
||||||
|
borderWidth: parseInt("3%"),
|
||||||
|
borderRadius: parseInt("100%"),
|
||||||
|
};
|
||||||
|
const 下枠駅ナンバーB: ViewStyle = {
|
||||||
|
alignContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
width: width * 0.07,
|
||||||
|
height: width * 0.07,
|
||||||
|
margin: width * 0.02,
|
||||||
|
backgroundColor: "white",
|
||||||
|
borderWidth: parseInt("3%"),
|
||||||
|
borderRadius: parseInt("100%"),
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
@ -77,37 +118,3 @@ const BottomStationNumberView: FC<FCimport> = ({ isMatsuyama, children }) => {
|
|||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const 下枠フレーム: ViewStyle = {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: "row",
|
|
||||||
alignContent: "center",
|
|
||||||
alignItems: "center",
|
|
||||||
};
|
|
||||||
const 下枠左右マーク: TextStyle = {
|
|
||||||
fontWeight: "bold",
|
|
||||||
fontSize: parseInt("20%"),
|
|
||||||
color: "white",
|
|
||||||
paddingHorizontal: 5,
|
|
||||||
textAlignVertical: "center",
|
|
||||||
};
|
|
||||||
const 下枠駅ナンバー: ViewStyle = {
|
|
||||||
alignContent: "center",
|
|
||||||
alignItems: "center",
|
|
||||||
width: wp("8%"),
|
|
||||||
height: wp("8%"),
|
|
||||||
margin: wp("1%"),
|
|
||||||
backgroundColor: "white",
|
|
||||||
borderWidth: parseInt("3%"),
|
|
||||||
borderRadius: parseInt("100%"),
|
|
||||||
};
|
|
||||||
const 下枠駅ナンバーB: ViewStyle = {
|
|
||||||
alignContent: "center",
|
|
||||||
alignItems: "center",
|
|
||||||
width: wp("7%"),
|
|
||||||
height: wp("7%"),
|
|
||||||
margin: wp("2%"),
|
|
||||||
backgroundColor: "white",
|
|
||||||
borderWidth: parseInt("3%"),
|
|
||||||
borderRadius: parseInt("100%"),
|
|
||||||
};
|
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import React, { useRef, useState, useEffect, useLayoutEffect } from "react";
|
import React, { useRef, useState, useEffect, useLayoutEffect } from "react";
|
||||||
import { View, Text, TouchableOpacity } from "react-native";
|
import {
|
||||||
import { widthPercentageToDP as wp } from "react-native-responsive-screen";
|
View,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
useWindowDimensions,
|
||||||
|
} from "react-native";
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
import LottieView from "lottie-react-native";
|
import LottieView from "lottie-react-native";
|
||||||
import { useInterval } from "../../lib/useInterval";
|
import { useInterval } from "../../lib/useInterval";
|
||||||
@ -16,6 +20,8 @@ import { useStationList } from "../../stateBox/useStationList";
|
|||||||
|
|
||||||
export default function Sign(props) {
|
export default function Sign(props) {
|
||||||
const { oP, oLP, isCurrentStation = false, stationID } = props;
|
const { oP, oLP, isCurrentStation = false, stationID } = props;
|
||||||
|
|
||||||
|
const { width, height } = useWindowDimensions();
|
||||||
const { getStationDataFromId } = useStationList();
|
const { getStationDataFromId } = useStationList();
|
||||||
if (!stationID) {
|
if (!stationID) {
|
||||||
return <></>;
|
return <></>;
|
||||||
@ -117,6 +123,62 @@ export default function Sign(props) {
|
|||||||
}
|
}
|
||||||
setTestButtonStatus(!testButtonStatus);
|
setTestButtonStatus(!testButtonStatus);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const styleSheet = {
|
||||||
|
外枠: {
|
||||||
|
width: width * 0.8,
|
||||||
|
height: ((width * 0.8) / 20) * 9,
|
||||||
|
borderColor: "#0099CC",
|
||||||
|
borderWidth: 1,
|
||||||
|
backgroundColor: "white",
|
||||||
|
},
|
||||||
|
外枠B: {
|
||||||
|
width: width * 0.8,
|
||||||
|
height: ((width * 0.8) / 20) * 9,
|
||||||
|
borderWidth: 0,
|
||||||
|
},
|
||||||
|
下帯: {
|
||||||
|
position: "absolute",
|
||||||
|
bottom: "8%",
|
||||||
|
left: "0%",
|
||||||
|
width: "100%",
|
||||||
|
height: "27%",
|
||||||
|
backgroundColor: "#0099CC",
|
||||||
|
},
|
||||||
|
下帯B: {
|
||||||
|
position: "absolute",
|
||||||
|
bottom: "0%",
|
||||||
|
left: "0%",
|
||||||
|
width: "100%",
|
||||||
|
height: "26%",
|
||||||
|
backgroundColor: "#454545",
|
||||||
|
},
|
||||||
|
JRStyle: {
|
||||||
|
position: "absolute",
|
||||||
|
top: "2%",
|
||||||
|
left: "2%",
|
||||||
|
fontWeight: "bold",
|
||||||
|
fontSize: parseInt("25%"),
|
||||||
|
color: "#0099CC",
|
||||||
|
},
|
||||||
|
下帯内容: {
|
||||||
|
position: "absolute",
|
||||||
|
bottom: "8%",
|
||||||
|
height: "27%",
|
||||||
|
width: "100%",
|
||||||
|
alignItems: "center",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
下帯内容B: {
|
||||||
|
position: "absolute",
|
||||||
|
bottom: "0%",
|
||||||
|
height: "26%",
|
||||||
|
width: "100%",
|
||||||
|
alignItems: "center",
|
||||||
|
flexDirection: "column",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={styleSheet[isMatsuyama ? "外枠B" : "外枠"]}
|
style={styleSheet[isMatsuyama ? "外枠B" : "外枠"]}
|
||||||
@ -128,8 +190,8 @@ export default function Sign(props) {
|
|||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
style={{
|
style={{
|
||||||
width: wp("80%"),
|
width: width * 0.8,
|
||||||
height: (wp("80%") / 20) * 9,
|
height: ((width * 0.8) / 20) * 9,
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
}}
|
}}
|
||||||
source={require("../../assets/StationSign.json")}
|
source={require("../../assets/StationSign.json")}
|
||||||
@ -168,58 +230,3 @@ export default function Sign(props) {
|
|||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const styleSheet = {
|
|
||||||
外枠: {
|
|
||||||
width: wp("80%"),
|
|
||||||
height: (wp("80%") / 20) * 9,
|
|
||||||
borderColor: "#0099CC",
|
|
||||||
borderWidth: 1,
|
|
||||||
backgroundColor: "white",
|
|
||||||
},
|
|
||||||
外枠B: {
|
|
||||||
width: wp("80%"),
|
|
||||||
height: (wp("80%") / 20) * 9,
|
|
||||||
borderWidth: 0,
|
|
||||||
},
|
|
||||||
下帯: {
|
|
||||||
position: "absolute",
|
|
||||||
bottom: "8%",
|
|
||||||
left: "0%",
|
|
||||||
width: "100%",
|
|
||||||
height: "27%",
|
|
||||||
backgroundColor: "#0099CC",
|
|
||||||
},
|
|
||||||
下帯B: {
|
|
||||||
position: "absolute",
|
|
||||||
bottom: "0%",
|
|
||||||
left: "0%",
|
|
||||||
width: "100%",
|
|
||||||
height: "26%",
|
|
||||||
backgroundColor: "#454545",
|
|
||||||
},
|
|
||||||
JRStyle: {
|
|
||||||
position: "absolute",
|
|
||||||
top: "2%",
|
|
||||||
left: "2%",
|
|
||||||
fontWeight: "bold",
|
|
||||||
fontSize: parseInt("25%"),
|
|
||||||
color: "#0099CC",
|
|
||||||
},
|
|
||||||
下帯内容: {
|
|
||||||
position: "absolute",
|
|
||||||
bottom: "8%",
|
|
||||||
height: "27%",
|
|
||||||
width: "100%",
|
|
||||||
alignItems: "center",
|
|
||||||
flexDirection: "column",
|
|
||||||
},
|
|
||||||
下帯内容B: {
|
|
||||||
position: "absolute",
|
|
||||||
bottom: "0%",
|
|
||||||
height: "26%",
|
|
||||||
width: "100%",
|
|
||||||
alignItems: "center",
|
|
||||||
flexDirection: "column",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
3
menu.js
3
menu.js
@ -57,6 +57,9 @@ export default function Menu({
|
|||||||
// AS.setItem("stationListMode", "position");
|
// AS.setItem("stationListMode", "position");
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
useEffect(()=>{
|
||||||
|
alert(`height:${height}, width:${width}, bottom:${bottom}, left:${left}, right:${right}, top:${top}, tabBarHeight:${tabBarHeight}`);
|
||||||
|
}, [height, width, bottom, left, right, top, tabBarHeight])
|
||||||
const mapsRef = useRef(null);
|
const mapsRef = useRef(null);
|
||||||
const returnToTop = (bool = true) => {
|
const returnToTop = (bool = true) => {
|
||||||
scrollRef.current.scrollTo({
|
scrollRef.current.scrollTo({
|
||||||
|
Loading…
Reference in New Issue
Block a user