diff --git a/Apps.js b/Apps.js
index 2e3e09d..a405cb9 100644
--- a/Apps.js
+++ b/Apps.js
@@ -5,6 +5,7 @@ import {
Text,
TouchableOpacity,
useWindowDimensions,
+ LayoutAnimation,
} from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
@@ -19,6 +20,7 @@ import { useFavoriteStation } from "./stateBox/useFavoriteStation";
import { useCurrentTrain } from "./stateBox/useCurrentTrain";
import { SheetManager } from "react-native-actions-sheet";
import TrainMenu from "./components/trainMenu";
+import { EachTrainInfoCore } from "./components/ActionSheetComponents/EachTrainInfoCore";
/*
import StatusbarDetect from './StatusbarDetect';
var Status = StatusbarDetect(); */
@@ -186,6 +188,7 @@ export default function Apps({ navigation, webview, stationData }) {
case "ShowTrainTimeInfo": {
const { trainNum, limited } = dataSet;
//alert(trainNum, limited);
+ LayoutAnimation.easeInEaseOut();
setTrainInfo({
trainNum,
limited,
@@ -193,6 +196,7 @@ export default function Apps({ navigation, webview, stationData }) {
currentTrain.filter((a) => a.num == trainNum)
),
}); //遅延情報は未実装
+ if (isLandscape) return;
const payload = {
data: {
trainNum,
@@ -294,7 +298,7 @@ export default function Apps({ navigation, webview, stationData }) {
}}
onLayout={handleLayout}
>
- {isLandscape ? (
+ {!trainInfo.trainData && isLandscape ? (
+ {isLandscape && trainInfo.trainData && (
+
+
+
+ )}
{isLandscape || (
navigate("trainMenu", { webview })}
@@ -350,9 +373,23 @@ export default function Apps({ navigation, webview, stationData }) {
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
/>
)}
+ {isLandscape && trainInfo.trainData && (
+ {
+ LayoutAnimation.easeInEaseOut();
+ setTrainInfo({
+ trainNum: undefined,
+ limited: undefined,
+ trainData: undefined,
+ });
+ }}
+ top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
+ />
+ )}
webview.current.reload()}
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
+ right={isLandscape && trainInfo.trainData ? (width / 100) * 40 : 0}
LoadError={LoadError}
/>
@@ -395,12 +432,54 @@ const MapsButton = ({ onPress, top, mapSwitch }) => {
);
};
-const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => {
+const LandscapeBackButton = ({ onPress, top }) => {
const styles = {
touch: {
position: "absolute",
top,
- right: 10,
+ left: 10,
+ width: 50,
+ height: 50,
+ backgroundColor: "#0099CC",
+ borderColor: "white",
+ borderStyle: "solid",
+ borderWidth: 1,
+ borderRadius: 50,
+ alignContent: "center",
+ alignSelf: "center",
+ alignItems: "center",
+ display: "flex",
+ },
+ text: {
+ textAlign: "center",
+ width: "auto",
+ height: "auto",
+ textAlignVertical: "center",
+ fontWeight: "bold",
+ color: "white",
+ },
+ };
+ return (
+
+
+
+
+
+ );
+};
+
+const ReloadButton = ({
+ onPress,
+ top,
+ mapSwitch,
+ LoadError = false,
+ right,
+}) => {
+ const styles = {
+ touch: {
+ position: "absolute",
+ top,
+ right: 10 + right,
width: 50,
height: 50,
backgroundColor: LoadError ? "red" : "#0099CC",
diff --git a/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js b/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js
index 6ac2eb7..e8a229e 100644
--- a/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js
+++ b/components/ActionSheetComponents/EachTrainInfo/TrainDataView.js
@@ -35,7 +35,7 @@ export const TrainDataView = ({
flexDirection: "row",
//minHeight: 200,
//height: heightPercentageToDP("20%"),
- width: isLandscape ? width / 2 : width,
+ width: isLandscape ? (width / 100) * 40 : width,
flex: 1,
}}
>
diff --git a/components/ActionSheetComponents/EachTrainInfoCore.js b/components/ActionSheetComponents/EachTrainInfoCore.js
index f20b8b6..029a48a 100644
--- a/components/ActionSheetComponents/EachTrainInfoCore.js
+++ b/components/ActionSheetComponents/EachTrainInfoCore.js
@@ -52,7 +52,7 @@ export const EachTrainInfoCore = ({
currentTrain.filter((d) => d.num == data.trainNum)
)
);
- }, [currentTrain]);
+ }, [currentTrain, data.trainNum]);
//bconst insets = useSafeAreaInsets();
@@ -232,7 +232,9 @@ export const EachTrainInfoCore = ({
setNearTrainIDList(returnArray);
setShowNearTrain(TDArray);
}, [data]);
- const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef);
+ const scrollHandlers = actionSheetRef
+ ? useScrollHandlers("scrollview-1", actionSheetRef)
+ : null;
const migrateTrainName = (string) => {
return string
.replace("マリン", "マリンライナー")
@@ -401,18 +403,20 @@ export const EachTrainInfoCore = ({
borderWidth: 1,
}}
>
-
-
-
+ {isLandscape || (
+
+
+
+ )}
{data.limited
@@ -450,7 +454,8 @@ export const EachTrainInfoCore = ({
/>
)}
- {isLandscape ? (
+ {/* {isLandscape */}
+ {false ? (