Merge commit 'ba65389596851e99fe0a3f4fad95b4fd6ea0448c' into develop

This commit is contained in:
harukin-expo-dev-env
2025-09-23 17:58:35 +00:00
3 changed files with 497 additions and 476 deletions

View File

@@ -1,5 +1,6 @@
import { useCurrentTrain } from "@/stateBox/useCurrentTrain"; import { useCurrentTrain } from "@/stateBox/useCurrentTrain";
import { View, Platform } from "react-native"; import { View, Platform } from "react-native";
import { useKeepAwake } from "expo-keep-awake";
import Constants from "expo-constants"; import Constants from "expo-constants";
import { FixedTrain } from "./FixedPositionBox/FixedTrainBox"; import { FixedTrain } from "./FixedPositionBox/FixedTrainBox";
import { FixedStation } from "./FixedPositionBox/FixedStationBox"; import { FixedStation } from "./FixedPositionBox/FixedStationBox";
@@ -7,8 +8,9 @@ import { useState } from "react";
export const FixedPositionBox = () => { export const FixedPositionBox = () => {
const { fixedPosition, setFixedPosition } = useCurrentTrain(); const { fixedPosition, setFixedPosition } = useCurrentTrain();
const [displaySize, setDisplaySize] = useState(50); const [displaySize, setDisplaySize] = useState(76);
useKeepAwake();
return ( return (
<View <View
style={{ style={{
@@ -20,6 +22,7 @@ export const FixedPositionBox = () => {
height: displaySize, height: displaySize,
flexDirection: "row", flexDirection: "row",
}} }}
pointerEvents="box-none"
> >
{fixedPosition.type === "station" && ( {fixedPosition.type === "station" && (
<FixedStation <FixedStation

View File

@@ -97,6 +97,10 @@ export const FixedStation: FC<props> = ({
}, [trainTimeAndNumber, currentTrain /*finalSwitch*/]); }, [trainTimeAndNumber, currentTrain /*finalSwitch*/]);
return ( return (
<View
style={{ display: "flex", flexDirection: "column", flex: 1 }}
pointerEvents="box-none"
>
<TouchableOpacity <TouchableOpacity
style={{ style={{
flex: 1, flex: 1,
@@ -212,11 +216,18 @@ export const FixedStation: FC<props> = ({
</View> </View>
)} )}
</View> </View>
</TouchableOpacity>
<View
style={{
flexDirection: "row",
justifyContent: "space-between",
borderTopColor: lineColor,
borderTopWidth: 2,
}}
pointerEvents="box-none"
>
<TouchableOpacity <TouchableOpacity
style={{ style={{
position: "absolute",
top: "100%",
left: 0,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
}} }}
@@ -264,9 +275,6 @@ export const FixedStation: FC<props> = ({
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
style={{ style={{
position: "absolute",
top: "100%",
right: 0,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
}} }}
@@ -275,10 +283,10 @@ export const FixedStation: FC<props> = ({
duration: 500, duration: 500,
update: { type: "spring", springDamping: 0.7 }, update: { type: "spring", springDamping: 0.7 },
}); });
if (displaySize === 50) { if (displaySize === 76) {
setDisplaySize(200); setDisplaySize(226);
} else { } else {
setDisplaySize(50); setDisplaySize(76);
} }
}} }}
> >
@@ -308,7 +316,7 @@ export const FixedStation: FC<props> = ({
pointerEvents="none" pointerEvents="none"
> >
<Ionicons <Ionicons
name={displaySize == 50 ? "chevron-down" : "chevron-up"} name={displaySize == 76 ? "chevron-down" : "chevron-up"}
size={15} size={15}
color="white" color="white"
/> />
@@ -320,11 +328,12 @@ export const FixedStation: FC<props> = ({
fontSize: 15, fontSize: 15,
}} }}
> >
{displaySize == 50 ? "時刻表を展開する" : "時刻表を縮小する"} {displaySize == 76 ? "時刻表を展開する" : "時刻表を縮小する"}
</Text> </Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</TouchableOpacity> </View>
</View>
); );
}; };
@@ -353,7 +362,7 @@ const FixedStationBoxEachTrain = ({ d, station, displaySize }) => {
style={{ style={{
backgroundColor: "white", backgroundColor: "white",
flexDirection: "row", flexDirection: "row",
height: displaySize == 50 ? "33%" : "7.5%", height: displaySize == 76 ? "33%" : "7.5%",
overflow: "visible", overflow: "visible",
}} }}
> >

View File

@@ -214,27 +214,30 @@ export const FixedTrain: FC<props> = ({
: "" : ""
}`; }`;
return ( return (
<View
style={{ display: "flex", flexDirection: "column", flex: 1 }}
pointerEvents="box-none"
>
<View <View
style={{ style={{
flex: 1, flex: 1,
flexDirection: displaySize === 50 ? "row" : "column", flexDirection: displaySize === 76 ? "row" : "column",
backgroundColor: "black", backgroundColor: "black",
borderBottomColor: "black", //borderBottomColor: "black",
borderBottomWidth: 2, //borderBottomWidth: 2,
position: "relative",
}} }}
> >
<View <View
style={{ style={{
flexDirection: displaySize === 50 ? "column" : "row", flexDirection: displaySize === 76 ? "column" : "row",
flex: 1, flex: 1,
backgroundColor: "white", backgroundColor: "white",
height: displaySize === 50 ? 50 : 200, height: displaySize === 76 ? 50 : 200,
overflow: "hidden", overflow: "hidden",
}} }}
> >
<View <View
style={{ flex: displaySize === 50 ? 1 : 5, flexDirection: "row" }} style={{ flex: displaySize === 76 ? 1 : 5, flexDirection: "row" }}
> >
<View <View
style={{ style={{
@@ -248,17 +251,17 @@ export const FixedTrain: FC<props> = ({
> >
<Image <Image
source={{ uri: customData.img }} source={{ uri: customData.img }}
width={displaySize === 50 ? 14 : 23} width={displaySize === 76 ? 14 : 23}
height={displaySize === 50 ? 17 : 26} height={displaySize === 76 ? 17 : 26}
style={{ margin: 5 }} style={{ margin: 5 }}
/> />
<View <View
style={{ style={{
flexDirection: displaySize === 50 ? "row" : "column", flexDirection: displaySize === 76 ? "row" : "column",
alignContent: "center", alignContent: "center",
alignSelf: "center", alignSelf: "center",
alignItems: "center", alignItems: "center",
maxWidth: displaySize === 50 ? 100 : 60, maxWidth: displaySize === 76 ? 100 : 60,
}} }}
> >
<Text <Text
@@ -283,7 +286,7 @@ export const FixedTrain: FC<props> = ({
style={{ style={{
fontSize: trainNameText.length > 6 ? 8 : 14, fontSize: trainNameText.length > 6 ? 8 : 14,
color: "white", color: "white",
maxWidth: displaySize === 50 ? 60 : 200, maxWidth: displaySize === 76 ? 60 : 200,
textAlignVertical: "center", textAlignVertical: "center",
}} }}
> >
@@ -298,11 +301,11 @@ export const FixedTrain: FC<props> = ({
borderLeftColor: customTrainType.color, borderLeftColor: customTrainType.color,
borderTopColor: lineColor, borderTopColor: lineColor,
borderBottomColor: lineColor, borderBottomColor: lineColor,
borderTopWidth: displaySize === 50 ? 14 : 50, borderTopWidth: displaySize === 76 ? 14 : 50,
borderBottomWidth: displaySize === 50 ? 14 : 50, borderBottomWidth: displaySize === 76 ? 14 : 50,
borderLeftWidth: displaySize === 50 ? 10 : 30, borderLeftWidth: displaySize === 76 ? 10 : 30,
borderRightWidth: 0, borderRightWidth: 0,
//height: displaySize === 50 ? 20 : 100, //height: displaySize === 76 ? 20 : 100,
height: "100%", height: "100%",
}} }}
></View> ></View>
@@ -346,7 +349,7 @@ export const FixedTrain: FC<props> = ({
</View> </View>
</View> </View>
</View> </View>
{displaySize === 200 && ( {displaySize === 226 && (
<View <View
style={{ style={{
backgroundColor: "white", backgroundColor: "white",
@@ -365,7 +368,7 @@ export const FixedTrain: FC<props> = ({
<View <View
style={{ style={{
backgroundColor: "black", backgroundColor: "black",
flex: displaySize === 50 ? 1 : 4, flex: displaySize === 76 ? 1 : 4,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
}} }}
@@ -378,7 +381,9 @@ export const FixedTrain: FC<props> = ({
marginHorizontal: 5, marginHorizontal: 5,
}} }}
> >
{nextStationData[0]?.Station_JP == train?.Pos ? "ただいま" : "次は"} {nextStationData[0]?.Station_JP == train?.Pos
? "ただいま"
: "次は"}
</Text> </Text>
<StationNumberMaker <StationNumberMaker
currentStation={nextStationData} currentStation={nextStationData}
@@ -395,7 +400,7 @@ export const FixedTrain: FC<props> = ({
> >
{nextStationData[0]?.Station_JP || "不明"} {nextStationData[0]?.Station_JP || "不明"}
</Text> </Text>
{displaySize === 50 && ( {displaySize === 76 && (
<View <View
style={{ style={{
backgroundColor: "white", backgroundColor: "white",
@@ -417,13 +422,20 @@ export const FixedTrain: FC<props> = ({
train={train} train={train}
lineColor={lineColor} lineColor={lineColor}
trainDataWithThrough={untilStationData} trainDataWithThrough={untilStationData}
isSmall={displaySize === 50} isSmall={displaySize === 76}
/> />
</View>
<View
style={{
flexDirection: "row",
justifyContent: "space-between",
borderTopColor: "black",
borderTopWidth: 2,
}}
pointerEvents="box-none"
>
<TouchableOpacity <TouchableOpacity
style={{ style={{
position: "absolute",
top: "100%",
left: 0,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
}} }}
@@ -471,21 +483,18 @@ export const FixedTrain: FC<props> = ({
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity <TouchableOpacity
style={{ style={{
position: "absolute",
top: "100%",
right: 0,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
}} }}
onPress={() => { onPress={() => {
LayoutAnimation.configureNext({ LayoutAnimation.configureNext({
duration: 500, duration: 200,
update: { type: "spring", springDamping: 0.7 }, update: { type: "easeInEaseOut", springDamping: 0.4 },
}); });
if (displaySize === 50) { if (displaySize === 76) {
setDisplaySize(200); setDisplaySize(226);
} else { } else {
setDisplaySize(50); setDisplaySize(76);
} }
}} }}
> >
@@ -512,10 +521,9 @@ export const FixedTrain: FC<props> = ({
paddingHorizontal: 5, paddingHorizontal: 5,
height: 26, height: 26,
}} }}
pointerEvents="none"
> >
<Ionicons <Ionicons
name={displaySize == 50 ? "chevron-down" : "chevron-up"} name={displaySize == 76 ? "chevron-down" : "chevron-up"}
size={15} size={15}
color="white" color="white"
/> />
@@ -527,11 +535,12 @@ export const FixedTrain: FC<props> = ({
fontSize: 15, fontSize: 15,
}} }}
> >
{displaySize == 50 ? "列車情報展開" : "列車情報縮小"} {displaySize == 76 ? "列車情報展開" : "列車情報縮小"}
</Text> </Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View>
); );
}; };