差分調整
This commit is contained in:
parent
a3e8acdf20
commit
1fbbc37557
@ -2,9 +2,8 @@ import React, { useRef } from "react";
|
|||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
import ActionSheet from "react-native-actions-sheet";
|
import ActionSheet from "react-native-actions-sheet";
|
||||||
import { EachTrainInfoCore } from "./EachTrainInfoCore";
|
import { EachTrainInfoCore } from "./EachTrainInfoCore";
|
||||||
export const EachTrainInfo = (props) => {
|
export const EachTrainInfo = ({ payload }) => {
|
||||||
if (!props.payload) return <></>;
|
if (!payload) return <></>;
|
||||||
|
|
||||||
const actionSheetRef = useRef(null);
|
const actionSheetRef = useRef(null);
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
@ -17,7 +16,7 @@ export const EachTrainInfo = (props) => {
|
|||||||
|
|
||||||
//useBottomSafeAreaPadding={Platform.OS == "android"}
|
//useBottomSafeAreaPadding={Platform.OS == "android"}
|
||||||
>
|
>
|
||||||
<EachTrainInfoCore {...{ actionSheetRef, ...props.payload }} />
|
<EachTrainInfoCore {...{ actionSheetRef, ...payload }} />
|
||||||
</ActionSheet>
|
</ActionSheet>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -92,7 +92,7 @@ export const EachTrainInfoCore = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 使用例
|
// 使用例
|
||||||
const stopStationIDList = trainData.map((i, index) => {
|
const stopStationIDList = trainData.map((i) => {
|
||||||
const [station, se, time] = i.split(",");
|
const [station, se, time] = i.split(",");
|
||||||
const Stations = stationList.map((a) =>
|
const Stations = stationList.map((a) =>
|
||||||
a.filter((d) => d.StationName == station)
|
a.filter((d) => d.StationName == station)
|
||||||
@ -133,7 +133,7 @@ export const EachTrainInfoCore = ({
|
|||||||
}
|
}
|
||||||
}, [data.limited, trainData]);
|
}, [data.limited, trainData]);
|
||||||
|
|
||||||
const { height, width } = useWindowDimensions();
|
const { height } = useWindowDimensions();
|
||||||
const { isLandscape } = useDeviceOrientationChange();
|
const { isLandscape } = useDeviceOrientationChange();
|
||||||
|
|
||||||
const [trueTrainID, setTrueTrainID] = useState();
|
const [trueTrainID, setTrueTrainID] = useState();
|
||||||
@ -218,7 +218,7 @@ export const EachTrainInfoCore = ({
|
|||||||
.then((d) => {
|
.then((d) => {
|
||||||
if (d) setTrainPositionSwitch(d);
|
if (d) setTrainPositionSwitch(d);
|
||||||
})
|
})
|
||||||
.catch((d) => AS.setItem("trainPositionSwitch", "false"));
|
.catch(() => AS.setItem("trainPositionSwitch", "false"));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const openTrainInfo = (d) => {
|
const openTrainInfo = (d) => {
|
||||||
@ -239,7 +239,7 @@ export const EachTrainInfoCore = ({
|
|||||||
navigate,
|
navigate,
|
||||||
from: from == "LED" ? "LED2" : "NearTrainDiagramView",
|
from: from == "LED" ? "LED2" : "NearTrainDiagramView",
|
||||||
};
|
};
|
||||||
if (setTrainInfo) {
|
if (isLandscape) {
|
||||||
setTrainInfo(payload.data);
|
setTrainInfo(payload.data);
|
||||||
} else {
|
} else {
|
||||||
SheetManager.hide("EachTrainInfo").then(() => {
|
SheetManager.hide("EachTrainInfo").then(() => {
|
||||||
|
@ -1,42 +1,26 @@
|
|||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
import {
|
import {
|
||||||
View,
|
View,
|
||||||
LayoutAnimation,
|
|
||||||
ScrollView,
|
|
||||||
Linking,
|
|
||||||
Text,
|
Text,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
Platform,
|
Platform,
|
||||||
BackHandler,
|
BackHandler,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
import ActionSheet, { SheetManager } from "react-native-actions-sheet";
|
||||||
import ActionSheet, {
|
|
||||||
SheetManager,
|
|
||||||
useScrollHandlers,
|
|
||||||
} from "react-native-actions-sheet";
|
|
||||||
import LottieView from "lottie-react-native";
|
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import ViewShot from "react-native-view-shot";
|
|
||||||
import * as Sharing from "expo-sharing";
|
|
||||||
import { useTrainDelayData } from "../../stateBox/useTrainDelayData";
|
|
||||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||||
import lineColorList from "../../assets/originData/lineColorList";
|
import lineColorList from "../../assets/originData/lineColorList";
|
||||||
import { stationIDPair } from "../../lib/getStationList2";
|
import { stationIDPair } from "../../lib/getStationList2";
|
||||||
import { lineListPair } from "../../lib/getStationList";
|
import { lineListPair } from "../../lib/getStationList";
|
||||||
|
|
||||||
export const TrainMenuLineSelector = () => {
|
export const TrainMenuLineSelector = () => {
|
||||||
const { getTime, delayData, loadingDelayData, setLoadingDelayData } =
|
|
||||||
useTrainDelayData();
|
|
||||||
const {
|
const {
|
||||||
selectedLine,
|
selectedLine,
|
||||||
setSelectedLine,
|
setSelectedLine,
|
||||||
mapsStationData: stationData,
|
mapsStationData: stationData,
|
||||||
setMapsStationData,
|
|
||||||
} = useTrainMenu();
|
} = useTrainMenu();
|
||||||
const actionSheetRef = useRef(null);
|
const actionSheetRef = useRef(null);
|
||||||
const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef);
|
|
||||||
const insets = useSafeAreaInsets();
|
const insets = useSafeAreaInsets();
|
||||||
const viewShot = useRef(null);
|
|
||||||
const platformIs = Platform.OS == "android";
|
const platformIs = Platform.OS == "android";
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
|
@ -233,8 +233,6 @@ export default function LED_vision(props) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const EachData = (props) => {
|
const EachData = (props) => {
|
||||||
const {
|
const {
|
||||||
d,
|
d,
|
||||||
|
@ -16,9 +16,9 @@ import { useStationList } from "../../stateBox/useStationList";
|
|||||||
|
|
||||||
export default function Sign(props) {
|
export default function Sign(props) {
|
||||||
const { currentStation, oP, oLP, isCurrentStation = false } = props;
|
const { currentStation, oP, oLP, isCurrentStation = false } = props;
|
||||||
const { originalStationList } = useStationList();
|
|
||||||
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
||||||
const [nexPrePosition, setNexPrePosition] = useState(0);
|
const [nexPrePosition, setNexPrePosition] = useState(0);
|
||||||
|
const { originalStationList } = useStationList();
|
||||||
|
|
||||||
const [preStation, setPreStation] = useState();
|
const [preStation, setPreStation] = useState();
|
||||||
const [nexStation, setNexStation] = useState();
|
const [nexStation, setNexStation] = useState();
|
||||||
|
Loading…
Reference in New Issue
Block a user