Merge commit 'a83bb27f60029c7cc14977a4088e251f1c9a7659' into develop
This commit is contained in:
commit
1622cd2ab8
9
App.js
9
App.js
@ -194,7 +194,6 @@ const Top = ({
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="howto"
|
name="howto"
|
||||||
options={{
|
options={{
|
||||||
title: "使い方",
|
|
||||||
...optionData,
|
...optionData,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -284,6 +283,14 @@ function MenuPage({
|
|||||||
>
|
>
|
||||||
{(props) => <TrainBase {...props} />}
|
{(props) => <TrainBase {...props} />}
|
||||||
</Stack.Screen>
|
</Stack.Screen>
|
||||||
|
<Stack.Screen
|
||||||
|
name="howto"
|
||||||
|
options={{
|
||||||
|
...optionData,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{(props) => <HowTo {...props} />}
|
||||||
|
</Stack.Screen>
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
7
Apps.js
7
Apps.js
@ -148,7 +148,7 @@ export default function Apps({
|
|||||||
urlcache = event.url;
|
urlcache = event.url;
|
||||||
|
|
||||||
if (event.url.includes("https://train.jr-shikoku.co.jp/usage.htm")) {
|
if (event.url.includes("https://train.jr-shikoku.co.jp/usage.htm")) {
|
||||||
if (Platform.OS === "android") navigate("howto");
|
if (Platform.OS === "android") navigate("howto", { info: event.url });
|
||||||
webview?.current.goBack();
|
webview?.current.goBack();
|
||||||
//Actions.howto();
|
//Actions.howto();
|
||||||
} else if (
|
} else if (
|
||||||
@ -224,6 +224,11 @@ export default function Apps({
|
|||||||
favoriteStation={favoriteStation}
|
favoriteStation={favoriteStation}
|
||||||
setFavoriteStation={setFavoriteStation}
|
setFavoriteStation={setFavoriteStation}
|
||||||
busAndTrainData={busAndTrainData}
|
busAndTrainData={busAndTrainData}
|
||||||
|
navigate={navigate}
|
||||||
|
onExit={() => {
|
||||||
|
StationBoardAcSR.current?.setModalVisible();
|
||||||
|
navigate("Apps");
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
@ -29,6 +29,8 @@ export const StationDeteilView = (props) => {
|
|||||||
favoriteStation,
|
favoriteStation,
|
||||||
setFavoriteStation,
|
setFavoriteStation,
|
||||||
busAndTrainData,
|
busAndTrainData,
|
||||||
|
navigate,
|
||||||
|
onExit,
|
||||||
} = props;
|
} = props;
|
||||||
const [trainBus, setTrainBus] = useState();
|
const [trainBus, setTrainBus] = useState();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -41,7 +43,13 @@ export const StationDeteilView = (props) => {
|
|||||||
}
|
}
|
||||||
setTrainBus(data[0]);
|
setTrainBus(data[0]);
|
||||||
}, [currentStation]);
|
}, [currentStation]);
|
||||||
|
const info =
|
||||||
|
currentStation &&
|
||||||
|
(currentStation[0].StationTimeTable.match(".pdf")
|
||||||
|
? `https://docs.google.com/viewer?url=${encodeURI(
|
||||||
|
currentStation[0].StationTimeTable
|
||||||
|
)}&embedded=true`
|
||||||
|
: currentStation[0].StationTimeTable);
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
ref={StationBoardAcSR}
|
ref={StationBoardAcSR}
|
||||||
@ -82,7 +90,14 @@ export const StationDeteilView = (props) => {
|
|||||||
originalStationList={originalStationList}
|
originalStationList={originalStationList}
|
||||||
favoriteStation={favoriteStation}
|
favoriteStation={favoriteStation}
|
||||||
setFavoriteStation={setFavoriteStation}
|
setFavoriteStation={setFavoriteStation}
|
||||||
oP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
oP={() => {
|
||||||
|
navigate("howto", {
|
||||||
|
info,
|
||||||
|
onExit,
|
||||||
|
});
|
||||||
|
StationBoardAcSR.current?.hide();
|
||||||
|
}}
|
||||||
|
oLP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
@ -99,6 +114,21 @@ export const StationDeteilView = (props) => {
|
|||||||
currentStation[0].JrHpUrl &&
|
currentStation[0].JrHpUrl &&
|
||||||
currentStation[0].StationNumber != "M12" && (
|
currentStation[0].StationNumber != "M12" && (
|
||||||
<駅構内図 //高松/阿波池田&後免&須崎kounai.png児島例外/
|
<駅構内図 //高松/阿波池田&後免&須崎kounai.png児島例外/
|
||||||
|
oP={() => {
|
||||||
|
navigate("howto", {
|
||||||
|
info:
|
||||||
|
currentStation[0].JrHpUrl.replace("/index.html", "/") +
|
||||||
|
"/kounai_map.html",
|
||||||
|
onExit,
|
||||||
|
});
|
||||||
|
StationBoardAcSR.current?.hide();
|
||||||
|
}}
|
||||||
|
oLP={() => {
|
||||||
|
Linking.openURL(
|
||||||
|
currentStation[0].JrHpUrl.replace("/index.html", "/") +
|
||||||
|
"/kounai_map.html"
|
||||||
|
);
|
||||||
|
}}
|
||||||
uri={currentStation[0].JrHpUrl.replace("/index.html", "/")}
|
uri={currentStation[0].JrHpUrl.replace("/index.html", "/")}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@ -109,7 +139,14 @@ export const StationDeteilView = (props) => {
|
|||||||
backgroundColor={"#AD7FA8"}
|
backgroundColor={"#AD7FA8"}
|
||||||
icon={<Foundation name="web" color="white" size={50} />}
|
icon={<Foundation name="web" color="white" size={50} />}
|
||||||
flex={1}
|
flex={1}
|
||||||
onPressButton={() =>
|
onPressButton={() => {
|
||||||
|
navigate("howto", {
|
||||||
|
info: currentStation[0].JrHpUrl,
|
||||||
|
onExit,
|
||||||
|
});
|
||||||
|
StationBoardAcSR.current?.hide();
|
||||||
|
}}
|
||||||
|
onLongPressButton={() =>
|
||||||
Linking.openURL(currentStation[0].JrHpUrl)
|
Linking.openURL(currentStation[0].JrHpUrl)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -121,7 +158,14 @@ export const StationDeteilView = (props) => {
|
|||||||
backgroundColor={"#8F5902"}
|
backgroundColor={"#8F5902"}
|
||||||
icon={<FontAwesome name="table" color="white" size={50} />}
|
icon={<FontAwesome name="table" color="white" size={50} />}
|
||||||
flex={1}
|
flex={1}
|
||||||
onPressButton={() =>
|
onPressButton={() => {
|
||||||
|
navigate("howto", {
|
||||||
|
info,
|
||||||
|
onExit,
|
||||||
|
});
|
||||||
|
StationBoardAcSR.current?.hide();
|
||||||
|
}}
|
||||||
|
onLongPressButton={() =>
|
||||||
Linking.openURL(currentStation[0].StationTimeTable)
|
Linking.openURL(currentStation[0].StationTimeTable)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -145,7 +189,14 @@ export const StationDeteilView = (props) => {
|
|||||||
backgroundColor={"#CE5C00"}
|
backgroundColor={"#CE5C00"}
|
||||||
icon={<Ionicons name="bus" color="white" size={50} />}
|
icon={<Ionicons name="bus" color="white" size={50} />}
|
||||||
flex={1}
|
flex={1}
|
||||||
onPressButton={() => Linking.openURL(trainBus.address)}
|
onPressButton={() => {
|
||||||
|
navigate("howto", {
|
||||||
|
info: trainBus.address,
|
||||||
|
onExit,
|
||||||
|
});
|
||||||
|
StationBoardAcSR.current?.hide();
|
||||||
|
}}
|
||||||
|
onLongPressButton={() => Linking.openURL(trainBus.address)}
|
||||||
>
|
>
|
||||||
並行バス
|
並行バス
|
||||||
</TicketBox>
|
</TicketBox>
|
||||||
@ -312,7 +363,8 @@ const 駅構内図 = (props) => {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
margin: 2,
|
margin: 2,
|
||||||
}}
|
}}
|
||||||
onPress={() => Linking.openURL(props.uri + "/kounai_map.html")}
|
onPress={props.oP}
|
||||||
|
onLongPress={props.oLP}
|
||||||
//onPress={() => setOpen(!open)}
|
//onPress={() => setOpen(!open)}
|
||||||
>
|
>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
import { TouchableOpacity, Text } from "react-native";
|
import { TouchableOpacity, Text } from "react-native";
|
||||||
|
|
||||||
export const TicketBox = (props) => {
|
export const TicketBox = (props) => {
|
||||||
const { icon, backgroundColor, flex, onPressButton, children } = props;
|
const {
|
||||||
|
icon,
|
||||||
|
backgroundColor,
|
||||||
|
flex,
|
||||||
|
onPressButton,
|
||||||
|
children,
|
||||||
|
onLongPressButton,
|
||||||
|
} = props;
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{
|
style={{
|
||||||
@ -14,6 +21,7 @@ export const TicketBox = (props) => {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
onPress={onPressButton}
|
onPress={onPressButton}
|
||||||
|
onLongPress={onLongPressButton}
|
||||||
>
|
>
|
||||||
<Text style={{ color: "white", fontWeight: "bold", fontSize: 18 }}>
|
<Text style={{ color: "white", fontWeight: "bold", fontSize: 18 }}>
|
||||||
{children}
|
{children}
|
||||||
|
@ -58,7 +58,11 @@ export default function TrainMenu({
|
|||||||
backgroundColor={"#F89038"}
|
backgroundColor={"#F89038"}
|
||||||
icon="train-car"
|
icon="train-car"
|
||||||
flex={1}
|
flex={1}
|
||||||
onPressButton={() => navigate("howto")}
|
onPressButton={() =>
|
||||||
|
navigate("howto", {
|
||||||
|
info: "https://train.jr-shikoku.co.jp/usage.htm",
|
||||||
|
})
|
||||||
|
}
|
||||||
>
|
>
|
||||||
使い方
|
使い方
|
||||||
</UsefulBox>
|
</UsefulBox>
|
||||||
|
@ -21,6 +21,7 @@ export default function Sign(props) {
|
|||||||
currentStation,
|
currentStation,
|
||||||
originalStationList,
|
originalStationList,
|
||||||
oP,
|
oP,
|
||||||
|
oLP,
|
||||||
favoriteStation,
|
favoriteStation,
|
||||||
setFavoriteStation,
|
setFavoriteStation,
|
||||||
} = props;
|
} = props;
|
||||||
@ -91,7 +92,7 @@ export default function Sign(props) {
|
|||||||
};
|
};
|
||||||
const lottieRef = useRef();
|
const lottieRef = useRef();
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
<TouchableOpacity style={styleSheet.外枠} onPress={oP} onLongPress={oLP}>
|
||||||
<StationNumberMaker currentStation={currentStation} />
|
<StationNumberMaker currentStation={currentStation} />
|
||||||
<StationNameArea currentStation={currentStation} />
|
<StationNameArea currentStation={currentStation} />
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
15
howto.js
15
howto.js
@ -2,13 +2,13 @@ const WEBVIEW = "WEBVIEW";
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { StatusBar, View, TouchableOpacity, Text } from "react-native";
|
import { StatusBar, View, TouchableOpacity, Text } from "react-native";
|
||||||
import { WebView } from "react-native-webview";
|
import { WebView } from "react-native-webview";
|
||||||
export default ({ navigation: { navigate } }) => (
|
export default ({ navigation: { navigate }, route }) => {
|
||||||
|
const { info, onExit = () => navigate("Apps") } = route.params;
|
||||||
|
|
||||||
|
return (
|
||||||
<View style={styles.View}>
|
<View style={styles.View}>
|
||||||
<WebView
|
<WebView useWebKit source={{ uri: info }} />
|
||||||
useWebKit
|
<TouchableOpacity style={styles.touch} onPress={onExit}>
|
||||||
source={{ uri: "https://train.jr-shikoku.co.jp/usage.htm" }}
|
|
||||||
/>
|
|
||||||
<TouchableOpacity style={styles.touch} onPress={() => navigate("Apps")}>
|
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
||||||
閉じる
|
閉じる
|
||||||
@ -16,7 +16,8 @@ export default ({ navigation: { navigate } }) => (
|
|||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
const styles = {
|
const styles = {
|
||||||
View: { height: "100%", backgroundColor: "#0099CC" },
|
View: { height: "100%", backgroundColor: "#0099CC" },
|
||||||
touch: {
|
touch: {
|
||||||
|
5
menu.js
5
menu.js
@ -218,6 +218,11 @@ export default function Menu(props) {
|
|||||||
favoriteStation={favoriteStation}
|
favoriteStation={favoriteStation}
|
||||||
setFavoriteStation={setFavoriteStation}
|
setFavoriteStation={setFavoriteStation}
|
||||||
busAndTrainData={busAndTrainData}
|
busAndTrainData={busAndTrainData}
|
||||||
|
navigate={navigate}
|
||||||
|
onExit={() => {
|
||||||
|
StationBoardAcSR.current?.setModalVisible();
|
||||||
|
navigate("menu");
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<JRSTraInfo
|
<JRSTraInfo
|
||||||
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
||||||
|
Loading…
Reference in New Issue
Block a user