横方向メニュー追加(現時点では採用しない)

This commit is contained in:
harukin-OneMix4 2023-07-07 22:29:31 +09:00
parent b0b15f726c
commit dfdd9a7f37

View File

@ -15,7 +15,10 @@ import ActionSheet from "react-native-actions-sheet";
import LottieView from "lottie-react-native"; import LottieView from "lottie-react-native";
import trainList from "../../assets/originData/trainList"; import trainList from "../../assets/originData/trainList";
import { lineList } from "../../lib/getStationList"; import { lineList } from "../../lib/getStationList";
import { heightPercentageToDP } from "react-native-responsive-screen"; import {
heightPercentageToDP,
widthPercentageToDP,
} from "react-native-responsive-screen";
import lineColorList from "../../assets/originData/lineColorList"; import lineColorList from "../../assets/originData/lineColorList";
export const EachTrainInfo = ({ export const EachTrainInfo = ({
@ -225,61 +228,22 @@ export const EachTrainInfo = ({
/> />
)} )}
</View> </View>
<View <ScrollView
style={{ flexDirection: "row", height: heightPercentageToDP("20%") }} style={{
flexDirection: "row",
//width: widthPercentageToDP("200%"),
height: heightPercentageToDP("20%"),
}}
horizontal
pagingEnabled
> >
<View <View
style={{ style={{
flex: 1, flexDirection: "row",
backgroundColor: "white", height: heightPercentageToDP("20%"),
borderRadius: 10, width: widthPercentageToDP("100%"),
padding: 10,
margin: 10,
}} }}
> >
<Text style={{ fontSize: 15, color: "#0099CC" }}>
現在地 {currentPosition.toString()}
</Text>
<View style={{ flex: 1 }} />
{data.trainData?.Pos && data.trainData?.Pos.match("") ? (
<>
<Text
style={{
fontSize: 28,
color: "#0099CC",
textAlign: "right",
}}
>
{
data.trainData?.Pos.replace("(下り)", "")
.replace("(上り)", "")
.split("")[0]
}
</Text>
<Text style={{ color: "#0099CC", textAlign: "right" }}></Text>
<Text
style={{
fontSize: 28,
color: "#0099CC",
textAlign: "right",
}}
>
{
data.trainData?.Pos.replace("(下り)", "")
.replace("(上り)", "")
.split("")[1]
}
</Text>
</>
) : (
<Text
style={{ fontSize: 28, color: "#0099CC", textAlign: "right" }}
>
{data.trainData?.Pos}
</Text>
)}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<View <View
style={{ style={{
flex: 1, flex: 1,
@ -290,42 +254,176 @@ export const EachTrainInfo = ({
}} }}
> >
<Text style={{ fontSize: 15, color: "#0099CC" }}> <Text style={{ fontSize: 15, color: "#0099CC" }}>
{isNaN(data.trainData?.delay) ? "状態" : "遅延時分"} 現在地 {currentPosition.toString()}
</Text> </Text>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
<Text {data.trainData?.Pos && data.trainData?.Pos.match("") ? (
style={{ <>
fontSize: 32, <Text
color: "#0099CC", style={{
textAlign: "right", fontSize: 28,
}} color: "#0099CC",
> textAlign: "right",
{data.trainData?.delay} }}
{isNaN(data.trainData?.delay) ? "" : "分"} >
</Text> {
data.trainData?.Pos.replace("(下り)", "")
.replace("(上り)", "")
.split("")[0]
}
</Text>
<Text style={{ color: "#0099CC", textAlign: "right" }}>
</Text>
<Text
style={{
fontSize: 28,
color: "#0099CC",
textAlign: "right",
}}
>
{
data.trainData?.Pos.replace("(下り)", "")
.replace("(上り)", "")
.split("")[1]
}
</Text>
</>
) : (
<Text
style={{ fontSize: 28, color: "#0099CC", textAlign: "right" }}
>
{data.trainData?.Pos}
</Text>
)}
</View> </View>
<View <View style={{ flex: 1, flexDirection: "column" }}>
style={{ <View
flex: 1,
backgroundColor: "white",
borderRadius: 10,
padding: 10,
margin: 10,
}}
>
<Text style={{ fontSize: 15, color: "#0099CC" }}>列番</Text>
<Text
style={{ style={{
fontSize: 32, flex: 1,
color: "#0099CC", backgroundColor: "white",
textAlign: "right", borderRadius: 10,
padding: 10,
margin: 10,
}} }}
> >
{data.trainData?.num} <Text style={{ fontSize: 15, color: "#0099CC" }}>
</Text> {isNaN(data.trainData?.delay) ? "状態" : "遅延時分"}
</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 32,
color: "#0099CC",
textAlign: "right",
}}
>
{data.trainData?.delay}
{isNaN(data.trainData?.delay) ? "" : "分"}
</Text>
</View>
<View
style={{
flex: 1,
backgroundColor: "white",
borderRadius: 10,
padding: 10,
margin: 10,
}}
>
<Text style={{ fontSize: 15, color: "#0099CC" }}>列番</Text>
<Text
style={{
fontSize: 32,
color: "#0099CC",
textAlign: "right",
}}
>
{data.trainData?.num}
</Text>
</View>
</View> </View>
</View> </View>
</View> <View
style={{
flexDirection: "column",
height: heightPercentageToDP("20%"),
flex: 1,
width: widthPercentageToDP("100%"),
}}
>
<View style={{ flex: 1, flexDirection: "row" }}>
<View
style={{
flex: 1,
backgroundColor: "white",
borderRadius: 10,
padding: 10,
margin: 10,
}}
>
<Text style={{ fontSize: 15, color: "#0099CC" }}>行先</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
color: "#0099CC",
textAlign: "right",
}}
>
岡山
</Text>
</View>
<View
style={{
flex: 3,
backgroundColor: "white",
borderRadius: 10,
padding: 10,
margin: 10,
}}
>
<Text style={{ fontSize: 15, color: "#0099CC" }}>車両案内</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
color: "#0099CC",
textAlign: "right",
}}
>
宇多津でうずしお号と連結
</Text>
</View>
</View>
<View style={{ flex: 1, flexDirection: "row" }}>
<View
style={{
flex: 1,
backgroundColor: "white",
borderRadius: 10,
padding: 10,
margin: 10,
}}
>
<Text style={{ fontSize: 15, color: "#0099CC" }}>
編成(使用車両2700)
</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
color: "#0099CC",
textAlign: "left",
}}
>
{"[<自][自>][アン自|指>][アン指|G>]"}
</Text>
</View>
</View>
</View>
</ScrollView>
<ScrollView <ScrollView
style={{ maxHeight: heightPercentageToDP("55%") }} style={{ maxHeight: heightPercentageToDP("55%") }}
nestedScrollEnabled nestedScrollEnabled