diff --git a/App.js b/App.js
index ee02b4e..d25b83c 100644
--- a/App.js
+++ b/App.js
@@ -1,57 +1,158 @@
-import React, { useEffect, useRef } from 'react';
-import { NavigationContainer } from '@react-navigation/native';
-import { createStackNavigator,TransitionPresets ,} from '@react-navigation/stack';
-import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
-import { AntDesign, Ionicons } from '@expo/vector-icons';
-import {ToastAndroid, Platform, UIManager,} from 'react-native';
-import { UpdateAsync } from './UpdateAsync.js';
-import Apps from './Apps';
-import tndView from './ndView';
-import trainbase from './trainbaseview';
-import howto from './howto';
-import menu from './menu';
-import News from './components/news.js';
-import TestArea from './TestArea.js';
-import Setting from './components/settings.js';
+import React, { useEffect, useRef } from "react";
+import { NavigationContainer } from "@react-navigation/native";
+import {
+ createStackNavigator,
+ TransitionPresets,
+} from "@react-navigation/stack";
+import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
+import { AntDesign, Ionicons } from "@expo/vector-icons";
+import { ToastAndroid, Platform, UIManager } from "react-native";
+import { UpdateAsync } from "./UpdateAsync.js";
+import Apps from "./Apps";
+import tndView from "./ndView";
+import trainbase from "./trainbaseview";
+import howto from "./howto";
+import menu from "./menu";
+import News from "./components/news.js";
+import TestArea from "./TestArea.js";
+import Setting from "./components/settings.js";
+import trainMenu from "./components/trainMenu.js";
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
-if (Platform.OS === 'android') {
+if (Platform.OS === "android") {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}
-export default function App(){
+export default function App() {
const navigationRef = useRef();
var platform = Platform.OS === "android" ? 70 : 50;
- useEffect(()=>UpdateAsync(),[])
- return(
-
-
- (),}}/>
- (),}}/>
- (),}}/>
-
-
-
-
- )
+ useEffect(() => UpdateAsync(), []);
+ return (
+
+
+ (
+
+ ),
+ }}
+ />
+ (
+
+ ),
+ }}
+ />
+ (
+
+ ),
+ }}
+ />
+
+
+ );
}
-function top(){
- return(
+function top() {
+ return (
-
-
-
-
-
+
+
+
+
+
+
- )
+ );
}
-function menuPage(){
- return(
+function menuPage() {
+ return (
-
-
+
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/Apps.js b/Apps.js
index 4491bed..fc48352 100644
--- a/Apps.js
+++ b/Apps.js
@@ -1,5 +1,11 @@
import React, { useEffect, useRef, useState } from "react";
-import { View, Platform, ToastAndroid } from "react-native";
+import {
+ View,
+ Platform,
+ ToastAndroid,
+ Text,
+ TouchableOpacity,
+} from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
import AsyncStorage from "@react-native-async-storage/async-storage";
@@ -8,8 +14,6 @@ import { news } from "./config/newsUpdate";
import StatusbarDetect from './StatusbarDetect';
var Status = StatusbarDetect(); */
-export var webview = null;
-
export default function Apps(props) {
const {
navigation: { navigate },
@@ -17,13 +21,81 @@ export default function Apps(props) {
var urlcache = "";
const webview = useRef();
const [iconSetting, setIconSetting] = useState(undefined);
+ const [mapSwitch, setMapSwitch] = useState(undefined);
- const bootData = `
- document.getElementById('header').querySelector('a').style.display = 'none';
- document.getElementById('header').style.height = '50px';
- document.getElementById('main').style.paddingTop = '54px';
-
- document.getElementById('headerStr').style.display = 'none';
+ const [stationData, setStationData] = useState(undefined);
+ useEffect(() => {
+ const HeaderConfig = {
+ headers: { referer: "https://train.jr-shikoku.co.jp/sp.html" },
+ };
+
+ Promise.all([
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=yosan",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=uwajima",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=uwajima2",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=dosan",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=dosan2",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=koutoku",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=tokushima",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=naruto",
+ HeaderConfig
+ ).then((response) => response.json()),
+ ]).then((values) => {
+ let stationList = {};
+ [
+ stationList.yosan,
+ stationList.uwajima,
+ stationList.uwajima2,
+ stationList.dosan,
+ stationList.dosan2,
+ stationList.koutoku,
+ stationList.tokushima,
+ stationList.naruto,
+ ] = values;
+ setStationData(stationList);
+ });
+ }, []);
+
+ const topMenu =
+ mapSwitch != "true"
+ ? `
+document.getElementById('header').querySelector('a').style.display = 'none';
+document.getElementById('header').style.height = '50px';
+document.getElementById('main').style.paddingTop = '54px';
+
+document.getElementById('headerStr').style.display = 'none';
+`
+ : `
+document.getElementsByClassName('accordionClass')[0].style.display = 'none';
+document.getElementById('header').style.display = 'none';
+document.getElementById('main').style.paddingTop = '0px';
+document.getElementById('headerStr').style.display = 'none';
+`;
+ const bootData =
+ topMenu +
+ `
const setReload = () =>{
try{
document.getElementById('refreshIcon').click();
@@ -700,7 +772,30 @@ observer.observe(target, {
});
`;
- const injectJavascriptData = bootData + trainIconMaker + textInsert;
+ const modal_content = `
+
+const modal_content = document.getElementById('modal_content'); // body要素を監視
+const modal_observer = new MutationObserver( (mutations) => {
+ // observer.disconnect(); // 監視を終了
+ for(let d of modal_content.getElementsByTagName("button") ){
+ const data = d.onclick.toString().split("\\"")[1];
+ d.onclick = () => window.ReactNativeWebView.postMessage(data)
+ }
+});
+
+// 監視を開始
+modal_observer.observe(modal_content, {
+ //attributes: true, // 属性変化の監視
+ //attributeOldValue: true, // 変化前の属性値を matation.oldValue に格納する
+ //characterData: true, // テキストノードの変化を監視
+ //characterDataOldValue: true, // 変化前のテキストを matation.oldValue に格納する
+ childList: true, // 子ノードの変化を監視
+ //subtree: true // 子孫ノードも監視対象に含める
+});
+`;
+
+ const injectJavascriptData =
+ bootData + modal_content + trainIconMaker + textInsert;
useEffect(() => {
AsyncStorage.getItem("status")
@@ -729,6 +824,22 @@ observer.observe(target, {
Updates.reloadAsync()
)
);
+
+ AsyncStorage.getItem("mapSwitch")
+ .then((d) => {
+ if (d) {
+ setMapSwitch(d);
+ } else {
+ AsyncStorage.setItem("mapSwitch", "false").then(() =>
+ Updates.reloadAsync()
+ );
+ }
+ })
+ .catch((d) =>
+ AsyncStorage.setItem("mapSwitch", "false").then(() =>
+ Updates.reloadAsync()
+ )
+ );
}, []);
return (
@@ -773,9 +884,46 @@ observer.observe(target, {
}
}
}}
- onMessage={(event) => {}}
+ onMessage={(event) => {
+ console.log(event.nativeEvent.data);
+ navigate("trainbase", { info: event.nativeEvent.data });
+ }}
injectedJavaScript={injectJavascriptData}
/>
+ navigate("trainMenu", { webview, stationData })}
+ style={{
+ position: "absolute",
+ top: Platform.OS == "ios" ? Constants.statusBarHeight : 0,
+ left: 10,
+ width: 50,
+ height: 50,
+ backgroundColor: "#0099CC",
+ borderColor: "white",
+ borderStyle: "solid",
+ borderWidth: 1,
+ borderRadius: 50,
+ alignContent: "center",
+ alignSelf: "center",
+ alignItems: "center",
+ display: mapSwitch == "true" ? "flex" : "none",
+ }}
+ >
+
+
+ 三
+
+
+
);
}
diff --git a/StatusbarDetect.js b/StatusbarDetect.js
index e954e55..930d558 100644
--- a/StatusbarDetect.js
+++ b/StatusbarDetect.js
@@ -1,16 +1,10 @@
-import React from 'react';
-import {Platform, StatusBar, View} from 'react-native';
+import React from "react";
+import { Platform, StatusBar, View } from "react-native";
export default function StatusbarDetect() {
- if(Platform.OS == "ios"){
- return (
-
- );
- }
- else if(Platform.OS == "android"){
- return (
-
- );
- }
-
-}
\ No newline at end of file
+ if (Platform.OS == "ios") {
+ return ;
+ } else if (Platform.OS == "android") {
+ return ;
+ }
+}
diff --git a/TestArea.js b/TestArea.js
index 00bb082..55b450a 100644
--- a/TestArea.js
+++ b/TestArea.js
@@ -1,49 +1,74 @@
-import React, { Component, useEffect, useState } from 'react';
-import {StatusBar,View,ScrollView,Linking,Text } from 'react-native';
-import Constants from 'expo-constants';
-import { ListItem } from 'react-native-elements';
-import Icon from 'react-native-vector-icons/Entypo';
-import StatusbarDetect from './StatusbarDetect';
+import React, { Component, useEffect, useState } from "react";
+import { StatusBar, View, ScrollView, Linking, Text } from "react-native";
+import Constants from "expo-constants";
+import { ListItem } from "react-native-elements";
+import Icon from "react-native-vector-icons/Entypo";
+import StatusbarDetect from "./StatusbarDetect";
var Status = StatusbarDetect();
-let a=[];
+let a = [];
export default function TestArea(props) {
- const [data,setdata] = useState(null);
- useEffect(()=>{
- data==null ? test().then(res=>{
- //console.log(res);
- setdata(res);
- }):null
- },[data])
+ const [data, setdata] = useState(null);
+ useEffect(() => {
+ data == null
+ ? test().then((res) => {
+ //console.log(res);
+ setdata(res);
+ })
+ : null;
+ }, [data]);
return (
-
+
{Status}
- TEST AREA!!
- {data}
+ TEST AREA!!
+ {data}
);
}
-async function test(){
- return fetch('https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train', {
+async function test() {
+ return fetch("https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train", {
headers: {
- 'authority': 'train.jr-shikoku.co.jp',
- 'cache-control': 'no-cache',
- 'pragma': 'no-cache',
- 'if-modified-since': 'Thu, 01 Jun 1970 00:00:00 GMT',
- 'accept': '*/*',
- 'sec-fetch-site': 'same-origin',
- 'sec-fetch-mode': 'cors',
- 'referer': 'https://train.jr-shikoku.co.jp/sp.html'
- }
- }).then(res=>res.json()).then(D=>{
- let d =[];
- D.forEach(element => {
- console.log(element)
- d.push();
+ authority: "train.jr-shikoku.co.jp",
+ "cache-control": "no-cache",
+ pragma: "no-cache",
+ "if-modified-since": "Thu, 01 Jun 1970 00:00:00 GMT",
+ accept: "*/*",
+ "sec-fetch-site": "same-origin",
+ "sec-fetch-mode": "cors",
+ referer: "https://train.jr-shikoku.co.jp/sp.html",
+ },
+ })
+ .then((res) => res.json())
+ .then((D) => {
+ let d = [];
+ D.forEach((element) => {
+ console.log(element);
+ d.push(
+
+ );
+ });
+ a = d;
+ return d;
});
- a=d;
- return d;
- });
-}
\ No newline at end of file
+}
diff --git a/UpdateAsync.js b/UpdateAsync.js
index 3e76594..3c26521 100644
--- a/UpdateAsync.js
+++ b/UpdateAsync.js
@@ -1,11 +1,25 @@
-import { ToastAndroid, } from 'react-native';
-import * as Updates from 'expo-updates';
+import { ToastAndroid } from "react-native";
+import * as Updates from "expo-updates";
-export function UpdateAsync(){
- Updates.checkForUpdateAsync().then(update=>{
- if (update.isAvailable) {
- ToastAndroid.showWithGravityAndOffset('アプリのデータを更新しています。',ToastAndroid.LONG,ToastAndroid.BOTTOM,25,50,);
- Updates.fetchUpdateAsync().then(()=>Updates.reloadAsync());
- }
- }).catch(e=>ToastAndroid.showWithGravityAndOffset(e.toString(),ToastAndroid.LONG,ToastAndroid.BOTTOM,25,50,))
-}
\ No newline at end of file
+export const UpdateAsync = () =>
+ Updates.checkForUpdateAsync()
+ .then((update) => {
+ if (!update.isAvailable) return;
+ ToastAndroid.showWithGravityAndOffset(
+ "アプリのデータを更新しています。",
+ ToastAndroid.LONG,
+ ToastAndroid.BOTTOM,
+ 25,
+ 50
+ );
+ Updates.fetchUpdateAsync().then(() => Updates.reloadAsync());
+ })
+ .catch((e) =>
+ ToastAndroid.showWithGravityAndOffset(
+ e.toString(),
+ ToastAndroid.LONG,
+ ToastAndroid.BOTTOM,
+ 25,
+ 50
+ )
+ );
diff --git a/app.json b/app.json
index 032a2e4..3d4ce7a 100644
--- a/app.json
+++ b/app.json
@@ -3,11 +3,8 @@
"name": "JR四国運行状況",
"slug": "jrshikoku",
"privacy": "public",
- "platforms": [
- "ios",
- "android"
- ],
- "version": "4.2",
+ "platforms": ["ios", "android"],
+ "version": "4.4",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
@@ -18,19 +15,25 @@
"updates": {
"fallbackToCacheTimeout": 0
},
- "assetBundlePatterns": [
- "**/*"
- ],
+ "assetBundlePatterns": ["**/*"],
"ios": {
- "buildNumber": "20",
+ "buildNumber": "22",
"supportsTablet": true,
- "bundleIdentifier": "jrshikokuinfo.xprocess.hrkn"
+ "bundleIdentifier": "jrshikokuinfo.xprocess.hrkn",
+ "config": {
+ "googleMapsApiKey": "AIzaSyAVGDTjBkR_0wkQiNkoo5WDLhqXCjrjk8Y"
+ }
},
"android": {
"package": "jrshikokuinfo.xprocess.hrkn",
- "versionCode": 14,
+ "versionCode": 16,
"permissions": ["ACCESS_FINE_LOCATION"],
- "googleServicesFile": "./google-services.json"
+ "googleServicesFile": "./google-services.json",
+ "config": {
+ "googleMaps": {
+ "apiKey": "AIzaSyAmFb-Yj033bXZWlSzNrfq_0jc1PgRrWcE"
+ }
+ }
}
}
}
diff --git a/components/ActionSheetComponents/StationDeteilView.js b/components/ActionSheetComponents/StationDeteilView.js
new file mode 100644
index 0000000..541e641
--- /dev/null
+++ b/components/ActionSheetComponents/StationDeteilView.js
@@ -0,0 +1,80 @@
+export const StationDeteilView = (props) => {
+ return (
+ {}}
+ >
+
+
+
+
+
+ {currentStation && (
+ Linking.openURL(currentStation[0].StationTimeTable)}
+ />
+ )}
+ {currentStation && (
+
+ {!currentStation[0].JrHpUrl || (
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(currentStation[0].JrHpUrl)
+ }
+ >
+ web
+
+ )}
+ {!currentStation[0].StationTimeTable || (
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(currentStation[0].StationTimeTable)
+ }
+ >
+ 時刻表
+
+ )}
+ {!currentStation[0].StationMap || (
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(currentStation[0].StationMap)
+ }
+ >
+ GoogleMap
+
+ )}
+
+ )}
+
+
+
+ );
+};
diff --git a/components/custom-train-data.js b/components/custom-train-data.js
index 290ce01..2290532 100644
--- a/components/custom-train-data.js
+++ b/components/custom-train-data.js
@@ -1,398 +1,586 @@
-export const customTrainDataDetector = (TrainNumber) =>{
- switch(TrainNumber){
- //しおかぜメイン
- //8000 ノーマル
- case "2M":
- case "4M":
- case "6M":
- case "14M":
- case "16M":
- case "18M":
- case "26M":
- case "28M":
- case "30M":
- case "1M":
- case "3M":
- case "5M":
- case "13M":
- case "15M":
- case "17M":
- case "25M":
- case "27M":
- case "29M":
- return {type:"LTDEXP",trainName:"しおかぜ",trainIcon:'http://www.trainfrontview.net/b/s8000nr.png',trainNumDistance:0,info:"いしづちと併結 / 8000系で運転"};
- //8000 アンパン
- case "10M":
- case "22M":
- case "9M":
- case "21M":
- return {type:"LTDEXP",trainName:"しおかぜ",trainIcon:'http://www.trainfrontview.net/f/s8000ap.png',trainNumDistance:0,info:"いしづちと併結 / アンパンマン列車で運転"};
- //8600
- case "8M":
- case "12M":
- case "20M":
- case "24M":
- case "7M":
- case "11M":
- case "19M":
- case "23M":
- return {type:"LTDEXP",trainName:"しおかぜ",trainIcon:'http://www.trainfrontview.net/b/s8600.png',trainNumDistance:0,info:"いしづちと併結 / 8600系で運転"};
-
- //いしづちメイン
- //8000 ノーマル
-
- case "1004M":
- case "1006M":
- case "1014M":
- case "1016M":
- case "1018M":
- case "1026M":
- case "1028M":
- case "1030M":
- case "1001M":
- case "1003M":
- case "1005M":
- case "1013M":
- case "1015M":
- case "1017M":
- case "1025M":
- case "1027M":
- case "1029M":
- return {type:"LTDEXP",trainName:"いしづち",trainIcon:'http://www.trainfrontview.net/b/s8000no.png',trainNumDistance:1000,info:"しおかぜと併結 / 8000系で運転"};
-
- //8000 アンパン
- case "1010M":
- case "1022M":
- case "1009M":
- case "1021M":
- return {type:"LTDEXP",trainName:"いしづち",trainIcon:'http://www.trainfrontview.net/f/s8000ap.png',trainNumDistance:1000,info:"しおかぜと併結 / アンパンマン列車で運転"};
-
- //8600
- case "1008M":
- case "1012M":
- case "1020M":
- case "1024M":
- case "1007M":
- case "1011M":
- case "1019M":
- case "1023M":
- return {type:"LTDEXP",trainName:"いしづち",trainIcon:'http://www.trainfrontview.net/b/s8600_isz.png',trainNumDistance:1000,info:"しおかぜと併結 / 8600系で運転"};
-
- //MEXP
- //8000
- case "1092M":
- return {type:"LTDEXP",trainName:"モーニングEXP高松",trainIcon:'http://www.trainfrontview.net/b/s8000no.png',trainNumDistance:null,info:"8000系で運転"};
- //8600
- case "1091M":
- return {type:"LTDEXP",trainName:"モーニングEXP松山",trainIcon:'http://www.trainfrontview.net/b/s8600_isz.png',trainNumDistance:null,info:"8600系で運転"};
- //三桁いしづち
- //8000 アンパン
- case "1041M":
- case "1044M":
- return {type:"LTDEXP",trainName:"いしづち",trainIcon:'http://www.trainfrontview.net/f/s8000ap.png',trainNumDistance:940,info:"アンパンマン列車で運転"};
- //8600
- case "1043M":
- case "1042M":
- case "1046M":
- return {type:"LTDEXP",trainName:"いしづち",trainIcon:'http://www.trainfrontview.net/b/s8600_isz.png',trainNumDistance:940,info:"8600系で運転"};
-
- //南風 2700ノーマル
- case "34D":
- case "38D":
- case "40D":
- case "42D":
- case "46D":
- case "50D":
- case "52D":
- case "54D":
- case "58D":
- case "31D":
- case "35D":
- case "39D":
- case "41D":
- case "43D":
- case "47D":
- case "51D":
- case "53D":
- case "55D":
- return {type:"LTDEXP",trainName:"南風",trainIcon:'http://www.trainfrontview.net/b/s2700.png',trainNumDistance:30,info:"2700系で運転"};
- //2700アンパン
- case "32D":
- case "36D":
- case "44D":
- case "48D":
- case "56D":
- case "33D":
- case "37D":
- case "45D":
- case "49D":
- case "57D":
- return {type:"LTDEXP",trainName:"南風",trainIcon:'http://www.trainfrontview.net/f/s2700apr.png',trainNumDistance:30,info:"アンパンマン列車で運転"};
- break;
-
-
-
- //うずしお
- //2700
- case "5006D":
- case "5022D":
- case "5013D":
- case "5029D":
- return {type:"LTDEXP",trainName:"うずしお",trainIcon:'http://www.trainfrontview.net/b/s2700_uzu.png',trainNumDistance:5000,info:"南風と宇多津で併結 / 高松-宇多津間進行方向逆転 / 2700系で運転"};
- case "3002D":
- case "3004D":
- case "3010D":
- case "3012D":
- case "3016D":
- case "3018D":
- case "3024D":
- case "3028D":
- case "3030D":
- case "3003D":
- case "3005D":
- case "3007D":
- case "3015D":
- case "3019D":
- case "3021D":
- case "3025D":
- case "3027D":
- case "3031D":
- case "3033D":
- return {type:"LTDEXP",trainName:"うずしお",trainIcon:'http://www.trainfrontview.net/b/s2700_uzu.png',trainNumDistance:3000,info:"2700系で運転"};
-
- //2600
- case "3008D":
- case "3014D":
- case "3020D":
- case "3026D":
- case "3001D":
- case "3011D":
- case "3017D":
- case "3023D":
- return {type:"LTDEXP",trainName:"うずしお",trainIcon:'http://www.trainfrontview.net/b/s2600.png',trainNumDistance:3000,info:"2600系で運転"};
-
- //キハ185
- case "3009D":
- case "3032D":
- return {type:"LTDEXP",trainName:"うずしお",trainIcon:'http://www.trainfrontview.net/b/s185tu_uzu.png',trainNumDistance:3000,info:"キハ185系で運転"};
-
- //マリンライナー
- case "3104M":
- case "3106M":
- case "3108M":
- case "3110M":
- case "3112M":
- case "3114M":
- case "3116M":
- case "3118M":
- case "3120M":
- case "3122M":
- case "3124M":
- case "3126M":
- case "3128M":
- case "3130M":
- case "3132M":
- case "3134M":
- case "3136M":
- case "3138M":
- case "3140M":
- case "3142M":
- case "3144M":
- case "3146M":
- case "3148M":
- case "3150M":
- case "3152M":
- case "3154M":
- case "3156M":
- case "3158M":
- case "3160M":
- case "3162M":
- case "3164M":
- case "3166M":
- case "3168M":
- case "3170M":
- case "3105M":
- case "3107M":
- case "3109M":
- case "3111M":
- case "3113M":
- case "3115M":
- case "3117M":
- case "3119M":
- case "3121M":
- case "3123M":
- case "3125M":
- case "3127M":
- case "3129M":
- case "3131M":
- case "3133M":
- case "3135M":
- case "3137M":
- case "3139M":
- case "3141M":
- case "3143M":
- case "3145M":
- case "3147M":
- case "3149M":
- case "3151M":
- case "3153M":
- case "3155M":
- case "3157M":
- case "3159M":
- case "3161M":
- case "3163M":
- case "3165M":
- case "3167M":
- case "3169M":
- case "3175M":
- return {type:"Rapid",trainName:"マリンライナー",trainIcon:'http://www.trainfrontview.net/b/s5001.png',trainNumDistance:3100,info:""};
- case "3102M":
- case "3101M":
- case "3103M":
- case "3171M":
- case "3173M":
- return {type:"Rapid",trainName:"マリンライナー",trainIcon:'http://www.trainfrontview.net/b/s5001k.png',trainNumDistance:3100,info:""};
-
- //サンライズ瀬戸
- case "5032M":
- case "5031M":
- return {type:"NightLTDEXP",trainName:"サンライズ瀬戸",trainIcon:'http://www.trainfrontview.net/b/w285.png',trainNumDistance:null,info:""};
- case "8041M": //琴平延長高松迄
- case "8031M": //琴平延長高松以降
- return {type:"NightLTDEXP",trainName:"サンライズ瀬戸",trainIcon:'http://www.trainfrontview.net/b/w285.png',trainNumDistance:null,info:"琴平延長運転日"};
-
- //宇和海
- //2000 ノーマル
- case "1052D":
- case "1056D":
- case "1058D":
- case "1064D":
- case "1070D":
- case "1074D":
- case "1076D":
- case "1078D":
- case "1080D":
- case "1082D":
- case "1051D":
- case "1059D":
- case "1065D":
- case "1069D":
- case "1071D":
- case "1073D":
- case "1075D":
- case "1077D":
- case "1079D":
- case "1053D":
- return {type:"LTDEXP",trainName:"宇和海",trainIcon:'http://www.trainfrontview.net/b/s2000_uwa.png',trainNumDistance:1050,info:"2000系で運転"};
- //2000 アンパン込み
- case "1054D":
- case "1060D":
- case "1062D":
- case "1066D":
- case "1068D":
- case "1072D":
- case "1055D":
- case "1057D":
- case "1061D":
- case "1063D":
- case "1067D":
- case "1081D":
- return {type:"LTDEXP",trainName:"宇和海",trainIcon:'http://www.trainfrontview.net/f/s2002a.png',trainNumDistance:1050,info:"アンパン列車で運転"};
- //しまんと
- case "2002D":
- case "2004D":
- case "2006D":
- case "2008D":
- case "2001D":
- case "2003D":
- case "2005D":
- case "2007D":
- return {type:"LTDEXP",trainName:"しまんと",trainIcon:'http://www.trainfrontview.net/b/s2700_smn.png',trainNumDistance:2000,info:"2700系で運転"};
-
- //あしずり 2000
- case "2074D":
- case "2076D":
- case "2080D":
- case "2084D":
- case "2086D":
- case "2071D":
- case "2075D":
- case "2077D":
- case "2081D":
- case "2083D":
- return {type:"LTDEXP",trainName:"あしずり",trainIcon:'http://www.trainfrontview.net/b/s2000_asi.png',trainNumDistance:2070,info:"2000系で運転"};
+export const customTrainDataDetector = (TrainNumber) => {
+ switch (TrainNumber) {
+ //しおかぜメイン
+ //8000 ノーマル
+ case "2M":
+ case "4M":
+ case "6M":
+ case "14M":
+ case "16M":
+ case "18M":
+ case "26M":
+ case "28M":
+ case "30M":
+ case "1M":
+ case "3M":
+ case "5M":
+ case "13M":
+ case "15M":
+ case "17M":
+ case "25M":
+ case "27M":
+ case "29M":
+ return {
+ type: "LTDEXP",
+ trainName: "しおかぜ",
+ trainIcon: "http://www.trainfrontview.net/b/s8000nr.png",
+ trainNumDistance: 0,
+ info: "いしづちと併結 / 8000系で運転",
+ };
+ //8000 アンパン
+ case "10M":
+ case "22M":
+ case "9M":
+ case "21M":
+ return {
+ type: "LTDEXP",
+ trainName: "しおかぜ",
+ trainIcon: "http://www.trainfrontview.net/f/s8000ap.png",
+ trainNumDistance: 0,
+ info: "いしづちと併結 / アンパンマン列車で運転",
+ };
+ //8600
+ case "8M":
+ case "12M":
+ case "20M":
+ case "24M":
+ case "7M":
+ case "11M":
+ case "19M":
+ case "23M":
+ return {
+ type: "LTDEXP",
+ trainName: "しおかぜ",
+ trainIcon: "http://www.trainfrontview.net/b/s8600.png",
+ trainNumDistance: 0,
+ info: "いしづちと併結 / 8600系で運転",
+ };
-
- //あしずり 2700
- case "2078D":
- case "2082D":
- case "2088D":
- case "2073D":
- case "2079D":
- case "2085D":
- case "2072D":
- return {type:"LTDEXP",trainName:"あしずり",trainIcon:'http://www.trainfrontview.net/b/s2700_asi.png',trainNumDistance:2070,info:"2700系で運転"};
+ //いしづちメイン
+ //8000 ノーマル
- //剣山
- case "4002D":
- case "4004D":
- case "4006D":
- case "4008D":
- case "4010D":
- case "4001D":
- case "4003D":
- case "4005D":
- case "4007D":
- case "4009D":
- case "4011D":
- return {type:"LTDEXP",trainName:"剣山",trainIcon:'http://www.trainfrontview.net/b/s185tu.png',trainNumDistance:4000,info:"キハ185系で運転"};
+ case "1004M":
+ case "1006M":
+ case "1014M":
+ case "1016M":
+ case "1018M":
+ case "1026M":
+ case "1028M":
+ case "1030M":
+ case "1001M":
+ case "1003M":
+ case "1005M":
+ case "1013M":
+ case "1015M":
+ case "1017M":
+ case "1025M":
+ case "1027M":
+ case "1029M":
+ return {
+ type: "LTDEXP",
+ trainName: "いしづち",
+ trainIcon: "http://www.trainfrontview.net/b/s8000no.png",
+ trainNumDistance: 1000,
+ info: "しおかぜと併結 / 8000系で運転",
+ };
- //むろと
- case "5051D":
- case "5052D":
- return {type:"LTDEXP",trainName:"むろと",trainIcon:'http://www.trainfrontview.net/b/s185_mrt.png',trainNumDistance:5050,info:"キハ185系で運転"};
+ //8000 アンパン
+ case "1010M":
+ case "1022M":
+ case "1009M":
+ case "1021M":
+ return {
+ type: "LTDEXP",
+ trainName: "いしづち",
+ trainIcon: "http://www.trainfrontview.net/f/s8000ap.png",
+ trainNumDistance: 1000,
+ info: "しおかぜと併結 / アンパンマン列車で運転",
+ };
-
-
- //よしのがわトロッコ
- case "8452D":
- case "8451D":
- return {type:"LTDEXP",trainName:"よしのがわトロッコ",trainIcon:'http://www.trainfrontview.net/f/s185to_ai.png',trainNumDistance:null,info:""};
+ //8600
+ case "1008M":
+ case "1012M":
+ case "1020M":
+ case "1024M":
+ case "1007M":
+ case "1011M":
+ case "1019M":
+ case "1023M":
+ return {
+ type: "LTDEXP",
+ trainName: "いしづち",
+ trainIcon: "http://www.trainfrontview.net/b/s8600_isz.png",
+ trainNumDistance: 1000,
+ info: "しおかぜと併結 / 8600系で運転",
+ };
-
- //岡山高松アントロ
- case "8176D":
- case "8179D":
- //岡山琴平アントロ
- case "8277D":
- case "8278D":
- return {type:"LTDEXP",trainName:"アンパンマントロッコ",trainIcon:'http://www.trainfrontview.net/f/s32to4.png',trainNumDistance:null,info:""};
+ //MEXP
+ //8000
+ case "1092M":
+ return {
+ type: "LTDEXP",
+ trainName: "モーニングEXP高松",
+ trainIcon: "http://www.trainfrontview.net/b/s8000no.png",
+ trainNumDistance: null,
+ info: "8000系で運転",
+ };
+ //8600
+ case "1091M":
+ return {
+ type: "LTDEXP",
+ trainName: "モーニングEXP松山",
+ trainIcon: "http://www.trainfrontview.net/b/s8600_isz.png",
+ trainNumDistance: null,
+ info: "8600系で運転",
+ };
+ //三桁いしづち
+ //8000 アンパン
+ case "1041M":
+ case "1044M":
+ return {
+ type: "LTDEXP",
+ trainName: "いしづち",
+ trainIcon: "http://www.trainfrontview.net/f/s8000ap.png",
+ trainNumDistance: 940,
+ info: "アンパンマン列車で運転",
+ };
+ //8600
+ case "1043M":
+ case "1042M":
+ case "1046M":
+ return {
+ type: "LTDEXP",
+ trainName: "いしづち",
+ trainIcon: "http://www.trainfrontview.net/b/s8600_isz.png",
+ trainNumDistance: 940,
+ info: "8600系で運転",
+ };
-
- //伊予灘ものがたり
- case "8901D":
- case "8903D":
- case "8902D":
- case "8904D":
- return {type:"LTDEXP",trainName:"伊予灘ものがたり",trainIcon:'http://www.trainfrontview.net/b/s185iyoy.png',trainNumDistance:null,info:""};
+ //南風 2700ノーマル
+ case "34D":
+ case "38D":
+ case "40D":
+ case "42D":
+ case "46D":
+ case "50D":
+ case "52D":
+ case "54D":
+ case "58D":
+ case "31D":
+ case "35D":
+ case "39D":
+ case "41D":
+ case "43D":
+ case "47D":
+ case "51D":
+ case "53D":
+ case "55D":
+ return {
+ type: "LTDEXP",
+ trainName: "南風",
+ trainIcon: "http://www.trainfrontview.net/b/s2700.png",
+ trainNumDistance: 30,
+ info: "2700系で運転",
+ };
+ //2700アンパン
+ case "32D":
+ case "36D":
+ case "44D":
+ case "48D":
+ case "56D":
+ case "33D":
+ case "37D":
+ case "45D":
+ case "49D":
+ case "57D":
+ return {
+ type: "LTDEXP",
+ trainName: "南風",
+ trainIcon: "http://www.trainfrontview.net/f/s2700apr.png",
+ trainNumDistance: 30,
+ info: "アンパンマン列車で運転",
+ };
+ break;
-
-
- //千年ものがたり
- case "8011D":
- case "8012D":
- return {type:"LTDEXP",trainName:"四国まんなか千年ものがたり",trainIcon:'http://www.trainfrontview.net/b/s185mm1.png',trainNumDistance:null,info:""};
+ //うずしお
+ //2700
+ case "5006D":
+ case "5022D":
+ case "5013D":
+ case "5029D":
+ return {
+ type: "LTDEXP",
+ trainName: "うずしお",
+ trainIcon: "http://www.trainfrontview.net/b/s2700_uzu.png",
+ trainNumDistance: 5000,
+ info: "南風と宇多津で併結 / 高松-宇多津間進行方向逆転 / 2700系で運転",
+ };
+ case "3002D":
+ case "3004D":
+ case "3010D":
+ case "3012D":
+ case "3016D":
+ case "3018D":
+ case "3024D":
+ case "3028D":
+ case "3030D":
+ case "3003D":
+ case "3005D":
+ case "3007D":
+ case "3015D":
+ case "3019D":
+ case "3021D":
+ case "3025D":
+ case "3027D":
+ case "3031D":
+ case "3033D":
+ return {
+ type: "LTDEXP",
+ trainName: "うずしお",
+ trainIcon: "http://www.trainfrontview.net/b/s2700_uzu.png",
+ trainNumDistance: 3000,
+ info: "2700系で運転",
+ };
-
- //夜明けものがたり
- case "8053D":
- case "8054D":
- case "8062D":
- case "8063D":
- return {type:"LTDEXP",trainName:"時代の夜明けのものがたり",trainIcon:'http://www.trainfrontview.net/b/s185ym1.png',trainNumDistance:null,info:""};
+ //2600
+ case "3008D":
+ case "3014D":
+ case "3020D":
+ case "3026D":
+ case "3001D":
+ case "3011D":
+ case "3017D":
+ case "3023D":
+ return {
+ type: "LTDEXP",
+ trainName: "うずしお",
+ trainIcon: "http://www.trainfrontview.net/b/s2600.png",
+ trainNumDistance: 3000,
+ info: "2600系で運転",
+ };
- default:
- return {type:"Normal",trainName:"",trainIcon:null,trainNumDistance:null,info:null};
- break;
- }
-}
\ No newline at end of file
+ //キハ185
+ case "3009D":
+ case "3032D":
+ return {
+ type: "LTDEXP",
+ trainName: "うずしお",
+ trainIcon: "http://www.trainfrontview.net/b/s185tu_uzu.png",
+ trainNumDistance: 3000,
+ info: "キハ185系で運転",
+ };
+
+ //マリンライナー
+ case "3104M":
+ case "3106M":
+ case "3108M":
+ case "3110M":
+ case "3112M":
+ case "3114M":
+ case "3116M":
+ case "3118M":
+ case "3120M":
+ case "3122M":
+ case "3124M":
+ case "3126M":
+ case "3128M":
+ case "3130M":
+ case "3132M":
+ case "3134M":
+ case "3136M":
+ case "3138M":
+ case "3140M":
+ case "3142M":
+ case "3144M":
+ case "3146M":
+ case "3148M":
+ case "3150M":
+ case "3152M":
+ case "3154M":
+ case "3156M":
+ case "3158M":
+ case "3160M":
+ case "3162M":
+ case "3164M":
+ case "3166M":
+ case "3168M":
+ case "3170M":
+ case "3105M":
+ case "3107M":
+ case "3109M":
+ case "3111M":
+ case "3113M":
+ case "3115M":
+ case "3117M":
+ case "3119M":
+ case "3121M":
+ case "3123M":
+ case "3125M":
+ case "3127M":
+ case "3129M":
+ case "3131M":
+ case "3133M":
+ case "3135M":
+ case "3137M":
+ case "3139M":
+ case "3141M":
+ case "3143M":
+ case "3145M":
+ case "3147M":
+ case "3149M":
+ case "3151M":
+ case "3153M":
+ case "3155M":
+ case "3157M":
+ case "3159M":
+ case "3161M":
+ case "3163M":
+ case "3165M":
+ case "3167M":
+ case "3169M":
+ case "3175M":
+ return {
+ type: "Rapid",
+ trainName: "マリンライナー",
+ trainIcon: "http://www.trainfrontview.net/b/s5001.png",
+ trainNumDistance: 3100,
+ info: "",
+ };
+ case "3102M":
+ case "3101M":
+ case "3103M":
+ case "3171M":
+ case "3173M":
+ return {
+ type: "Rapid",
+ trainName: "マリンライナー",
+ trainIcon: "http://www.trainfrontview.net/b/s5001k.png",
+ trainNumDistance: 3100,
+ info: "",
+ };
+
+ //サンライズ瀬戸
+ case "5032M":
+ case "5031M":
+ return {
+ type: "NightLTDEXP",
+ trainName: "サンライズ瀬戸",
+ trainIcon: "http://www.trainfrontview.net/b/w285.png",
+ trainNumDistance: null,
+ info: "",
+ };
+ case "8041M": //琴平延長高松迄
+ case "8031M": //琴平延長高松以降
+ return {
+ type: "NightLTDEXP",
+ trainName: "サンライズ瀬戸",
+ trainIcon: "http://www.trainfrontview.net/b/w285.png",
+ trainNumDistance: null,
+ info: "琴平延長運転日",
+ };
+
+ //宇和海
+ //2000 ノーマル
+ case "1052D":
+ case "1056D":
+ case "1058D":
+ case "1064D":
+ case "1070D":
+ case "1074D":
+ case "1076D":
+ case "1078D":
+ case "1080D":
+ case "1082D":
+ case "1051D":
+ case "1059D":
+ case "1065D":
+ case "1069D":
+ case "1071D":
+ case "1073D":
+ case "1075D":
+ case "1077D":
+ case "1079D":
+ case "1053D":
+ return {
+ type: "LTDEXP",
+ trainName: "宇和海",
+ trainIcon: "http://www.trainfrontview.net/b/s2000_uwa.png",
+ trainNumDistance: 1050,
+ info: "2000系で運転",
+ };
+ //2000 アンパン込み
+ case "1054D":
+ case "1060D":
+ case "1062D":
+ case "1066D":
+ case "1068D":
+ case "1072D":
+ case "1055D":
+ case "1057D":
+ case "1061D":
+ case "1063D":
+ case "1067D":
+ case "1081D":
+ return {
+ type: "LTDEXP",
+ trainName: "宇和海",
+ trainIcon: "http://www.trainfrontview.net/f/s2002a.png",
+ trainNumDistance: 1050,
+ info: "アンパン列車で運転",
+ };
+ //しまんと
+ case "2002D":
+ case "2004D":
+ case "2006D":
+ case "2008D":
+ case "2001D":
+ case "2003D":
+ case "2005D":
+ case "2007D":
+ return {
+ type: "LTDEXP",
+ trainName: "しまんと",
+ trainIcon: "http://www.trainfrontview.net/b/s2700_smn.png",
+ trainNumDistance: 2000,
+ info: "2700系で運転",
+ };
+
+ //あしずり 2000
+ case "2074D":
+ case "2076D":
+ case "2080D":
+ case "2084D":
+ case "2086D":
+ case "2071D":
+ case "2075D":
+ case "2077D":
+ case "2081D":
+ case "2083D":
+ return {
+ type: "LTDEXP",
+ trainName: "あしずり",
+ trainIcon: "http://www.trainfrontview.net/b/s2000_asi.png",
+ trainNumDistance: 2070,
+ info: "2000系で運転",
+ };
+
+ //あしずり 2700
+ case "2078D":
+ case "2082D":
+ case "2088D":
+ case "2073D":
+ case "2079D":
+ case "2085D":
+ case "2072D":
+ return {
+ type: "LTDEXP",
+ trainName: "あしずり",
+ trainIcon: "http://www.trainfrontview.net/b/s2700_asi.png",
+ trainNumDistance: 2070,
+ info: "2700系で運転",
+ };
+
+ //剣山
+ case "4002D":
+ case "4004D":
+ case "4006D":
+ case "4008D":
+ case "4010D":
+ case "4001D":
+ case "4003D":
+ case "4005D":
+ case "4007D":
+ case "4009D":
+ case "4011D":
+ return {
+ type: "LTDEXP",
+ trainName: "剣山",
+ trainIcon: "http://www.trainfrontview.net/b/s185tu.png",
+ trainNumDistance: 4000,
+ info: "キハ185系で運転",
+ };
+
+ //むろと
+ case "5051D":
+ case "5052D":
+ return {
+ type: "LTDEXP",
+ trainName: "むろと",
+ trainIcon: "http://www.trainfrontview.net/b/s185_mrt.png",
+ trainNumDistance: 5050,
+ info: "キハ185系で運転",
+ };
+
+ //よしのがわトロッコ
+ case "8452D":
+ case "8451D":
+ return {
+ type: "LTDEXP",
+ trainName: "よしのがわトロッコ",
+ trainIcon: "http://www.trainfrontview.net/f/s185to_ai.png",
+ trainNumDistance: null,
+ info: "",
+ };
+
+ //岡山高松アントロ
+ case "8176D":
+ case "8179D":
+ //岡山琴平アントロ
+ case "8277D":
+ case "8278D":
+ return {
+ type: "LTDEXP",
+ trainName: "アンパンマントロッコ",
+ trainIcon: "http://www.trainfrontview.net/f/s32to4.png",
+ trainNumDistance: null,
+ info: "",
+ };
+
+ //伊予灘ものがたり
+ case "8901D":
+ case "8903D":
+ case "8902D":
+ case "8904D":
+ return {
+ type: "LTDEXP",
+ trainName: "伊予灘ものがたり",
+ trainIcon: "http://www.trainfrontview.net/b/s185iyoy.png",
+ trainNumDistance: null,
+ info: "",
+ };
+
+ //千年ものがたり
+ case "8011D":
+ case "8012D":
+ return {
+ type: "LTDEXP",
+ trainName: "四国まんなか千年ものがたり",
+ trainIcon: "http://www.trainfrontview.net/b/s185mm1.png",
+ trainNumDistance: null,
+ info: "",
+ };
+
+ //夜明けものがたり
+ case "8053D":
+ case "8054D":
+ case "8062D":
+ case "8063D":
+ return {
+ type: "LTDEXP",
+ trainName: "時代の夜明けのものがたり",
+ trainIcon: "http://www.trainfrontview.net/b/s185ym1.png",
+ trainNumDistance: null,
+ info: "",
+ };
+
+ default:
+ return {
+ type: "Normal",
+ trainName: "",
+ trainIcon: null,
+ trainNumDistance: null,
+ info: null,
+ };
+ break;
+ }
+};
diff --git a/components/settings.js b/components/settings.js
index 96cc810..bd25731 100644
--- a/components/settings.js
+++ b/components/settings.js
@@ -1,52 +1,136 @@
-import React, { useState, useEffect } from 'react';
-import {View,Text,TouchableOpacity } from 'react-native';
-import * as Updates from 'expo-updates';
-import StatusbarDetect from '../StatusbarDetect';
-import AsyncStorage from '@react-native-async-storage/async-storage';
+import React, { useState, useEffect } from "react";
+import { View, Text, TouchableOpacity } from "react-native";
+import * as Updates from "expo-updates";
+import StatusbarDetect from "../StatusbarDetect";
+import AsyncStorage from "@react-native-async-storage/async-storage";
var Status = StatusbarDetect();
-import { Switch } from 'react-native-elements';
+import { Switch } from "react-native-elements";
-export default function Setting(props){
- const { navigation: { navigate } } = props;
- const [iconSetting, setIconSetting] = useState(undefined)
- useEffect(()=>{
- AsyncStorage.getItem("iconSwitch").then( d =>{
- setIconSetting(d)
- })
- },[])
- console.log(iconSetting);
- return(
-
-
-
- 設定画面
-
-
-
- 列車アイコンを表示する
-
- setIconSetting(value.toString())}/>
-
-
- channel: {Updates.channel}
-
-
-
- releaseChannel: {Updates.releaseChannel}
-
-
-
-
-
- {
- AsyncStorage.setItem("iconSwitch",iconSetting.toString()).then(()=>{
- Updates.reloadAsync()
- })
- }}>
-
- 設定を保存して再読み込み
-
-
+export default function Setting(props) {
+ const {
+ navigation: { navigate },
+ } = props;
+ const [iconSetting, setIconSetting] = useState(undefined);
+ const [mapSwitch, setMapSwitch] = useState(undefined);
+ useEffect(() => {
+ AsyncStorage.getItem("iconSwitch").then((d) => {
+ setIconSetting(d);
+ });
+ AsyncStorage.getItem("mapSwitch").then((d) => {
+ setMapSwitch(d);
+ });
+ }, []);
+ console.log(iconSetting);
+ return (
+
+
+
+
+ 設定画面
+
- )
-}
\ No newline at end of file
+
+
+
+ 列車アイコンを表示する
+
+
+ setIconSetting(value.toString())}
+ />
+
+
+
+ マップを表示する(beta)
+
+
+ setMapSwitch(value.toString())}
+ />
+
+
+
+ 内部バージョン: 4.4
+
+
+
+
+
+ releaseChannel: {Updates.releaseChannel}
+
+
+
+
+
+ {
+ Promise.all([
+ AsyncStorage.setItem("iconSwitch", iconSetting.toString()),
+ AsyncStorage.setItem("mapSwitch", mapSwitch.toString()),
+ ]).then(() => {
+ Updates.reloadAsync();
+ });
+ }}
+ >
+
+
+ 設定を保存して再読み込み
+
+
+
+
+ );
+}
diff --git a/components/trainMenu.js b/components/trainMenu.js
new file mode 100644
index 0000000..66dc8f7
--- /dev/null
+++ b/components/trainMenu.js
@@ -0,0 +1,145 @@
+import React, { useState, useEffect, useRef } from "react";
+import { View, Text, TouchableOpacity, Linking } from "react-native";
+import { WebView } from "react-native-webview";
+import StatusbarDetect from "../StatusbarDetect";
+import AsyncStorage from "@react-native-async-storage/async-storage";
+import MapView, { Marker, Geojson, PROVIDER_GOOGLE } from "react-native-maps";
+import {
+ FontAwesome,
+ Fontisto,
+ Foundation,
+ Ionicons,
+ MaterialCommunityIcons,
+} from "@expo/vector-icons";
+var Status = StatusbarDetect();
+export default function trainMenu({
+ route: {
+ params: { webview, stationData },
+ },
+ navigation: { navigate },
+}) {
+ const mapRef = useRef();
+ return (
+
+
+ {stationData &&
+ Object.keys(stationData).map((d) =>
+ stationData[d].map((D, index) => {
+ if (!D.StationMap) return null;
+ const latlng = D.StationMap.replace(
+ "https://www.google.co.jp/maps/place/",
+ ""
+ ).split(",");
+ if (latlng.length == 0) return null;
+ return (
+ {
+ webview.current?.injectJavaScript(
+ `MoveDisplayStation('${d}_${D.MyStation}_${D.Station_JP}')`
+ );
+ navigate("Apps");
+ }}
+ >
+ );
+ })
+ )}
+
+
+ navigate("howto")}
+ >
+ 使い方
+
+
+ /* Linking.openURL(
+ "https://www.jr-shikoku.co.jp/01_trainbus/jikoku/sp/#mainprice-box"
+ ) */
+ alert("お気に入り駅登録機能は現在開発中です!レイアウト募集中!")
+ }
+ >
+ お気に入り
+
+
+ Linking.openURL(
+ "https://nexcloud.haruk.in/apps/forms/ZRHjWFF7znr5Xjr2"
+ )
+ }
+ >
+ この機能のフィードバック
+
+
+ {
+ AsyncStorage.setItem("status", "2022/04/14");
+ navigate("Apps");
+ }}
+ >
+
+
+ 閉じる
+
+
+
+
+ );
+}
+const UsefulBox = (props) => {
+ const { icon, backgroundColor, flex, onPressButton, children } = props;
+ return (
+
+
+
+ {children}
+
+
+ );
+};
diff --git a/components/発車時刻表/LED_vidion.js b/components/発車時刻表/LED_vidion.js
index 8bf9fc8..5c0c632 100644
--- a/components/発車時刻表/LED_vidion.js
+++ b/components/発車時刻表/LED_vidion.js
@@ -1,13 +1,24 @@
-import React, { Component, useRef, useState, useEffect } from 'react';
-import {StatusBar,View,LayoutAnimation,ScrollView,Linking,Text,TouchableOpacity } from 'react-native';
-import { Switch } from 'react-native-elements';
-import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
-import { customTrainDataDetector } from '../custom-train-data';
+import React, { Component, useRef, useState, useEffect } from "react";
+import {
+ StatusBar,
+ View,
+ LayoutAnimation,
+ ScrollView,
+ Linking,
+ Text,
+ TouchableOpacity,
+} from "react-native";
+import { Switch } from "react-native-elements";
+import {
+ widthPercentageToDP as wp,
+ heightPercentageToDP as hp,
+} from "react-native-responsive-screen";
+import { customTrainDataDetector } from "../custom-train-data";
let diagramData = undefined;
/**
- *
+ *
* 1-30M しおかぜ
* 31-58D 南風
* 1001-1030M いしづち(併結)
@@ -35,222 +46,362 @@ let diagramData = undefined;
* 9031M サンライズ瀬戸琴平(延長)(臨時?)
* 9062D 四国まんなか千年ものがたり(臨時?)
*/
-export default function LED_vision(props){
- const HeaderConfig = {
- headers:{
- 'referer': 'https://train.jr-shikoku.co.jp/sp.html'
- }
- }
- const [trainDiagram,setTrainDiagram] = useState(null);
- const [stationDiagram,setStationDiagram] = useState(null);
- const [currentTrain, setCurrentTrain] = useState(null);
- const [finalSwitch, setFinalSwitch] = useState(false);
- const [trainIDSwitch, setTrainIDSwitch] = useState(false);
- const [trainDescriptionSwitch, setTrainDescriptionSwitch] = useState(false);
- useEffect(()=>{
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=traintimeinfo&arg3=dia', HeaderConfig).then(response => response.text()).then(d=>{
- const val = d.replace("[\r\n","").split(',\r\n');
- let returnData = {};
- val.forEach(element =>{
- try{
- let data = JSON.parse(element);
- Object.keys(data).forEach( key => returnData[key] = data[key] );
- }catch(e){
- }
- })
- return(returnData);
- }).then((trainDiagram)=>{
- let returnData = {};
- if(trainDiagram){
- Object.keys(trainDiagram).forEach( key => {
-
- if(trainDiagram[key].match(props.station.Station_JP) ){
- returnData[key] = trainDiagram[key];
- }
- });
- }
- setTrainDiagram(trainDiagram);
- setStationDiagram(returnData);
-
- })
- },[]);
- const getTime = ()=>{
- const returnData = [];
- const date = new Date();
- Object.keys(stationDiagram).forEach((d)=>{
- let a = (() =>{
- let returnData = {};
- stationDiagram[d].split("#").forEach((data)=>{
- if(data.match("着")){
- returnData.lastStation = data.split(",着,")[0];
- }
- if(data.match(props.station.Station_JP)){
- if(data.match(",発,")){
- returnData.time = data.split(",発,")[1];
- }
- else{
- returnData.time = data.split(",着,")[1];
- returnData.lastStation = "当駅止"
- }
-
- }
- })
- return returnData;
- })();
- returnData.push({train:d,time:a.time,lastStation:a.lastStation});
- })
-
- return (returnData.sort((a,b)=> {
- if(parseInt(a.time.split(":")[0]) < parseInt(b.time.split(":")[0])){
- return -1;
- }
- else if(parseInt(a.time.split(":")[0]) > parseInt(b.time.split(":")[0])){
- return 1;
- }
- else if(parseInt(a.time.split(":")[1]) < parseInt(b.time.split(":")[1])){
- return -1;
- }
- else if(parseInt(a.time.split(":")[1]) > parseInt(b.time.split(":")[1])){
- return 1;
- }
- }))
-
- };
- const trainTimeAndNumber = stationDiagram != null ? getTime() : null;
- useEffect(()=>{
- const getCurrentTrain = () =>fetch("https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train", HeaderConfig).then(response => response.json()).then(d=>d.map(x=>({num:x.TrainNum,delay:x.delay}))).then(d=>setCurrentTrain(d));
- getCurrentTrain();
- const currentTrainInterval = setInterval(()=>getCurrentTrain(),15000)
- return ()=>clearInterval(currentTrainInterval);
-
- },[])
-
- const filtering = d => currentTrain.map(m=>m.num).includes(d.train)
- console.log(new Date())
- const timeFiltering = d => {
- const date = new Date();
- const newDate = new Date();
- let data = d.time.split(":");
- let delay = isNaN(currentTrain.filter(data =>data.num == d.train)[0].delay) ? 0 : currentTrain.filter(data =>data.num == d.train)[0].delay;
-
- date.setHours(parseInt(data[0]));
- date.setMinutes(parseInt(data[1])+parseInt(delay));
- console.log(date);
- console.log(newDate)
- if(!(newDate > date)){
- return true;
- }
-
- return false;
-
- }
- const finalFiltering = d =>{
- if(finalSwitch){
- return true;
- }
- else{
- if(d.lastStation == "当駅止"){
- return false;
- }
- return true;
- }
- }
- return(
-
-
-
-
-
-
- 次の列車
- Next Train
-
-
-
-
-
-
- {trainTimeAndNumber ? currentTrain && trainTimeAndNumber.filter(filtering).filter(timeFiltering).filter(finalFiltering).map((d,index)=>
- [
-
- {
- if(customTrainDataDetector(d.train).trainName.length > 6){
- return 15;
- }
- else{
- return 20
- }
- })(),color:(()=>{
- switch(customTrainDataDetector(d.train).type){
- case "Rapid":
- return "aqua";
- case "LTDEXP":
- return "red";
- case "NightLTDEXP":
- return "red";
- case "Normal":
- return "white";
-
- }
- })(),fontWeight:"bold"}}>{trainIDSwitch ? d.train : (()=>{
- switch(customTrainDataDetector(d.train).type){
- case "Rapid":
- return "快速";
- case "LTDEXP":
- return "特急";
- case "NightLTDEXP":
- return "寝台特急";
- case "Normal":
- return "普通列車";
- }
- })()+" "+customTrainDataDetector(d.train).trainName+(()=>{
- if(customTrainDataDetector(d.train).trainNumDistance != null){
- return parseInt(d.train.replace("M","").replace("D","")) - customTrainDataDetector(d.train).trainNumDistance + "号";
- }
- else{
- return "";
- }
- })()}
-
-
- 4 ? 15 : 20,color:"white",fontWeight:"bold"}}>{d.lastStation}
-
-
- {d.time}
-
-
- {(()=>{
- let data= currentTrain.filter(data=>data.num==d.train)[0].delay;
- if(isNaN(data)){
- return data;
- }
- else if(data == 0){
- return "定刻通り"
- }
- else{
- return data+"分遅れ"
- }
- })()}
-
- ,Boolean(trainDescriptionSwitch) && Boolean(customTrainDataDetector(d.train).info) &&
-
-
- > {customTrainDataDetector(d.train).info}
-
-
- ]
- )
- : null}
-
- 種別名 / 列番
- setTrainIDSwitch(!trainIDSwitch)}/>
-
- 列車情報
- setTrainDescriptionSwitch(!trainDescriptionSwitch)}/>
-
- 当駅止表示
- setFinalSwitch(!finalSwitch)}/>
-
-
+export default function LED_vision(props) {
+ const HeaderConfig = {
+ headers: {
+ referer: "https://train.jr-shikoku.co.jp/sp.html",
+ },
+ };
+ const [trainDiagram, setTrainDiagram] = useState(null);
+ const [stationDiagram, setStationDiagram] = useState(null);
+ const [currentTrain, setCurrentTrain] = useState(null);
+ const [finalSwitch, setFinalSwitch] = useState(false);
+ const [trainIDSwitch, setTrainIDSwitch] = useState(false);
+ const [trainDescriptionSwitch, setTrainDescriptionSwitch] = useState(false);
+ useEffect(() => {
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=traintimeinfo&arg3=dia",
+ HeaderConfig
)
+ .then((response) => response.text())
+ .then((d) => {
+ const val = d.replace("[\r\n", "").split(",\r\n");
+ let returnData = {};
+ val.forEach((element) => {
+ try {
+ let data = JSON.parse(element);
+ Object.keys(data).forEach((key) => (returnData[key] = data[key]));
+ } catch (e) {}
+ });
+ return returnData;
+ })
+ .then((trainDiagram) => {
+ let returnData = {};
+ if (trainDiagram) {
+ Object.keys(trainDiagram).forEach((key) => {
+ if (trainDiagram[key].match(props.station.Station_JP)) {
+ returnData[key] = trainDiagram[key];
+ }
+ });
+ }
+ setTrainDiagram(trainDiagram);
+ setStationDiagram(returnData);
+ });
+ }, []);
+ const getTime = () => {
+ const returnData = [];
+ const date = new Date();
+ Object.keys(stationDiagram).forEach((d) => {
+ let a = (() => {
+ let returnData = {};
+ stationDiagram[d].split("#").forEach((data) => {
+ if (data.match("着")) {
+ returnData.lastStation = data.split(",着,")[0];
+ }
+ if (data.match(props.station.Station_JP)) {
+ if (data.match(",発,")) {
+ returnData.time = data.split(",発,")[1];
+ } else {
+ returnData.time = data.split(",着,")[1];
+ returnData.lastStation = "当駅止";
+ }
+ }
+ });
+ return returnData;
+ })();
+ returnData.push({ train: d, time: a.time, lastStation: a.lastStation });
+ });
+
+ return returnData.sort((a, b) => {
+ if (parseInt(a.time.split(":")[0]) < parseInt(b.time.split(":")[0])) {
+ return -1;
+ } else if (
+ parseInt(a.time.split(":")[0]) > parseInt(b.time.split(":")[0])
+ ) {
+ return 1;
+ } else if (
+ parseInt(a.time.split(":")[1]) < parseInt(b.time.split(":")[1])
+ ) {
+ return -1;
+ } else if (
+ parseInt(a.time.split(":")[1]) > parseInt(b.time.split(":")[1])
+ ) {
+ return 1;
+ }
+ });
+ };
+ const trainTimeAndNumber = stationDiagram != null ? getTime() : null;
+ useEffect(() => {
+ const getCurrentTrain = () =>
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train",
+ HeaderConfig
+ )
+ .then((response) => response.json())
+ .then((d) => d.map((x) => ({ num: x.TrainNum, delay: x.delay })))
+ .then((d) => setCurrentTrain(d));
+ getCurrentTrain();
+ const currentTrainInterval = setInterval(() => getCurrentTrain(), 15000);
+ return () => clearInterval(currentTrainInterval);
+ }, []);
+
+ const filtering = (d) => currentTrain.map((m) => m.num).includes(d.train);
+ console.log(new Date());
+ const timeFiltering = (d) => {
+ const date = new Date();
+ const newDate = new Date();
+ let data = d.time.split(":");
+ let delay = isNaN(
+ currentTrain.filter((data) => data.num == d.train)[0].delay
+ )
+ ? 0
+ : currentTrain.filter((data) => data.num == d.train)[0].delay;
+
+ date.setHours(parseInt(data[0]));
+ date.setMinutes(parseInt(data[1]) + parseInt(delay));
+ console.log(date);
+ console.log(newDate);
+ if (!(newDate > date)) {
+ return true;
+ }
+
+ return false;
+ };
+ const finalFiltering = (d) => {
+ if (finalSwitch) {
+ return true;
+ } else {
+ if (d.lastStation == "当駅止") {
+ return false;
+ }
+ return true;
+ }
+ };
+ return (
+
+
+
+
+
+ 次の列車
+
+ Next Train
+
+
+
+ {trainTimeAndNumber
+ ? currentTrain &&
+ trainTimeAndNumber
+ .filter(filtering)
+ .filter(timeFiltering)
+ .filter(finalFiltering)
+ .map((d, index) => [
+
+
+ {
+ if (
+ customTrainDataDetector(d.train).trainName.length > 6
+ ) {
+ return 15;
+ } else {
+ return 20;
+ }
+ })(),
+ color: (() => {
+ switch (customTrainDataDetector(d.train).type) {
+ case "Rapid":
+ return "aqua";
+ case "LTDEXP":
+ return "red";
+ case "NightLTDEXP":
+ return "red";
+ case "Normal":
+ return "white";
+ }
+ })(),
+ fontWeight: "bold",
+ }}
+ >
+ {trainIDSwitch
+ ? d.train
+ : (() => {
+ switch (customTrainDataDetector(d.train).type) {
+ case "Rapid":
+ return "快速";
+ case "LTDEXP":
+ return "特急";
+ case "NightLTDEXP":
+ return "寝台特急";
+ case "Normal":
+ return "普通列車";
+ }
+ })() +
+ " " +
+ customTrainDataDetector(d.train).trainName +
+ (() => {
+ if (
+ customTrainDataDetector(d.train).trainNumDistance !=
+ null
+ ) {
+ return (
+ parseInt(
+ d.train.replace("M", "").replace("D", "")
+ ) -
+ customTrainDataDetector(d.train)
+ .trainNumDistance +
+ "号"
+ );
+ } else {
+ return "";
+ }
+ })()}
+
+
+
+ 4 ? 15 : 20,
+ color: "white",
+ fontWeight: "bold",
+ }}
+ >
+ {d.lastStation}
+
+
+
+
+ {d.time}
+
+
+
+
+ {(() => {
+ let data = currentTrain.filter(
+ (data) => data.num == d.train
+ )[0].delay;
+ if (isNaN(data)) {
+ return data;
+ } else if (data == 0) {
+ return "定刻通り";
+ } else {
+ return data + "分遅れ";
+ }
+ })()}
+
+
+ ,
+ Boolean(trainDescriptionSwitch) &&
+ Boolean(customTrainDataDetector(d.train).info) && (
+
+
+
+ {" "}
+ > {customTrainDataDetector(d.train).info}
+
+
+
+ ),
+ ])
+ : null}
+
+
+ 種別名 / 列番
+
+ setTrainIDSwitch(!trainIDSwitch)}
+ />
+
+
+ 列車情報
+
+
+ setTrainDescriptionSwitch(!trainDescriptionSwitch)
+ }
+ />
+
+
+ 当駅止表示
+
+ setFinalSwitch(!finalSwitch)}
+ />
+
+
+ );
}
diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js
index ce77ce5..cbefea4 100644
--- a/components/駅名表/Sign.js
+++ b/components/駅名表/Sign.js
@@ -1,106 +1,311 @@
-import React, { Component, useRef, useState, useEffect } from 'react';
-import {StatusBar,View,LayoutAnimation,ScrollView,Linking,Text,TouchableOpacity } from 'react-native';
-import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
+import React, { Component, useRef, useState, useEffect } from "react";
+import {
+ StatusBar,
+ View,
+ LayoutAnimation,
+ ScrollView,
+ Linking,
+ Text,
+ TouchableOpacity,
+} from "react-native";
+import {
+ widthPercentageToDP as wp,
+ heightPercentageToDP as hp,
+} from "react-native-responsive-screen";
-
-export default function Sign(props){
- const {currentStation, originalStationList, oP} = props;
- const getPreNextStation = (now) =>{
- const lineList = ["予讃線", "松宇線", "伊予灘線", "土讃線", "窪川線", "高徳線", "徳島線", "鳴門線"];
- let returnData;
- lineList.forEach(d=>{
- let cache = originalStationList[d].findIndex( data => data.StationNumber == now.StationNumber);
- if(cache != -1){
- returnData = [originalStationList[d][cache-1],originalStationList[d][cache+1]]
+export default function Sign(props) {
+ const { currentStation, originalStationList, oP } = props;
+ const getPreNextStation = (now) => {
+ const lineList = [
+ "予讃線",
+ "松宇線",
+ "伊予灘線",
+ "土讃線",
+ "窪川線",
+ "高徳線",
+ "徳島線",
+ "鳴門線",
+ ];
+ let returnData;
+ lineList.forEach((d) => {
+ let cache = originalStationList[d].findIndex(
+ (data) => data.StationNumber == now.StationNumber
+ );
+ if (cache != -1) {
+ returnData = [
+ originalStationList[d][cache - 1],
+ originalStationList[d][cache + 1],
+ ];
+ }
+ });
+ return returnData;
+ };
+ const [nexPrePosition, setNexPrePosition] = useState(0);
+ useEffect(() => {
+ if (currentStation) {
+ if (currentStation.length > 1) {
+ let stationCount = setInterval(() => {
+ LayoutAnimation.easeInEaseOut();
+ if (nexPrePosition + 1 == currentStation.length) {
+ setNexPrePosition(0);
+ } else {
+ setNexPrePosition(nexPrePosition + 1);
}
-
- })
- return returnData;
- }
- const [nexPrePosition, setNexPrePosition] = useState(0);
- useEffect(()=>{
- if(currentStation){
- if(currentStation.length > 1){
- let stationCount = setInterval(()=>{
- LayoutAnimation.easeInEaseOut();
- if(nexPrePosition+1 == currentStation.length){
- setNexPrePosition(0)
- }
- else{
- setNexPrePosition(nexPrePosition+1);
- }
-
- },1000)
- return ()=>clearInterval(stationCount);
- }
- }
- },[currentStation])
- return(
- !stationName.今.JrHpUrl || Linking.openURL(stationName.今.JrHpUrl)} */onPress={oP}>
-
- JR
- {currentStation.map((d,index,array)=>
- {
- if(array.length == 1) return 20;
- else if(index == 0) return 5;
- else if(index == 1) return 35;
+ }, 1000);
+ return () => clearInterval(stationCount);
+ }
+ }
+ }, [currentStation]);
+ return (
+ !stationName.今.JrHpUrl || Linking.openURL(stationName.今.JrHpUrl)} */ onPress={
+ oP
+ }
+ >
+
+
+ JR
+
+ {currentStation.map((d, index, array) => (
+ {
+ if (array.length == 1) return 20;
+ else if (index == 0) return 5;
+ else if (index == 1) return 35;
else return 20;
- })()+"%",right:'10%',width:wp("10%"),height:wp("10%"),borderColor:"#2E94BB",borderWidth:parseInt("2%"),borderRadius:parseInt("100%")}} >
-
- {d.StationNumber}
-
+ })() + "%",
+ right: "10%",
+ width: wp("10%"),
+ height: wp("10%"),
+ borderColor: "#2E94BB",
+ borderWidth: parseInt("2%"),
+ borderRadius: parseInt("100%"),
+ }}
+ >
+
+ {d.StationNumber}
+
+
+ ))}
+
+
+
+ {/* {stationName.今.LineName} */}
+
+ {currentStation[0].Station_JP}
+
+
+ {currentStation[0].Station_EN}
+
+
+
+
+
+ {(() => {
+ return currentStation.map((currentStation) => {
+ let [preStation, nexStation] = getPreNextStation(currentStation);
+ return (
+
+
+ {preStation && [
+
+ ◀
+ ,
+
+
+
+ {preStation.StationNumber}
+
+
+ ,
+
+
+ {preStation.Station_JP}
+
+
+ {preStation.Station_EN}
+
+ ,
+ ]}
+
+
+ {nexStation && [
+
+
+ {nexStation.Station_JP}
+
+
+ {nexStation.Station_EN}
+
+ ,
+
+
+
+ {nexStation.StationNumber}
+
+
+ ,
+
+ ▶
+ ,
+ ]}
+
- )}
-
-
-
- {/* {stationName.今.LineName} */}
- {currentStation[0].Station_JP}
- {currentStation[0].Station_EN}
-
-
-
-
-
- {(()=>{return currentStation.map(currentStation =>{
- let [preStation, nexStation] = getPreNextStation(currentStation)
- return(
-
-
- {preStation &&
- [◀,
-
-
- {preStation.StationNumber}
-
- ,
-
- {preStation.Station_JP}
- {preStation.Station_EN}
- ]}
-
-
-
- {nexStation &&
- [
- {nexStation.Station_JP}
- {nexStation.Station_EN}
- ,
-
-
- {nexStation.StationNumber}
-
- ,
- ▶]}
-
-
- )
- })[nexPrePosition]
-
- })()}
-
-
-
-
- )
-}
\ No newline at end of file
+ );
+ })[nexPrePosition];
+ })()}
+
+
+ );
+}
diff --git a/config/newsUpdate.js b/config/newsUpdate.js
index ef3405d..c807ca8 100644
--- a/config/newsUpdate.js
+++ b/config/newsUpdate.js
@@ -1 +1 @@
-export const news = "2022-6-11";
+export const news = "2022-9-30";
diff --git a/eas.json b/eas.json
index 2e57c03..533961a 100644
--- a/eas.json
+++ b/eas.json
@@ -10,11 +10,11 @@
"preview": {
"distribution": "internal"
},
- "mapsbuild":{
+ "mapsbuild": {
"releaseChannel": "mapsbuild"
},
"production": {
- "releaseChannel": "release"
+ "releaseChannel": "aliexpress"
}
},
"submit": {
diff --git a/howto.js b/howto.js
index 197ce42..fb9c3d3 100644
--- a/howto.js
+++ b/howto.js
@@ -1,16 +1,30 @@
const WEBVIEW = "WEBVIEW";
-import React, { Component } from 'react';
-import { StatusBar,View} from 'react-native';
-import {WebView} from 'react-native-webview';
-export default class howto extends Component {
- render() {
- return (
-
-
-
-
-
-
- );
- }
-}
\ No newline at end of file
+import React, { Component } from "react";
+import { StatusBar, View, TouchableOpacity, Text } from "react-native";
+import { WebView } from "react-native-webview";
+export default ({ navigation: { navigate } }) => (
+
+
+ navigate("Apps")}
+ >
+
+
+ 閉じる
+
+
+
+
+);
diff --git a/menu.js b/menu.js
index bc1f9ba..2c20435 100644
--- a/menu.js
+++ b/menu.js
@@ -1,440 +1,1058 @@
-import React, { Component, useRef, useState, useEffect } from 'react';
-import {StatusBar,Platform,View,LayoutAnimation,ScrollView,Linking,Text,TouchableOpacity } from 'react-native';
-import Image from 'react-native-remote-svg';
-import Constants from 'expo-constants';
-import { List, ListItem } from 'native-base';
-import Icon from 'react-native-vector-icons/Entypo';
-import * as Location from 'expo-location';
-import StatusbarDetect from './StatusbarDetect';
+import React, { Component, useRef, useState, useEffect } from "react";
+import {
+ StatusBar,
+ Platform,
+ View,
+ LayoutAnimation,
+ ScrollView,
+ Linking,
+ Text,
+ TouchableOpacity,
+} from "react-native";
+import Image from "react-native-remote-svg";
+import Constants from "expo-constants";
+import { List, ListItem } from "native-base";
+import Icon from "react-native-vector-icons/Entypo";
+import * as Location from "expo-location";
+import StatusbarDetect from "./StatusbarDetect";
var Status = StatusbarDetect();
-import { useNavigation } from '@react-navigation/native';
-import AutoHeightImage from 'react-native-auto-height-image';
-import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
-import { FontAwesome, Fontisto, Foundation, Ionicons, MaterialCommunityIcons } from '@expo/vector-icons';
-import * as WebBrowser from 'expo-web-browser';
+import { useNavigation } from "@react-navigation/native";
+import AutoHeightImage from "react-native-auto-height-image";
+import {
+ widthPercentageToDP as wp,
+ heightPercentageToDP as hp,
+} from "react-native-responsive-screen";
+import {
+ FontAwesome,
+ Fontisto,
+ Foundation,
+ Ionicons,
+ MaterialCommunityIcons,
+} from "@expo/vector-icons";
+import * as WebBrowser from "expo-web-browser";
import ActionSheet from "react-native-actions-sheet";
-import LottieView from 'lottie-react-native';
-import SvgUri from 'react-native-svg-uri';
+import LottieView from "lottie-react-native";
+import SvgUri from "react-native-svg-uri";
+import 予讃線 from "./assets/四国旅客鉄道予讃線.json";
+import 土讃線 from "./assets/四国旅客鉄道土讃線.json";
+import 高徳線 from "./assets/四国旅客鉄道高徳線.json";
+import 内子線 from "./assets/四国旅客鉄道内子線.json";
+import 徳島線 from "./assets/四国旅客鉄道徳島線.json";
+import 鳴門線 from "./assets/四国旅客鉄道鳴門線.json";
+import LED_vision from "./components/発車時刻表/LED_vidion";
+import Sign from "./components/駅名表/Sign";
-import 予讃線 from './assets/四国旅客鉄道予讃線.json';
-import 土讃線 from './assets/四国旅客鉄道土讃線.json';
-import 高徳線 from './assets/四国旅客鉄道高徳線.json';
-import 内子線 from './assets/四国旅客鉄道内子線.json';
-import 徳島線 from './assets/四国旅客鉄道徳島線.json';
-import 鳴門線 from './assets/四国旅客鉄道鳴門線.json'
-import LED_vision from './components/発車時刻表/LED_vidion';
-import Sign from './components/駅名表/Sign';
-
-
-
-const UsefulBox = (props) =>{
+const UsefulBox = (props) => {
const { icon, backgroundColor, flex, onPressButton, children } = props;
- return(
-
-
- {children}
+ return (
+
+
+
+ {children}
+
- )
-}
-const TicketBox = (props) =>{
+ );
+};
+const TicketBox = (props) => {
const { icon, backgroundColor, flex, onPressButton, children } = props;
- return(
-
- {children}
+ return (
+
+
+ {children}
+
{icon}
- )
-}
+ );
+};
-const TextBox = (props) =>{
+const TextBox = (props) => {
const { backgroundColor, flex, onPressButton, children } = props;
- return(
-
-
- {children}
-
+ return (
+
+
+ {children}
+
- )
-}
+ );
+};
export default function Menu(props) {
- const { navigation: { navigate } } = props;
+ const {
+ navigation: { navigate },
+ } = props;
const JRSTraInfoEXAcSR = useRef(null);
const StationBoardAcSR = useRef(null);
const navigation = useNavigation();
-
-
//位置情報
const [location, setLocation] = useState(null);
const [errorMsg, setErrorMsg] = useState(null);
useEffect(() => {
- Location.requestForegroundPermissionsAsync().then(data=>{
- if (data.status !== 'granted') {
- setErrorMsg('Permission to access location was denied');
- return ()=>{};
+ Location.requestForegroundPermissionsAsync().then((data) => {
+ if (data.status !== "granted") {
+ setErrorMsg("Permission to access location was denied");
+ return () => {};
}
- Location.getCurrentPositionAsync({}).then(location=>setLocation(location))
- })
+ Location.getCurrentPositionAsync({}).then((location) =>
+ setLocation(location)
+ );
+ });
setInterval(() => {
- Location.getCurrentPositionAsync({}).then(location=>setLocation(location))
+ Location.getCurrentPositionAsync({}).then((location) =>
+ setLocation(location)
+ );
}, 10000);
- },[])
+ }, []);
- const [originalStationList , setOriginalStationList] = useState();
- useEffect(()=>{ //駅リストイニシャライズ
+ const [originalStationList, setOriginalStationList] = useState();
+ useEffect(() => {
+ //駅リストイニシャライズ
const HeaderConfig = {
- headers:{
- 'referer':'https://train.jr-shikoku.co.jp/sp.html'
- }
- }
+ headers: {
+ referer: "https://train.jr-shikoku.co.jp/sp.html",
+ },
+ };
Promise.all([
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=yosan', HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=uwajima',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=uwajima2',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=dosan',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=dosan2',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=koutoku',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=tokushima',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=naruto',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=station&arg2=between',HeaderConfig).then(response => response.json()),
- fetch('https://train.jr-shikoku.co.jp/g?arg1=line&arg2=train_lang',HeaderConfig).then(response => response.json())
- ]).then(values =>{
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=yosan",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=uwajima",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=uwajima2",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=dosan",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=dosan2",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=koutoku",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=tokushima",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=naruto",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=station&arg2=between",
+ HeaderConfig
+ ).then((response) => response.json()),
+ fetch(
+ "https://train.jr-shikoku.co.jp/g?arg1=line&arg2=train_lang",
+ HeaderConfig
+ ).then((response) => response.json()),
+ ]).then((values) => {
let stationList = {};
- [stationList.予讃線, stationList.松宇線, stationList.伊予灘線, stationList.土讃線, stationList.窪川線, stationList.高徳線, stationList.徳島線, stationList.鳴門線, stationList.駅間リスト,stationList.日英対応表] = values;
-
+ [
+ stationList.予讃線,
+ stationList.松宇線,
+ stationList.伊予灘線,
+ stationList.土讃線,
+ stationList.窪川線,
+ stationList.高徳線,
+ stationList.徳島線,
+ stationList.鳴門線,
+ stationList.駅間リスト,
+ stationList.日英対応表,
+ ] = values;
+
const concatBetweenStations = (eachRouteData) => {
let additional = [];
- eachRouteData.forEach((routeData,routeIndex) => {
- try{
- const currentStationID = parseInt(routeData.StationNumber.replace(/[A-Z]/g,""))
- const nextStationID = parseInt(eachRouteData[routeIndex+1].StationNumber.replace(/[A-Z]/g,""))
- if((nextStationID-currentStationID) != 1){
- stationList.駅間リスト.forEach(betweenList=>{
- if(betweenList.BetweenStation == (routeData.Station_JP+"~"+eachRouteData[routeIndex+1].Station_JP)){
+ eachRouteData.forEach((routeData, routeIndex) => {
+ try {
+ const currentStationID = parseInt(
+ routeData.StationNumber.replace(/[A-Z]/g, "")
+ );
+ const nextStationID = parseInt(
+ eachRouteData[routeIndex + 1].StationNumber.replace(/[A-Z]/g, "")
+ );
+ if (nextStationID - currentStationID != 1) {
+ stationList.駅間リスト.forEach((betweenList) => {
+ if (
+ betweenList.BetweenStation ==
+ routeData.Station_JP +
+ "~" +
+ eachRouteData[routeIndex + 1].Station_JP
+ ) {
additional = additional.concat(betweenList.Datas);
}
- })
- }
- }catch(e){}
+ });
+ }
+ } catch (e) {}
});
- return(eachRouteData.concat(additional).sort((a,b)=> (a.StationNumber > b.StationNumber) ? 1 : -1 ))
- }
- const addStationPosition = (setDataBase, geoJson, EnJpList) =>{
- return setDataBase.map((data)=>{
+ return eachRouteData
+ .concat(additional)
+ .sort((a, b) => (a.StationNumber > b.StationNumber ? 1 : -1));
+ };
+ const addStationPosition = (setDataBase, geoJson, EnJpList) => {
+ return setDataBase.map((data) => {
let stationName;
- if(data.hasOwnProperty("Station_JP")) stationName = data.Station_JP;
- else if(data.hasOwnProperty("StationName")){
+ if (data.hasOwnProperty("Station_JP")) stationName = data.Station_JP;
+ else if (data.hasOwnProperty("StationName")) {
stationName = data.StationName;
data.Station_JP = data.StationName;
- data.Station_EN = EnJpList.find(d=>d.Station_JP == data.Station_JP).Station_EN
+ data.Station_EN = EnJpList.find(
+ (d) => d.Station_JP == data.Station_JP
+ ).Station_EN;
}
- geoJson.features.filter(d=>d.geometry.type == "Point").forEach(element =>{
- if(element.properties.name == stationName){
- data.lat = element.geometry.coordinates[1];
- data.lng = element.geometry.coordinates[0];
- }
- });
+ geoJson.features
+ .filter((d) => d.geometry.type == "Point")
+ .forEach((element) => {
+ if (element.properties.name == stationName) {
+ data.lat = element.geometry.coordinates[1];
+ data.lng = element.geometry.coordinates[0];
+ }
+ });
return data;
- })
- }
- stationList.予讃線 = addStationPosition(concatBetweenStations(stationList.予讃線), 予讃線, stationList.日英対応表);
- stationList.松宇線 = addStationPosition(concatBetweenStations(stationList.松宇線), 予讃線, stationList.日英対応表);
- stationList.伊予灘線 = addStationPosition(concatBetweenStations(stationList.伊予灘線), 予讃線, stationList.日英対応表);
- stationList.土讃線 = addStationPosition(concatBetweenStations(stationList.土讃線), 土讃線, stationList.日英対応表);
- stationList.窪川線 = addStationPosition(concatBetweenStations(stationList.窪川線), 土讃線, stationList.日英対応表);
- stationList.高徳線 = addStationPosition(concatBetweenStations(stationList.高徳線), 高徳線, stationList.日英対応表);
- stationList.徳島線 = addStationPosition(concatBetweenStations(stationList.徳島線), 徳島線, stationList.日英対応表);
- stationList.鳴門線 = addStationPosition(concatBetweenStations(stationList.鳴門線), 鳴門線, stationList.日英対応表);
+ });
+ };
+ stationList.予讃線 = addStationPosition(
+ concatBetweenStations(stationList.予讃線),
+ 予讃線,
+ stationList.日英対応表
+ );
+ stationList.松宇線 = addStationPosition(
+ concatBetweenStations(stationList.松宇線),
+ 予讃線,
+ stationList.日英対応表
+ );
+ stationList.伊予灘線 = addStationPosition(
+ concatBetweenStations(stationList.伊予灘線),
+ 予讃線,
+ stationList.日英対応表
+ );
+ stationList.土讃線 = addStationPosition(
+ concatBetweenStations(stationList.土讃線),
+ 土讃線,
+ stationList.日英対応表
+ );
+ stationList.窪川線 = addStationPosition(
+ concatBetweenStations(stationList.窪川線),
+ 土讃線,
+ stationList.日英対応表
+ );
+ stationList.高徳線 = addStationPosition(
+ concatBetweenStations(stationList.高徳線),
+ 高徳線,
+ stationList.日英対応表
+ );
+ stationList.徳島線 = addStationPosition(
+ concatBetweenStations(stationList.徳島線),
+ 徳島線,
+ stationList.日英対応表
+ );
+ stationList.鳴門線 = addStationPosition(
+ concatBetweenStations(stationList.鳴門線),
+ 鳴門線,
+ stationList.日英対応表
+ );
setOriginalStationList(stationList);
});
- },[])
+ }, []);
-
-
- const [stationName,setStationName] = useState(undefined);
+ const [stationName, setStationName] = useState(undefined);
const [currentStation, setCurrentStation] = useState(undefined);
- useEffect(()=>{
- if(!location) return ()=>{};
- if(!originalStationList) return ()=>{};
+ useEffect(() => {
+ if (!location) return () => {};
+ if (!originalStationList) return () => {};
const findStationEachLine = (selectLine) => {
const searchArea = 0.0015;
- const _calcDistance = (from, to) =>{
+ const _calcDistance = (from, to) => {
let lat = Math.abs(from.lat - to.lat);
let lng = Math.abs(from.lng - to.lng);
- return Math.sqrt((lat*lat)+(lng*lng))
- }
- let NearStation = selectLine.filter(d=>_calcDistance(d,{lat:location.coords.latitude,lng:location.coords.longitude}) < searchArea);
+ return Math.sqrt(lat * lat + lng * lng);
+ };
+ let NearStation = selectLine.filter(
+ (d) =>
+ _calcDistance(d, {
+ lat: location.coords.latitude,
+ lng: location.coords.longitude,
+ }) < searchArea
+ );
return NearStation;
- }
+ };
- const lineList = ["予讃線", "松宇線", "伊予灘線", "土讃線", "窪川線", "高徳線", "徳島線", "鳴門線"];
- console.log(lineList.map(d=>findStationEachLine(originalStationList[d])).filter(d=>d.length > 0).reduce((pre,current) => {pre.push(...current);return pre},[]));
- let returnDataBase = lineList.map(d=>findStationEachLine(originalStationList[d])).filter(d=>d.length > 0).reduce((pre,current) => {pre.push(...current);return pre},[]);
- LayoutAnimation.spring()
- if(returnDataBase.length){
+ const lineList = [
+ "予讃線",
+ "松宇線",
+ "伊予灘線",
+ "土讃線",
+ "窪川線",
+ "高徳線",
+ "徳島線",
+ "鳴門線",
+ ];
+ console.log(
+ lineList
+ .map((d) => findStationEachLine(originalStationList[d]))
+ .filter((d) => d.length > 0)
+ .reduce((pre, current) => {
+ pre.push(...current);
+ return pre;
+ }, [])
+ );
+ let returnDataBase = lineList
+ .map((d) => findStationEachLine(originalStationList[d]))
+ .filter((d) => d.length > 0)
+ .reduce((pre, current) => {
+ pre.push(...current);
+ return pre;
+ }, []);
+ LayoutAnimation.spring();
+ if (returnDataBase.length) {
let currentStation = currentStation == undefined ? [] : currentStation;
- if(currentStation.toString() != returnDataBase.toString()){
+ if (currentStation.toString() != returnDataBase.toString()) {
setCurrentStation(returnDataBase);
}
- }
- else{
+ } else {
setCurrentStation(undefined);
- StationBoardAcSR.current?.hide()
+ StationBoardAcSR.current?.hide();
}
-
- },[location,originalStationList])
-
- useEffect(()=>{
- console.log("test")
- console.log(currentStation)
- },[currentStation])
-
-
+ }, [location, originalStationList]);
+ useEffect(() => {
+ console.log("test");
+ console.log(currentStation);
+ }, [currentStation]);
const LottieRef = useRef(null);
const LottieRef2 = useRef(null);
- const [count,setCount] =useState(0);
- const [delayData,setDelayData] = useState(undefined);
- const [getTime,setGetTime] = useState(new Date());
- const [loadingDelayData,setLoadingDelayData] = useState(true);
+ const [count, setCount] = useState(0);
+ const [delayData, setDelayData] = useState(undefined);
+ const [getTime, setGetTime] = useState(new Date());
+ const [loadingDelayData, setLoadingDelayData] = useState(true);
- useEffect(()=>{
- fetch("https://script.google.com/macros/s/AKfycbyKxch7z7l8e07LXulRHqxjVoIiB13kcgvoToLE-rqlxLmLSKdlmqz0FI1F2EuA7Zfg/exec")
- .then(response => response.text())
- .then(data => {if(data != ""){setDelayData(data.split("^"))}else setDelayData(null)})
- .then(data => LayoutAnimation.easeInEaseOut())
- .then(()=>setGetTime(new Date()))
- .finally(()=>setLoadingDelayData(false));
- },[loadingDelayData])
+ useEffect(() => {
+ fetch(
+ "https://script.google.com/macros/s/AKfycbyKxch7z7l8e07LXulRHqxjVoIiB13kcgvoToLE-rqlxLmLSKdlmqz0FI1F2EuA7Zfg/exec"
+ )
+ .then((response) => response.text())
+ .then((data) => {
+ if (data != "") {
+ setDelayData(data.split("^"));
+ } else setDelayData(null);
+ })
+ .then((data) => LayoutAnimation.easeInEaseOut())
+ .then(() => setGetTime(new Date()))
+ .finally(() => setLoadingDelayData(false));
+ }, [loadingDelayData]);
- useEffect(()=>{
- try{
+ useEffect(() => {
+ try {
LottieRef?.current.play();
LottieRef2?.current.play();
- }catch(e){}
-
- })
- return (
-
- {Status}
-
- Linking.openURL("https://www.jr-shikoku.co.jp")}>
-
-
-
-
-
- Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/sp/")}>駅・鉄道情報
- Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/jikoku/sp/#mainprice-box")}>運賃表
- Linking.openURL("https://www.jr-shikoku.co.jp/e5489/")}>予約
-
- Linking.openURL("https://www.jr-shikoku.co.jp/02_information/suspension/sp/")}>
- 新型コロナウイルスに関するお知らせ
- 列車の運行計画・混雑状況・感染症対策への取り組み
-
- {currentStation && StationBoardAcSR.current?.setModalVisible()} />}
- {currentStation && }
- {JRSTraInfoEXAcSR.current?.setModalVisible()}}>
-
-
-
- 列車遅延速報EX
-
- {getTime ? getTime.toLocaleTimeString('ja-JP').split(":")[0]+":"+getTime.toLocaleTimeString('ja-JP').split(":")[1]: NaN}
- {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true)}}/>
-
-
- {loadingDelayData ?
-
-
-
- : delayData ? delayData.map((d)=>{
+ } catch (e) {}
+ });
+ return (
+
+ {Status}
+
+ Linking.openURL("https://www.jr-shikoku.co.jp")}
+ >
+
+
+
+
+
+
+ Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/sp/")
+ }
+ >
+ 駅・鉄道情報
+
+
+ Linking.openURL(
+ "https://www.jr-shikoku.co.jp/01_trainbus/jikoku/sp/#mainprice-box"
+ )
+ }
+ >
+ 運賃表
+
+
+ Linking.openURL("https://www.jr-shikoku.co.jp/e5489/")
+ }
+ >
+ 予約
+
+
+
+ Linking.openURL(
+ "https://www.jr-shikoku.co.jp/02_information/suspension/sp/"
+ )
+ }
+ >
+
+ 新型コロナウイルスに関するお知らせ
+
+
+ 列車の運行計画・混雑状況・感染症対策への取り組み
+
+
+ {currentStation && (
+ StationBoardAcSR.current?.setModalVisible()}
+ />
+ )}
+ {currentStation && }
+ {
+ JRSTraInfoEXAcSR.current?.setModalVisible();
+ }}
+ >
+
+
+
+
+ 列車遅延速報EX
+
+
+
+ {getTime
+ ? getTime.toLocaleTimeString("ja-JP").split(":")[0] +
+ ":" +
+ getTime.toLocaleTimeString("ja-JP").split(":")[1]
+ : NaN}
+
+ {
+ LayoutAnimation.easeInEaseOut(), setLoadingDelayData(true);
+ }}
+ />
+
+
+ {loadingDelayData ? (
+
+
+
+ ) : delayData ? (
+ delayData.map((d) => {
let data = d.split(" ");
return (
-
- {data[0].replace("\n","")}
- {data[1]}
- {data[3]}
+
+
+ {data[0].replace("\n", "")}
+
+ {data[1]}
+ {data[3]}
);
- }) : 現在、5分以上の遅れはありません。}
-
-
-
-
- 詳細を見る
-
+ })
+ ) : (
+ 現在、5分以上の遅れはありません。
+ )}
+
+
+
+
+ 詳細を見る
+
+
-
-
-
+
+
-
- } flex={1} onPressButton={()=>Linking.openURL("https://www.jr-eki.com/ticket/brand")}>トクトク切符
- } flex={1} onPressButton={()=>Linking.openURL("https://www.jr-shikoku.co.jp/01_trainbus/event_train/sp/")}>観光列車
- } flex={1} onPressButton={()=>Linking.openURL("https://www.jr-eki.com/tour/brand")}>旅行ツアー
+
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL("https://www.jr-eki.com/ticket/brand")
+ }
+ >
+ トクトク切符
+
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(
+ "https://www.jr-shikoku.co.jp/01_trainbus/event_train/sp/"
+ )
+ }
+ >
+ 観光列車
+
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL("https://www.jr-eki.com/tour/brand")
+ }
+ >
+ 旅行ツアー
+
+
+
+ Linking.openURL(
+ "https://www.jr-shikoku.co.jp/sp/index.html#menu-box"
+ )
+ }
+ >
+
+ 臨時列車などのお知らせ
+
+
+ 区間縮小・計画運休・イベント・季節臨時列車など
+
+
+
+ Linking.openURL("https://www.jr-shikoku.co.jp/03_news/press/")
+ }
+ >
+
+ ニュースリリース
+
+
+ 公式プレス記事はこちら
+
+
+
+ Linking.openURL("https://www.jr-shikoku.co.jp/teiki/")
+ }
+ >
+
+ 定期運賃計算
+
+
+ 通常/学生/快て〜き等はこちら
+
+
+
+ Linking.openURL("https://www.jr-shikoku.co.jp/04_company/group/sp/")
+ }
+ >
+
+ JR四国のお店・サービス
+
+
+ JR四国グループの施設をご案内
+
+
+
+ Linking.openURL("https://www.jr-odekake.net/smt/")}
+ >
+
+ 時刻・運賃計算
+
+
+ (マイ・ダイヤ)
+
+
+
+ マイ・ダイヤはJR西日本提供のサービスです。
+
+
+ Linking.openURL("tel:0570-00-4592")}
+ >
+
+ JR四国案内センター
+
+
+ 0570-00-4592
+ (8:00~20:00 年中無休)
+ (通話料がかかります)
+
+
+
+
+
+
+ 公式Twitter一族
+
- Linking.openURL("https://www.jr-shikoku.co.jp/sp/index.html#menu-box")}>
- 臨時列車などのお知らせ
- 区間縮小・計画運休・イベント・季節臨時列車など
-
- Linking.openURL("https://www.jr-shikoku.co.jp/03_news/press/")}>
- ニュースリリース
- 公式プレス記事はこちら
-
- Linking.openURL("https://www.jr-shikoku.co.jp/teiki/")}>
- 定期運賃計算
- 通常/学生/快て〜き等はこちら
-
- Linking.openURL("https://www.jr-shikoku.co.jp/04_company/group/sp/")}>
- JR四国のお店・サービス
- JR四国グループの施設をご案内
-
-
- Linking.openURL("https://www.jr-odekake.net/smt/")}>
- 時刻・運賃計算
- (マイ・ダイヤ)
-
- マイ・ダイヤはJR西日本提供のサービスです。
-
- Linking.openURL("tel:0570-00-4592")}>
- JR四国案内センター
-
- 0570-00-4592
- (8:00~20:00 年中無休)
- (通話料がかかります)
-
+
+
+ Linking.openURL("https://twitter.com/JRshikoku_tokyo")
+ }
+ >
+ JR四国 東京営業情報【公式】
+
+
+
+
+ Linking.openURL("https://twitter.com/JRshikoku_osaka")
+ }
+ >
+ JR四国 大阪営業部【公式】
+
+
+
+ Linking.openURL("https://twitter.com/shikoku_DC")}
+ >
+ JR四国営業部 四国DC情報【公式】
+
+
+
+
+ Linking.openURL("https://twitter.com/jr_shikoku_info")
+ }
+ >
+ JR四国運行情報Twitter
+
+
+
+
+ Linking.openURL("https://twitter.com/Smile_Eki_Chan")
+ }
+ >
+ JR四国いそうろう妖精 すまいるえきちゃん♡【公式】
+
+
+
+
+ Linking.openURL("https://twitter.com/JR_Shikoku_DPT")
+ }
+ >
+ JR四国デザインPT♡
+
+
+
+ Linking.openURL("https://twitter.com/PT2nd_Yuki")}
+ >
+ JR四国デザインPT弐号◇
+
+
+
-
-
-
- 公式Twitter一族
-
-
- Linking.openURL("https://twitter.com/JRshikoku_tokyo")}>
- JR四国 東京営業情報【公式】
-
-
-
- Linking.openURL("https://twitter.com/JRshikoku_osaka")}>
- JR四国 大阪営業部【公式】
-
-
-
- Linking.openURL("https://twitter.com/shikoku_DC")}>
- JR四国営業部 四国DC情報【公式】
-
-
-
- Linking.openURL("https://twitter.com/jr_shikoku_info")}>
- JR四国運行情報Twitter
-
-
-
- Linking.openURL("https://twitter.com/Smile_Eki_Chan")}>
- JR四国いそうろう妖精 すまいるえきちゃん♡【公式】
-
-
-
- Linking.openURL("https://twitter.com/JR_Shikoku_DPT")}>
- JR四国デザインPT♡
-
-
-
- Linking.openURL("https://twitter.com/PT2nd_Yuki")}>
- JR四国デザインPT弐号◇
-
-
-
-
-
- このアプリについて
- このアプリはXprocess(HARUKIN)が製作しているJR四国の完全非公式アシストアプリケーションです。このアプリに関することでのJR四国公式へ問合せすることはお控えください。以下のTwitterよりお願いします。
- 2022/4/14 4.1公開!列車アイコン表示が開始しました。
- 2021/6/23 4.0公開!ホーム画面を大改造しました。
- Linking.openURL("https://twitter.com/Xprocess_main")}>
- XprocessのTwitter
- 制作運営のTwitterです。
-
- navigate('setting')}>
- アプリの設定
- アプリの設定画面を表示します。
-
-
-
- {}}>
-
-
-
-
-
- 列車遅延速報EX
-
- {/* {doFetch()}}>
+
+
+ このアプリについて
+
+
+ このアプリはXprocess(HARUKIN)が製作しているJR四国の完全非公式アシストアプリケーションです。このアプリに関することでのJR四国公式へ問合せすることはお控えください。以下のTwitterよりお願いします。
+
+ 2022/4/14 4.1公開!列車アイコン表示が開始しました。
+ 2021/6/23 4.0公開!ホーム画面を大改造しました。
+
+ Linking.openURL("https://twitter.com/Xprocess_main")
+ }
+ >
+
+ XprocessのTwitter
+
+
+ 制作運営のTwitterです。
+
+
+ navigate("setting")}
+ >
+
+ アプリの設定
+
+
+ アプリの設定画面を表示します。
+
+
+
+
+ {}}
+ >
+
+
+
+
+
+
+ 列車遅延速報EX
+
+
+ {/* {doFetch()}}>
最新の情報へ更新
*/}
- {getTime ? getTime.toLocaleTimeString('ja-JP').split(":")[0]+":"+getTime.toLocaleTimeString('ja-JP').split(":")[1]: NaN}
- {LayoutAnimation.easeInEaseOut(),setLoadingDelayData(true)}}/>
+
+ {getTime
+ ? getTime.toLocaleTimeString("ja-JP").split(":")[0] +
+ ":" +
+ getTime.toLocaleTimeString("ja-JP").split(":")[1]
+ : NaN}{" "}
+
+ {
+ LayoutAnimation.easeInEaseOut(), setLoadingDelayData(true);
+ }}
+ />
+
+
+
+ {loadingDelayData ? (
+
+
-
+ ) : delayData ? (
+ delayData.map((d) => {
+ let data = d.split(" ");
+ return (
+
+
+ {data[0].replace("\n", "")}
+
+ {data[1]}
+ {data[3]}
+
+ );
+ })
+ ) : (
+ 現在、5分以上の遅れはありません。
+ )}
+
-
- {loadingDelayData ?
-
-
-
- : delayData ? delayData.map((d)=>{
- let data = d.split(" ");
- return (
-
- {data[0].replace("\n","")}
- {data[1]}
- {data[3]}
-
- );
- }) : 現在、5分以上の遅れはありません。}
-
-
-
- 列車遅延情報EXについて
- 列車遅延情報をJR四国公式列車運行情報より5分毎に取得します。Twitterにて投稿している内容と同一のものとなります。
-
- Linking.openURL("https://twitter.com/JRSTrainfoEX")}>
-
-
- TwitterBOTはこちら!
-
- →
+
+
+ 列車遅延情報EXについて
+
+
+ 列車遅延情報をJR四国公式列車運行情報より5分毎に取得します。Twitterにて投稿している内容と同一のものとなります。
+
+
+
+ Linking.openURL("https://twitter.com/JRSTrainfoEX")
+ }
+ >
+
+
+
+ TwitterBOTはこちら!
+
+
+
+ →
+
-
-
-
-
-
- {}}>
-
-
-
-
- {currentStation &&
- Linking.openURL(currentStation[0].StationTimeTable)} />}
- {currentStation &&
-
- {!currentStation[0].JrHpUrl ||} flex={1} onPressButton={()=> Linking.openURL(currentStation[0].JrHpUrl)}>web}
- {!currentStation[0].StationTimeTable || } flex={1} onPressButton={()=> Linking.openURL(currentStation[0].StationTimeTable)}>時刻表}
- {!currentStation[0].StationMap || } flex={1} onPressButton={()=> Linking.openURL(currentStation[0].StationMap)}>GoogleMap}
-
- }
-
-
-
-
-
-
- );
+
+
+
+ {}}
+ >
+
+
+
+
+
+ {currentStation && (
+ Linking.openURL(currentStation[0].StationTimeTable)}
+ />
+ )}
+ {currentStation && (
+
+ {!currentStation[0].JrHpUrl || (
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(currentStation[0].JrHpUrl)
+ }
+ >
+ web
+
+ )}
+ {!currentStation[0].StationTimeTable || (
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(currentStation[0].StationTimeTable)
+ }
+ >
+ 時刻表
+
+ )}
+ {!currentStation[0].StationMap || (
+ }
+ flex={1}
+ onPressButton={() =>
+ Linking.openURL(currentStation[0].StationMap)
+ }
+ >
+ GoogleMap
+
+ )}
+
+ )}
+
+
+
+
+ );
}
diff --git a/ndView.js b/ndView.js
index a585ac2..4e19c7e 100644
--- a/ndView.js
+++ b/ndView.js
@@ -1,18 +1,25 @@
-import React, { Component } from 'react';
-import { StatusBar,View,Linking,Platform,Text} from 'react-native';
-import {WebView} from 'react-native-webview';
-import Constants from 'expo-constants';
-import { TouchableOpacity } from 'react-native-gesture-handler';
-export default function tndView () {
+import React, { Component } from "react";
+import { StatusBar, View, Linking, Platform, Text } from "react-native";
+import { WebView } from "react-native-webview";
+import Constants from "expo-constants";
+import { TouchableOpacity } from "react-native-gesture-handler";
+export default function tndView() {
return (
-
-
+
+
);
}
@@ -20,4 +27,3 @@ const jsa = `
document.querySelector('.sitettl').style.display = 'none';
document.querySelector('.attention').style.display = 'none';
`;
-
diff --git a/package.json b/package.json
index 54cf739..0cc65e2 100644
--- a/package.json
+++ b/package.json
@@ -29,6 +29,7 @@
"react-native-auto-height-image": "^3.2.4",
"react-native-elements": "^3.4.2",
"react-native-gesture-handler": "~2.2.1",
+ "react-native-maps": "0.30.2",
"react-native-reanimated": "~2.8.0",
"react-native-remote-svg": "^2.0.6",
"react-native-responsive-screen": "^1.4.2",
diff --git a/trainbaseview.js b/trainbaseview.js
index 7198821..e8be5cd 100644
--- a/trainbaseview.js
+++ b/trainbaseview.js
@@ -1,14 +1,34 @@
-const WEBVIEW = "WEBVIEW";
-import React, { Component } from 'react';
-import { StatusBar,View} from 'react-native';
-import {WebView} from 'react-native-webview';
-export default function trainbase({route, navigation}) {
+import React, { Component, useRef } from "react";
+import { StatusBar, Platform, View } from "react-native";
+import { WebView } from "react-native-webview";
+
+export default function TrainBase({ route }) {
const { info } = route.params;
+ const webview = useRef();
+ const jss = `document.getElementById('Footer').style.display = 'none';
+ ${
+ Platform.OS == "ios" &&
+ `document.getElementsByTagName("html")[0].style['font-size'] = '11px';`
+ }`;
+ //const jss = `alert("ほげ")`;
+ console.log(info);
return (
-
-
+
+ {Platform.OS == "ios" && }
+ {}}
+ />
);
}
-
-const jss = `document.getElementById('Footer').style.display = 'none';`;
diff --git a/yarn.lock b/yarn.lock
index 2952033..073c70f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2977,6 +2977,11 @@
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
+"@types/geojson@^7946.0.7":
+ version "7946.0.8"
+ resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.8.tgz#30744afdb385e2945e22f3b033f897f76b1f12ca"
+ integrity sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==
+
"@types/graceful-fs@^4.1.2":
version "4.1.5"
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"
@@ -8618,6 +8623,14 @@ react-native-iphone-x-helper@^1.3.0:
resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz#20c603e9a0e765fd6f97396638bdeb0e5a60b010"
integrity sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg==
+react-native-maps@0.30.2:
+ version "0.30.2"
+ resolved "https://registry.yarnpkg.com/react-native-maps/-/react-native-maps-0.30.2.tgz#2f1cf4ab79892a43060774bda8786ce6ab8e3616"
+ integrity sha512-WVv5e7aWdnNJugqNSG/87U+12Pg4RFWU7x/UigTPG1FEUZx2TbYKChL6xZCMGPOv5m5b4Z7bMeKJnZosg+yPyQ==
+ dependencies:
+ "@types/geojson" "^7946.0.7"
+ deprecated-react-native-prop-types "^2.3.0"
+
react-native-ratings@8.0.4:
version "8.0.4"
resolved "https://registry.yarnpkg.com/react-native-ratings/-/react-native-ratings-8.0.4.tgz#efd5ebad8acc08bf98d34d39b18fb7a6813ef991"