メニューデフォルト表示に変更
This commit is contained in:
parent
59e2ea32d8
commit
6a15decadd
2
App.js
2
App.js
@ -63,6 +63,8 @@ export function AppContainer() {
|
|||||||
<NavigationContainer name="Root" style={{ flex: 1 }} ref={navigationRef}>
|
<NavigationContainer name="Root" style={{ flex: 1 }} ref={navigationRef}>
|
||||||
<Tab.Navigator
|
<Tab.Navigator
|
||||||
tabBarOptions={{ keyboardHidesTabBar: Platform.OS === "android" }}
|
tabBarOptions={{ keyboardHidesTabBar: Platform.OS === "android" }}
|
||||||
|
initialRouteName="menuPage"
|
||||||
|
lazy={false}
|
||||||
>
|
>
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
name="login"
|
name="login"
|
||||||
|
@ -17,7 +17,7 @@ export const TrainDataView = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { width, height } = useWindowDimensions();
|
const { width, height } = useWindowDimensions();
|
||||||
const { isLandscape } = useDeviceOrientationChange();
|
const { isLandscape } = useDeviceOrientationChange();
|
||||||
const { webview, getCurrentTrain } = useCurrentTrain();
|
const { webview, getCurrentTrain, inject } = useCurrentTrain();
|
||||||
const [mapsStationData, setMapsStationData] = useState(undefined);
|
const [mapsStationData, setMapsStationData] = useState(undefined);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getStationList2().then(setMapsStationData);
|
getStationList2().then(setMapsStationData);
|
||||||
@ -51,10 +51,10 @@ export const TrainDataView = ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!test.length) return;
|
if (!test.length) return;
|
||||||
webview.current?.injectJavaScript(
|
navigate("Apps");
|
||||||
|
inject(
|
||||||
`MoveDisplayStation('${test[0].line}_${test[0].station.MyStation}_${test[0].station.Station_JP}');setStrings();`
|
`MoveDisplayStation('${test[0].line}_${test[0].station.MyStation}_${test[0].station.Station_JP}');setStrings();`
|
||||||
);
|
);
|
||||||
navigate("Apps");
|
|
||||||
SheetManager.hide("EachTrainInfo");
|
SheetManager.hide("EachTrainInfo");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -235,12 +235,17 @@ export const EachTrainInfoCore = ({
|
|||||||
} else {
|
} else {
|
||||||
SheetManager.hide("EachTrainInfo").then(() => {
|
SheetManager.hide("EachTrainInfo").then(() => {
|
||||||
//0.1秒待機してから開く
|
//0.1秒待機してから開く
|
||||||
setTimeout(() => {
|
setTimeout(() => SheetManager.show("EachTrainInfo", { payload }), 2);
|
||||||
SheetManager.show("EachTrainInfo", { payload });
|
|
||||||
}, 2);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const headerItem = {
|
||||||
|
currentTrainData,
|
||||||
|
currentPosition,
|
||||||
|
nearTrainIDList,
|
||||||
|
openTrainInfo,
|
||||||
|
navigate,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
@ -303,24 +308,8 @@ export const EachTrainInfoCore = ({
|
|||||||
maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
|
maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
shortHeader={
|
shortHeader={<ShortHeader {...headerItem} />}
|
||||||
<ShortHeader
|
longHeader={<LongHeader {...headerItem} />}
|
||||||
currentTrainData={currentTrainData}
|
|
||||||
currentPosition={currentPosition}
|
|
||||||
nearTrainIDList={nearTrainIDList}
|
|
||||||
openTrainInfo={openTrainInfo}
|
|
||||||
navigate={navigate}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
longHeader={
|
|
||||||
<LongHeader
|
|
||||||
currentTrainData={currentTrainData}
|
|
||||||
currentPosition={currentPosition}
|
|
||||||
nearTrainIDList={nearTrainIDList}
|
|
||||||
openTrainInfo={openTrainInfo}
|
|
||||||
navigate={navigate}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
topStickyContent={
|
topStickyContent={
|
||||||
<ScrollStickyContent currentTrainData={currentTrainData} />
|
<ScrollStickyContent currentTrainData={currentTrainData} />
|
||||||
}
|
}
|
||||||
@ -376,11 +365,11 @@ export const EachTrainInfoCore = ({
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
{tailStation.length != 0 &&
|
{tailStation.length != 0 &&
|
||||||
tailStation.map((i, index) =>
|
tailStation.map(({ station, dia }, index) =>
|
||||||
showTailStation.findIndex((d) => d == index) == -1 ? (
|
showTailStation.findIndex((d) => d == index) == -1 ? (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
const array = openBackTrainInfo(i.station, trainData, i.dia);
|
const array = openBackTrainInfo(station, trainData, dia);
|
||||||
|
|
||||||
if (!array) return;
|
if (!array) return;
|
||||||
setTrainData(array);
|
setTrainData(array);
|
||||||
|
@ -38,7 +38,7 @@ export const CurrentTrainProvider = ({ children }) => {
|
|||||||
setCurrentTrainLoading("success");
|
setCurrentTrainLoading("success");
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
alert("現在の全在線列車取得エラー/再取得します");
|
//alert("現在の全在線列車取得エラー/再取得します");
|
||||||
fetch(
|
fetch(
|
||||||
"https://script.google.com/macros/s/AKfycby9Y2-Bm75J_WkbZimi7iS8v5r9wMa9wtzpdwES9sOGF4i6HIYEJOM60W6gM1gXzt1o/exec",
|
"https://script.google.com/macros/s/AKfycby9Y2-Bm75J_WkbZimi7iS8v5r9wMa9wtzpdwES9sOGF4i6HIYEJOM60W6gM1gXzt1o/exec",
|
||||||
HeaderConfig
|
HeaderConfig
|
||||||
@ -57,6 +57,9 @@ export const CurrentTrainProvider = ({ children }) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const inject = (i) => {
|
||||||
|
webview.current?.injectJavaScript(i);
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(getCurrentTrain, []); //初回だけ現在の全在線列車取得
|
useEffect(getCurrentTrain, []); //初回だけ現在の全在線列車取得
|
||||||
|
|
||||||
@ -72,6 +75,7 @@ export const CurrentTrainProvider = ({ children }) => {
|
|||||||
currentTrainLoading,
|
currentTrainLoading,
|
||||||
setCurrentTrainLoading,
|
setCurrentTrainLoading,
|
||||||
getCurrentTrain,
|
getCurrentTrain,
|
||||||
|
inject,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
Loading…
Reference in New Issue
Block a user