各種調整

This commit is contained in:
harukin-expo-dev-env
2025-09-19 04:34:26 +00:00
parent 85fd66b728
commit c8119e2373
3 changed files with 50 additions and 25 deletions

View File

@@ -230,6 +230,7 @@ export const FixedStation: FC<props> = ({
alignItems: "center",
backgroundColor: lineColor,
paddingHorizontal: 5,
height: 26,
}}
>
<Ionicons name="lock-closed" size={15} color="white" />
@@ -253,11 +254,11 @@ export const FixedStation: FC<props> = ({
borderTopColor: lineColor,
borderBottomColor: "#0000",
borderRightColor: "#0000",
borderBottomWidth: 22,
borderBottomWidth: 26,
borderLeftWidth: 10,
borderRightWidth: 0,
borderTopWidth: 0,
height: 20,
height: 26,
}}
/>
</TouchableOpacity>
@@ -270,7 +271,10 @@ export const FixedStation: FC<props> = ({
alignItems: "center",
}}
onPress={() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
LayoutAnimation.configureNext({
duration: 500,
update: { type: "spring", springDamping: 0.7 },
});
if (displaySize === 50) {
setDisplaySize(200);
} else {
@@ -286,11 +290,11 @@ export const FixedStation: FC<props> = ({
borderTopColor: lineColor,
borderBottomColor: "#0000",
borderRightColor: lineColor,
borderBottomWidth: 22,
borderBottomWidth: 26,
borderLeftWidth: 0,
borderRightWidth: 10,
borderTopWidth: 0,
height: 20,
height: 26,
}}
/>
<View
@@ -299,6 +303,7 @@ export const FixedStation: FC<props> = ({
alignItems: "center",
backgroundColor: lineColor,
paddingHorizontal: 5,
height: 26,
}}
pointerEvents="none"
>

View File

@@ -10,6 +10,7 @@ import {
View,
Image,
LayoutAnimation,
ScrollView,
} from "react-native";
import { getTrainType } from "@/lib/getTrainType";
import { trainPosition } from "@/lib/trainPositionTextArray";
@@ -216,8 +217,13 @@ export const FixedTrain: FC<props> = ({
type: customData.type,
whiteMode: true,
});
const trainNameText = `${customData.trainName}${
customData.trainNumDistance !== null
? ` ${parseInt(customData.TrainNumber) - customData.trainNumDistance}`
: ""
}`;
return (
<TouchableOpacity
<View
style={{
flex: 1,
flexDirection: displaySize === 50 ? "row" : "column",
@@ -226,10 +232,6 @@ export const FixedTrain: FC<props> = ({
borderBottomWidth: 2,
position: "relative",
}}
activeOpacity={1}
onPress={() => {
//setFixedPosition({ type: null, value: null });
}}
>
<View
style={{
@@ -255,8 +257,8 @@ export const FixedTrain: FC<props> = ({
>
<Image
source={{ uri: customData.img }}
width={displaySize === 50 ? 14 : 22}
height={displaySize === 50 ? 17 : 25}
width={displaySize === 50 ? 14 : 23}
height={displaySize === 50 ? 17 : 26}
style={{ margin: 5 }}
/>
<View
@@ -264,6 +266,8 @@ export const FixedTrain: FC<props> = ({
flexDirection: displaySize === 50 ? "row" : "column",
alignContent: "center",
alignSelf: "center",
alignItems: "center",
maxWidth: displaySize === 50 ? 100 : 60,
}}
>
<Text
@@ -286,13 +290,13 @@ export const FixedTrain: FC<props> = ({
{customData.trainName && (
<Text
style={{
fontSize: customData?.trainName?.length > 6 ? 9 : 14,
fontSize: trainNameText.length > 6 ? 8 : 14,
color: "white",
maxWidth: displaySize === 50 ? 65 : 200,
maxWidth: displaySize === 50 ? 60 : 200,
textAlignVertical: "center",
}}
>
{customData.trainName}
{trainNameText}
</Text>
)}
</View>
@@ -332,12 +336,12 @@ export const FixedTrain: FC<props> = ({
>
<StationNumberMaker
currentStation={station}
singleSize={20}
singleSize={18}
useEach={true}
/>
<Text
style={{
fontSize: 12,
fontSize: customData?.ToData?.length > 4 ? 9 : 12,
color: "white",
fontWeight: "bold",
textAlignVertical: "center",
@@ -536,7 +540,7 @@ export const FixedTrain: FC<props> = ({
</Text>
</View>
</TouchableOpacity>
</TouchableOpacity>
</View>
);
};
@@ -603,7 +607,11 @@ const CurrentPositionBox = ({
></View>
</View>
)}
<View style={{ flex: 1, flexDirection: "row", overflow: "hidden" }}>
<ScrollView
style={{ flex: 1, flexDirection: "row" }}
horizontal
overScrollMode="always"
>
{trainDataWithThrough.length > 0 &&
trainDataWithThrough.map((d, index, array) => {
if (!d) return null;
@@ -612,10 +620,16 @@ const CurrentPositionBox = ({
let distanceMinute = 0;
if (time != "") {
const now = dayjs();
const hour = parseInt(time.split(":")[0]);
const distanceTime = now
.hour(time.split(":")[0])
.hour(hour < 4 ? hour + 24 : hour)
.minute(time.split(":")[1]);
distanceMinute = distanceTime.diff(now, "minute") + delayTime;
if (now.hour() < 4) {
if (hour < 4) {
distanceMinute = distanceMinute - 1440;
}
}
}
return (
<>
@@ -654,7 +668,7 @@ const CurrentPositionBox = ({
(time != "" && (
<Text
style={{
fontSize: isSmall ? 8 : 14,
fontSize: isSmall ? 8 : 12,
color: "black",
backgroundColor: "white",
fontWeight: "bold",
@@ -666,8 +680,14 @@ const CurrentPositionBox = ({
<Text
style={{
fontSize: isSmall ? 8 : 14,
color: se.includes("通") ? "#020202ff" : "white",
color: se.includes("通")
? "#020202ff"
: index == 1 && secondText == ""
? "#ffe852ff"
: "white",
marginTop: isSmall ? 0 : 3,
height: isSmall ? "auto" : 17,
fontWeight: "bold",
}}
>
{se.includes("通")
@@ -702,7 +722,7 @@ const CurrentPositionBox = ({
</>
);
})}
</View>
</ScrollView>
</View>
);
};

View File

@@ -13,8 +13,8 @@ export const getCurrentTrainData = (
case "OneMan":
const currentTrainData = currentTrain.filter((a) => a.num == trainNum);
if (currentTrainData.length == 0) return customTrainData;
else if (currentTrainData[0].Type.includes("rapid:")) {
const typeText = currentTrainData[0].Type.split(":");
else if (currentTrainData[0].Type?.includes("rapid:")) {
const typeText = currentTrainData[0].Type?.split(":");
const returnData = {
type: "Rapid" as trainTypeID,
trainName: typeText[1].replace("\r", ""),