Compare commits

..

No commits in common. "499e895165ae245f18c84550e3647cb1ff12fbdc" and "a5efb13506a1d1eeab6b4b98caa46bbe24fa9a45" have entirely different histories.

93 changed files with 6587 additions and 4930 deletions

41
Apps.js
View File

@ -14,51 +14,50 @@ export function AppContainer() {
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const { areaInfo, areaIconBadgeText, isInfo } = useAreaInfo(); const { areaInfo, areaIconBadgeText, isInfo } = useAreaInfo();
const navigationRef = React.useRef(); const navigationRef = React.useRef();
const getTabProps = (name, label, icon, iconFamily, tabBarBadge, isInfo) => ({ const getTabProps = (name, label, icon, iconFamily, tabBarBadge, style) => ({
name, name,
options: { options: {
tabBarLabel: label, tabBarLabel: label,
headerShown: false, headerTransparent: true,
gestureEnabled: true, gestureEnabled: true,
tabBarIcon: initIcon(icon, iconFamily,tabBarBadge,isInfo), tabBarIcon: initIcon(icon, iconFamily),
tabBarBadge,
tabBarBadgeStyle: style,
}, },
}); });
const [fontLoaded, error] = useFonts({ const [fontLoaded, error] = useFonts({
"JR-Nishi": require("./assets/fonts/jr-nishi.otf"), "JR-Nishi": require("./assets/fonts/jr-nishi.otf"),
Zou: require("./assets/fonts/DelaGothicOne-Regular.ttf"), "Zou": require("./assets/fonts/DelaGothicOne-Regular.ttf"),
}); });
return ( return (
<NavigationContainer ref={navigationRef}> <NavigationContainer name="Root" style={{ flex: 1 }} ref={navigationRef}>
<Tab.Navigator <Tab.Navigator
tabBarOptions={{ keyboardHidesTabBar: Platform.OS === "android" }} tabBarOptions={{ keyboardHidesTabBar: Platform.OS === "android" }}
initialRouteName="topMenu" initialRouteName="menuPage"
screenOptions={{
lazy: false,
animation: "shift",
}}
detachInactiveScreens={false}
lazy={false} lazy={false}
> >
<Tab.Screen <Tab.Screen
{...getTabProps("positions", "走行位置", "barchart", "AntDesign")} {...getTabProps("login", "位置情報", "barchart", "AntDesign")}
component={Top} children={(props) => <Top {...props} navigationRef={navigationRef} />}
/> />
<Tab.Screen <Tab.Screen
{...getTabProps("topMenu", "トップメニュー", "radio", "Ionicons")} {...getTabProps("menuPage", "リンク", "radio", "Ionicons")}
component={MenuPage} component={MenuPage}
/> />
<Tab.Screen <Tab.Screen
{...getTabProps( {...getTabProps(
"information", "home",
"運行情報", "運行情報",
"train", "train",
"Ionicons", "Ionicons",
areaInfo ? areaIconBadgeText : undefined, areaInfo ? areaIconBadgeText : undefined,
isInfo isInfo && {
backgroundColor: "#00b8ff",
color: "white",
}
)} )}
children={TNDView} children={(props) => <TNDView {...props} />}
/> />
</Tab.Navigator> </Tab.Navigator>
</NavigationContainer> </NavigationContainer>

View File

@ -1,11 +1,12 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { createStackNavigator } from "@react-navigation/stack"; import {
import { CommonActions } from "@react-navigation/native"; createStackNavigator,
TransitionPresets,
} from "@react-navigation/stack";
import { AS } from "./storageControl"; import { AS } from "./storageControl";
import TrainBase from "./components/trainbaseview"; import TrainBase from "./components/trainbaseview";
import HowTo from "./howto"; import HowTo from "./howto";
import Menu from "./menu"; import Menu from "./menu";
import News from "./components/news";
import Setting from "./components/Settings/settings"; import Setting from "./components/Settings/settings";
import { useFavoriteStation } from "./stateBox/useFavoriteStation"; import { useFavoriteStation } from "./stateBox/useFavoriteStation";
import { optionData } from "./lib/stackOption"; import { optionData } from "./lib/stackOption";
@ -13,7 +14,6 @@ import CurrentTrainListView from "./components/CurrentTrainListView";
import AllTrainDiagramView from "./components/AllTrainDiagramView"; import AllTrainDiagramView from "./components/AllTrainDiagramView";
import { useCurrentTrain } from "./stateBox/useCurrentTrain"; import { useCurrentTrain } from "./stateBox/useCurrentTrain";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { news } from "./config/newsUpdate";
const Stack = createStackNavigator(); const Stack = createStackNavigator();
export function MenuPage() { export function MenuPage() {
@ -24,19 +24,12 @@ export function MenuPage() {
useEffect(() => { useEffect(() => {
AS.getItem("startPage") AS.getItem("startPage")
.then((res) => { .then((res) => {
if (res == "true") navigation.navigate("positions"); if (res == "true") navigation.navigate("login");
}) })
.catch((e) => { .catch((e) => {
//6.0以降false //6.0以降false
AS.setItem("startPage", "false"); AS.setItem("startPage", "true");
}); });
//ニュース表示
AS.getItem("status")
.then((d) => {
if (d != news) navigation.navigate("topMenu", { screen: "news" });
})
.catch(() => navigation.navigate("topMenu", { screen: "news" }));
}, []); }, []);
useEffect(() => { useEffect(() => {
const unsubscribe = addListener("tabPress", (e) => { const unsubscribe = addListener("tabPress", (e) => {
@ -63,7 +56,6 @@ export function MenuPage() {
}} }}
children={() => <Menu getCurrentTrain={getCurrentTrain} />} children={() => <Menu getCurrentTrain={getCurrentTrain} />}
/> />
<Stack.Screen name="news" options={optionData} component={News} />
<Stack.Screen <Stack.Screen
name="setting" name="setting"
options={{ options={{
@ -75,8 +67,13 @@ export function MenuPage() {
/> />
<Stack.Screen <Stack.Screen
name="trainbase" name="trainbase"
options={{ ...optionData }} options={{ ...optionData, gestureResponseDistance: { vertical: 300 } }}
component={TrainBase} children={(props) => <TrainBase {...props} />}
/>
<Stack.Screen
name="currentTrainIDList"
options={{ ...optionData, gestureResponseDistance: { vertical: 300 } }}
component={CurrentTrainListView}
/> />
<Stack.Screen <Stack.Screen
name="AllTrainIDList" name="AllTrainIDList"

68
Top.js
View File

@ -1,6 +1,8 @@
import React, { useEffect } from "react"; import React, { useEffect, useRef, useState } from "react";
import { createStackNavigator } from "@react-navigation/stack"; import {
import { useNavigation } from "@react-navigation/native"; createStackNavigator,
TransitionPresets,
} from "@react-navigation/stack";
import Apps from "./components/Apps"; import Apps from "./components/Apps";
import TrainBase from "./components/trainbaseview"; import TrainBase from "./components/trainbaseview";
import HowTo from "./howto"; import HowTo from "./howto";
@ -8,67 +10,91 @@ import News from "./components/news";
import TrainMenu from "./components/trainMenu"; import TrainMenu from "./components/trainMenu";
import FavoriteList from "./components/FavoriteList"; import FavoriteList from "./components/FavoriteList";
import { optionData } from "./lib/stackOption"; import { optionData } from "./lib/stackOption";
import { useNavigation } from "@react-navigation/native";
import { useCurrentTrain } from "./stateBox/useCurrentTrain"; import { useCurrentTrain } from "./stateBox/useCurrentTrain";
import { useTrainMenu } from "./stateBox/useTrainMenu"; import { useTrainMenu } from "./stateBox/useTrainMenu";
import { AS } from "./storageControl"; import { AS } from "./storageControl";
import { news } from "./config/newsUpdate"; import { news } from "./config/newsUpdate";
const Stack = createStackNavigator(); const Stack = createStackNavigator();
export const Top = () => { export const Top = ({ navigationRef }) => {
const { webview } = useCurrentTrain(); const { webview } = useCurrentTrain();
const { navigate, addListener, isFocused } = useNavigation(); const { navigate, addListener } = useNavigation();
useEffect(() => {
//ニュース表示
AS.getItem("status")
.then((d) => {
if (d != news) navigate("news");
})
.catch(() => navigate("news"));
}, []);
//地図用 //地図用
const { injectJavaScript, mapSwitch } = useTrainMenu(); const { injectJavaScript, setInjectJavaScript, mapSwitch } = useTrainMenu();
const goToFavoriteList = () => const goToFavoriteList = () => navigate("favoriteList");
navigate("positions", { screen: "favoriteList" });
useEffect(() => { useEffect(() => {
const unsubscribe = addListener("tabLongPress", goToFavoriteList); const unsubscribe = addListener("tabLongPress", goToFavoriteList);
return unsubscribe; return unsubscribe;
}, []); }, [{ navigate, addListener }]);
const goToTrainMenu = () => { const goToTrainMenu = () => {
if (!isFocused()) { if (navigationRef.current?.getCurrentRoute().name == "Apps") {
navigate("positions", { screen: "Apps" }); if (mapSwitch == "true") {
} navigate("trainMenu");
if (mapSwitch == "true") { setInjectJavaScript("");
navigate("positions", { screen: "trainMenu" }); } else {
webview.current?.injectJavaScript(`AccordionClassEvent()`);
}
} else { } else {
webview.current?.injectJavaScript(`AccordionClassEvent()`); if (mapSwitch == "true") {
if (injectJavaScript) {
webview.current?.injectJavaScript(injectJavaScript);
setInjectJavaScript("");
}
}
navigate("Apps");
} }
return;
}; };
useEffect(() => { useEffect(() => {
const unsubscribe = addListener("tabPress", goToTrainMenu); const unsubscribe = addListener("tabPress", goToTrainMenu);
return unsubscribe; return unsubscribe;
}, [addListener, mapSwitch, injectJavaScript]); }, [{ navigate, addListener }, mapSwitch, injectJavaScript]);
return ( return (
<Stack.Navigator detachInactiveScreens={false}> <Stack.Navigator>
<Stack.Screen <Stack.Screen
name="Apps" name="Apps"
options={{ options={{
headerShown: false, headerShown: false,
gestureEnabled: true, gestureEnabled: true,
headerTransparent: true, headerTransparent: true,
detachPreviousScreen: false,
}} }}
component={Apps} component={Apps}
/> />
<Stack.Screen <Stack.Screen
name="trainbase" name="trainbase"
options={{ ...optionData }} options={{
title: "トレインビジョン",
gestureEnabled: true,
...TransitionPresets.SlideFromRightIOS,
}}
component={TrainBase} component={TrainBase}
/> />
<Stack.Screen name="howto" options={optionData} component={HowTo} /> <Stack.Screen name="howto" options={optionData} component={HowTo} />
<Stack.Screen name="news" options={optionData} component={News} /> <Stack.Screen name="news" options={optionData} component={News} />
<Stack.Screen <Stack.Screen
name="trainMenu" name="trainMenu"
options={optionData} options={optionData}
component={TrainMenu} component={TrainMenu}
/> />
<Stack.Screen <Stack.Screen
name="favoriteList" name="favoriteList"
options={{ ...optionData, gestureEnabled: false }} options={{ ...optionData, gestureEnabled: false }}

View File

@ -1,4 +1,4 @@
import { Platform, ToastAndroid } from "react-native"; import { ToastAndroid } from "react-native";
import * as Updates from "expo-updates"; import * as Updates from "expo-updates";
export const UpdateAsync = () => { export const UpdateAsync = () => {

450
app.json
View File

@ -1,13 +1,47 @@
{ {
"expo": { "expo": {
"name": "JR四国非公式", "name": "JR四国運行状況",
"slug": "jrshikoku", "slug": "jrshikoku",
"privacy": "public",
"platforms": ["ios", "android"], "platforms": ["ios", "android"],
"version": "6.0", "plugins": [
[
"react-native-android-widget",
{
"widgets": [
{
"name": "JR_shikoku_train_info",
"label": "JR四国列車遅延速報EX",
"minWidth": "70dp",
"minHeight": "50dp",
"description": "JR四国列車遅延速報EXのウィジェットです。30分ごとに自動更新します。タッチすると強制更新します。",
"previewImage": "./assets/icon.png",
"updatePeriodMillis": 1800000,
"resizeMode": "horizontal|vertical"
}
]
}
],
"expo-font",
[
"expo-screen-orientation",
{
"initialOrientation": "DEFAULT"
}
],
[
"expo-location",
{
"locationWhenInUsePermission": "この位置情報は、リンク画面で現在地側近の駅情報を取得するのに使用されます。"
}
]
],
"version": "5.0",
"orientation": "default", "orientation": "default",
"icon": "./assets/icons/s8600.png", "icon": "./assets/icon.png",
"splash": { "splash": {
"image": "./assets/splash.png", "image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#00b8ff" "backgroundColor": "#00b8ff"
}, },
"updates": { "updates": {
@ -16,7 +50,7 @@
}, },
"assetBundlePatterns": ["**/*"], "assetBundlePatterns": ["**/*"],
"ios": { "ios": {
"buildNumber": "42", "buildNumber": "39",
"supportsTablet": false, "supportsTablet": false,
"bundleIdentifier": "jrshikokuinfo.xprocess.hrkn", "bundleIdentifier": "jrshikokuinfo.xprocess.hrkn",
"config": { "config": {
@ -30,18 +64,13 @@
] ]
}, },
"entitlements": { "entitlements": {
"com.apple.developer.nfc.readersession.formats": [ "com.apple.developer.nfc.readersession.formats": ["TAG"]
"TAG"
]
} }
}, },
"android": { "android": {
"package": "jrshikokuinfo.xprocess.hrkn", "package": "jrshikokuinfo.xprocess.hrkn",
"versionCode": 23, "versionCode": 22,
"permissions": [ "permissions": ["ACCESS_FINE_LOCATION", "NFC"],
"ACCESS_FINE_LOCATION",
"NFC"
],
"googleServicesFile": "./google-services.json", "googleServicesFile": "./google-services.json",
"config": { "config": {
"googleMaps": { "googleMaps": {
@ -56,401 +85,6 @@
}, },
"runtimeVersion": { "runtimeVersion": {
"policy": "sdkVersion" "policy": "sdkVersion"
}, }
"plugins": [
"expo-font",
"expo-localization",
[
"expo-video",
{
"supportsBackgroundPlayback": true,
"supportsPictureInPicture": true
}
],
[
"expo-screen-orientation",
{
"initialOrientation": "DEFAULT"
}
],
[
"expo-location",
{
"locationWhenInUsePermission": "この位置情報は、リンク画面で現在地側近の駅情報を取得するのに使用されます。"
}
],
[
"react-native-android-widget",
{
"widgets": [
{
"name": "JR_shikoku_train_info",
"label": "列車遅延速報EX",
"minWidth": "70dp",
"minHeight": "50dp",
"description": "JR四国列車遅延速報EXのウィジェットです。30分ごとに自動更新します。タッチすると強制更新します。",
"previewImage": "./assets/icon.png",
"updatePeriodMillis": 1800000,
"resizeMode": "horizontal|vertical"
},
{
"name": "JR_shikoku_train_strange",
"label": "怪レい列車",
"minWidth": "70dp",
"minHeight": "50dp",
"description": "JR四国怪レい列車BOTのウィジェットです。30分ごとに自動更新します。タッチすると強制更新します。",
"previewImage": "./assets/icon.png",
"updatePeriodMillis": 1800000,
"resizeMode": "horizontal|vertical"
},
{
"name": "JR_shikoku_info",
"label": "運行情報",
"minWidth": "70dp",
"minHeight": "50dp",
"description": "JR四国運行情報のウィジェットです。30分ごとに自動更新します。タッチすると強制更新します。",
"previewImage": "./assets/icon.png",
"updatePeriodMillis": 1800000,
"resizeMode": "horizontal|vertical"
},
{
"name": "JR_shikoku_apps_shortcut",
"label": "クイックアクセス",
"minWidth": "70dp",
"minHeight": "50dp",
"description": "JR四国非公式アプリの各種リンクを表示するウィジェットです。",
"previewImage": "./assets/icon.png",
"updatePeriodMillis": 1800000,
"resizeMode": "horizontal|vertical"
}
]
}
],
[
"expo-alternate-app-icons",
[
{
"name": "32",
"ios": "./assets/icons/32.png",
"android": {
"foregroundImage": "./assets/icons/32.png",
"backgroundColor": "#001413"
}
},
{
"name": "32kpuuy",
"ios": "./assets/icons/32kpuuy.png",
"android": {
"foregroundImage": "./assets/icons/32kpuuy.png",
"backgroundColor": "#001413"
}
},
{
"name": "32tht",
"ios": "./assets/icons/32tht.png",
"android": {
"foregroundImage": "./assets/icons/32tht.png",
"backgroundColor": "#001413"
}
},
{
"name": "32at",
"ios": "./assets/icons/32at.png",
"android": {
"foregroundImage": "./assets/icons/32at.png",
"backgroundColor": "#001413"
}
},
{
"name": "54",
"ios": "./assets/icons/54.png",
"android": {
"foregroundImage": "./assets/icons/54.png",
"backgroundColor": "#001413"
}
},
{
"name": "54st",
"ios": "./assets/icons/54st.png",
"android": {
"foregroundImage": "./assets/icons/54st.png",
"backgroundColor": "#001413"
}
},
{
"name": "40",
"ios": "./assets/icons/40.png",
"android": {
"foregroundImage": "./assets/icons/40.png",
"backgroundColor": "#001413"
}
},
{
"name": "185mrt",
"ios": "./assets/icons/s185_mrt.png",
"android": {
"foregroundImage": "./assets/icons/s185_mrt.png",
"backgroundColor": "#001413"
}
},
{
"name": "185tu",
"ios": "./assets/icons/s185tu.png",
"android": {
"foregroundImage": "./assets/icons/s185tu.png",
"backgroundColor": "#001413"
}
},
{
"name": "185iyor",
"ios": "./assets/icons/s185iyor.png",
"android": {
"foregroundImage": "./assets/icons/s185iyor.png",
"backgroundColor": "#001413"
}
},
{
"name": "185iyoy",
"ios": "./assets/icons/s185iyoy.png",
"android": {
"foregroundImage": "./assets/icons/s185iyoy.png",
"backgroundColor": "#001413"
}
},
{
"name": "185toai",
"ios": "./assets/icons/s185to_ai.png",
"android": {
"foregroundImage": "./assets/icons/s185to_ai.png",
"backgroundColor": "#001413"
}
},
{
"name": "185mm1",
"ios": "./assets/icons/s185mm1.png",
"android": {
"foregroundImage": "./assets/icons/s185mm1.png",
"backgroundColor": "#001413"
}
},
{
"name": "185ym1",
"ios": "./assets/icons/s185ym1.png",
"android": {
"foregroundImage": "./assets/icons/s185ym1.png",
"backgroundColor": "#001413"
}
},
{
"name": "1000",
"ios": "./assets/icons/s1000.png",
"android": {
"foregroundImage": "./assets/icons/s1000.png",
"backgroundColor": "#001413"
}
},
{
"name": "1200n",
"ios": "./assets/icons/s1200n.png",
"android": {
"foregroundImage": "./assets/icons/s1200n.png",
"backgroundColor": "#001413"
}
},
{
"name": "1500",
"ios": "./assets/icons/s1500.png",
"android": {
"foregroundImage": "./assets/icons/s1500.png",
"backgroundColor": "#001413"
}
},
{
"name": "5001",
"ios": "./assets/icons/s5001.png",
"android": {
"foregroundImage": "./assets/icons/s5001.png",
"backgroundColor": "#001413"
}
},
{
"name": "5001k",
"ios": "./assets/icons/s5001k.png",
"android": {
"foregroundImage": "./assets/icons/s5001k.png",
"backgroundColor": "#001413"
}
},
{
"name": "6000p",
"ios": "./assets/icons/s6000p.png",
"android": {
"foregroundImage": "./assets/icons/s6000p.png",
"backgroundColor": "#001413"
}
},
{
"name": "7000",
"ios": "./assets/icons/s7000.png",
"android": {
"foregroundImage": "./assets/icons/s7000.png",
"backgroundColor": "#001413"
}
},
{
"name": "s7200",
"ios": "./assets/icons/s7200.png",
"android": {
"foregroundImage": "./assets/icons/s7200.png",
"backgroundColor": "#001413"
}
},
{
"name": "2000asi",
"ios": "./assets/icons/s2000_asi.png",
"android": {
"foregroundImage": "./assets/icons/s2000_asi.png",
"backgroundColor": "#001413"
}
},
{
"name": "N2000",
"ios": "./assets/icons/s2000n.png",
"android": {
"foregroundImage": "./assets/icons/s2000n.png",
"backgroundColor": "#001413"
}
},
{
"name": "2002a",
"ios": "./assets/icons/s2002a.png",
"android": {
"foregroundImage": "./assets/icons/s2002a.png",
"backgroundColor": "#001413"
}
},
{
"name": "2600",
"ios": "./assets/icons/s2600.png",
"android": {
"foregroundImage": "./assets/icons/s2600.png",
"backgroundColor": "#001413"
}
},
{
"name": "2700",
"ios": "./assets/icons/s2700.png",
"android": {
"foregroundImage": "./assets/icons/s2700.png",
"backgroundColor": "#001413"
}
},
{
"name": "2700apy",
"ios": "./assets/icons/s2700apy.png",
"android": {
"foregroundImage": "./assets/icons/s2700apy.png",
"backgroundColor": "#001413"
}
},
{
"name": "2700apr",
"ios": "./assets/icons/s2700apr.png",
"android": {
"foregroundImage": "./assets/icons/s2700apr.png",
"backgroundColor": "#001413"
}
},
{
"name": "8000no",
"ios": "./assets/icons/s8000no.png",
"android": {
"foregroundImage": "./assets/icons/s8000no.png",
"backgroundColor": "#001413"
}
},
{
"name": "8000nr",
"ios": "./assets/icons/s8000nr.png",
"android": {
"foregroundImage": "./assets/icons/s8000nr.png",
"backgroundColor": "#001413"
}
},
{
"name": "8000ap",
"ios": "./assets/icons/s8000ap.png",
"android": {
"foregroundImage": "./assets/icons/s8000ap.png",
"backgroundColor": "#001413"
}
},
{
"name": "8000nn",
"ios": "./assets/icons/s8000nn.png",
"android": {
"foregroundImage": "./assets/icons/s8000nn.png",
"backgroundColor": "#001413"
}
},
{
"name": "8600",
"ios": "./assets/icons/s8600.png",
"android": {
"foregroundImage": "./assets/icons/s8600.png",
"backgroundColor": "#001413"
}
},
{
"name": "9640",
"ios": "./assets/icons/tosa9640.png",
"android": {
"foregroundImage": "./assets/icons/tosa9640.png",
"backgroundColor": "#001413"
}
},
{
"name": "9640jgr",
"ios": "./assets/icons/tosa9640jgr.png",
"android": {
"foregroundImage": "./assets/icons/tosa9640jgr.png",
"backgroundColor": "#001413"
}
},
{
"name": "285",
"ios": "./assets/icons/w285.png",
"android": {
"foregroundImage": "./assets/icons/w285.png",
"backgroundColor": "#001413"
}
},
{
"name": "213w",
"ios": "./assets/icons/w213w.png",
"android": {
"foregroundImage": "./assets/icons/w213w.png",
"backgroundColor": "#001413"
}
},
{
"name": "EF65",
"ios": "./assets/icons/ef65.png",
"android": {
"foregroundImage": "./assets/icons/ef65.png",
"backgroundColor": "#001413"
}
},
{
"name": "EF210",
"ios": "./assets/icons/ef210.png",
"android": {
"foregroundImage": "./assets/icons/ef210.png",
"backgroundColor": "#001413"
}
}
]
]
]
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -1,45 +0,0 @@
export default () =>{
return [
{ "id": "32", "name": "キハ32形", "icon": require("./32.png") },
{ "id": "32kpuuy", "name": "キハ32形かっぱうようよ号", "icon": require("./32kpuuy.png") },
{ "id": "32tht", "name": "キハ32形新幹線ホビートレイン", "icon": require("./32tht.png") },
{ "id": "32at", "name": "キクハ32形アンパンマントロッコ", "icon": require("./32at.png") },
{ "id": "54", "name": "キハ54形", "icon": require("./54.png") },
{ "id": "54st", "name": "キハ54形しまんトロッコ", "icon": require("./54st.png") },
{ "id": "40", "name": "キハ40", "icon": require("./40.png") },
{ "id": "185mrt", "name": "キハ185系四国色", "icon": require("./s185_mrt.png") },
{ "id": "185tu", "name": "キハ185系剣山色", "icon": require("./s185tu.png") },
{ "id": "185iyor", "name": "キハ185系伊予灘ものがたり(赤)", "icon": require("./s185iyor.png") },
{ "id": "185iyoy", "name": "キハ185系伊予灘ものがたり(黄)", "icon": require("./s185iyoy.png") },
{ "id": "185toai", "name": "キハ185系藍よしのがわトロッコ", "icon": require("./s185to_ai.png") },
{ "id": "185mm1", "name": "キハ185系四国まんなか千年ものがたり(緑)", "icon": require("./s185mm1.png") },
{ "id": "185ym1", "name": "キハ185系時代の夜明けのものがたり(茶)", "icon": require("./s185ym1.png") },
{ "id": "1000", "name": "1000形", "icon": require("./s1000.png") },
{ "id": "1200n", "name": "1200形", "icon": require("./s1200n.png") },
{ "id": "1500", "name": "1500形", "icon": require("./s1500.png") },
{ "id": "5001", "name": "5000系(二階建て)", "icon": require("./s5001.png") },
{ "id": "5001k", "name": "5000系(平屋側)", "icon": require("./s5001k.png") },
{ "id": "6000p", "name": "6000系", "icon": require("./s6000p.png") },
{ "id": "7000", "name": "7000系", "icon": require("./s7000.png") },
{ "id": "7200", "name": "7200系", "icon": require("./s7200.png") },
{ "id": "2000asi", "name": "2000系", "icon": require("./s2000_asi.png") },
{ "id": "N2000", "name": "N2000系", "icon": require("./s2000n.png") },
{ "id": "2002a", "name": "2000系アンパンマン", "icon": require("./s2002a.png") },
{ "id": "2600", "name": "2600系" , "icon": require("./s2600.png")},
{ "id": "2700", "name": "2700系", "icon": require("./s2700.png") },
{ "id": "2700apy", "name": "2700系アンパンマン(黄)", "icon": require("./s2700apy.png") },
{ "id": "2700apr", "name": "2700系アンパンマン(赤)", "icon": require("./s2700apr.png") },
{ "id": "8000no", "name": "8000系(オレンジ)", "icon": require("./s8000no.png") },
{ "id": "8000nr", "name": "8000系(赤)", "icon": require("./s8000nr.png") },
{ "id": "8000ap", "name": "8000系アンパンマン", "icon": require("./s8000ap.png") },
{ "id": "8000nn", "name": "8000系リニューアル改", "icon": require("./s8000nn.png") },
{ "id": "8600", "name": "8600系", "icon": require("./s8600.png") },
{ "id": "9640", "name": "9640形(白)", "icon": require("./tosa9640.png") },
{ "id": "9640jgr", "name": "9640形オープンデッキ(緑)", "icon": require("./tosa9640jgr.png") },
{ "id": "285", "name": "285系サンライズ瀬戸", "icon": require("./w285.png") },
{ "id": "213w", "name": "ラ・マル・ド・ボァ", "icon": require("./w213w.png") },
{ "id": "EF65", "name": "EF65", "icon": require("./ef65.png") },
{ "id": "EF210", "name": "EF210", "icon": require("./ef210.png") },
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -8,6 +8,7 @@ export const EachTrainInfo = ({ payload }) => {
return ( return (
<ActionSheet <ActionSheet
gestureEnabled={true} gestureEnabled={true}
//gestureEnabled={!actionSheetHorizonalScroll}
CustomHeaderComponent={<></>} CustomHeaderComponent={<></>}
ref={actionSheetRef} ref={actionSheetRef}
drawUnderStatusBar={false} drawUnderStatusBar={false}

View File

@ -9,6 +9,9 @@ import { trainPosition } from "../../../lib/trainPositionTextArray";
import { TrainPositionDataPush } from "../../発車時刻表/LED_inside_Component/TrainPositionDataPush"; import { TrainPositionDataPush } from "../../発車時刻表/LED_inside_Component/TrainPositionDataPush";
import { getStationID } from "../../../lib/eachTrainInfoCoreLib/getStationData"; import { getStationID } from "../../../lib/eachTrainInfoCoreLib/getStationData";
import { useStationList } from "../../../stateBox/useStationList"; import { useStationList } from "../../../stateBox/useStationList";
import { lineList } from "../../../lib/getStationList";
export const TrainDataView = ({ export const TrainDataView = ({
currentTrainData, currentTrainData,
@ -18,6 +21,7 @@ export const TrainDataView = ({
mode = 0, mode = 0,
navigate, navigate,
}) => { }) => {
const { stationList } = useStationList(); const { stationList } = useStationList();
const { width, height } = useWindowDimensions(); const { width, height } = useWindowDimensions();
@ -53,14 +57,13 @@ export const TrainDataView = ({
return `${Pos}${platformNumber ? ` ${platformNumber}番線` : ""}`; return `${Pos}${platformNumber ? ` ${platformNumber}番線` : ""}`;
}; };
const [dialog, setDialog] = useState(false); const [dialog, setDialog] = useState(false);
const [deleteDialog, setDeleteDialog] = useState(false); const [deleteDialog, setDeleteDialog] = useState(false);
const [posInput, setPosInput] = useState(""); const [posInput, setPosInput] = useState("");
const [descInput, setDescInput] = useState(""); const [descInput, setDescInput] = useState("");
const [stationInput, setStationInput] = useState(""); const [stationInput, setStationInput] = useState("");
const [stationNumberInput, setStationNumberInput] = useState(""); const [stationNumberInput, setStationNumberInput] = useState("");
return ( return (<>
<> <TrainPositionDataPush
<TrainPositionDataPush
dialog={dialog} dialog={dialog}
setDialog={setDialog} setDialog={setDialog}
currentTrainData={currentTrainData} currentTrainData={currentTrainData}
@ -70,118 +73,111 @@ export const TrainDataView = ({
descInput={descInput} descInput={descInput}
setPosInput={setPosInput} setPosInput={setPosInput}
setDescInput={setDescInput} setDescInput={setDescInput}
station={{ station={{Station_JP:trainPositionText(currentTrainData),StationNumber:currentPosition[0]}} />
Station_JP: trainPositionText(currentTrainData), <View
StationNumber: currentPosition[0], style={{
flexDirection: "row",
//minHeight: 200,
//height: heightPercentageToDP("20%"),
width: isLandscape ? (width / 100) * 40 : width,
flex: 1,
}}
>
<TouchableOpacity
style={{ flex: 1, flexDirection: "row" }}
//disabled={!onLine}
onLongPress={() => {
const { isBetween, Pos } = trainPosition(currentTrainData);
if (isBetween === true) {
if (platformNumber == undefined && platformDescription == undefined)
return;
setStationInput(`${Pos.from}${Pos.to}`);
setStationNumberInput(
getStationID(currentTrainData?.Pos, stationList)
);
setPosInput(platformNumber?.toString() || "");
setDeleteDialog(true);
} else {
setStationInput(Pos.Pos);
setStationNumberInput(
getStationID(currentTrainData?.Pos, stationList)
);
setDescInput(platformDescription || "");
setPosInput(platformNumber?.toString() || "");
setDialog(true);
}
}} }}
/> onPress={() => {
<View if(!onLine) return;
style={{ const test = [];
flexDirection: "row", Object.keys(mapsStationData).forEach((d) => {
//minHeight: 200, mapsStationData[d].forEach((x) => {
//height: heightPercentageToDP("20%"), if (x.StationNumber == currentPosition[0])
width: isLandscape ? (width / 100) * 40 : width, test.push({ line: d, station: x });
flex: 1, });
if (currentPosition[0] == "M12") {
test.push({
line: "seto",
station: { Station_JP: "児島", MyStation: "0" },
});
}
});
if (!test.length) return;
navigate("Apps");
inject(
`MoveDisplayStation('${test[0].line}_${test[0].station.MyStation}_${test[0].station.Station_JP}');document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`
);
SheetManager.hide("EachTrainInfo");
}} }}
> >
<TouchableOpacity <StateBox
style={{ flex: 1, flexDirection: "row" }} mode={mode}
//disabled={!onLine} title={`現在地 ${currentPosition?.toString()}${onLine ? "▶️" : ""}`}
onLongPress={() => { text={trainPositionText(currentTrainData)}
const { isBetween, Pos } = trainPosition(currentTrainData); endText={platformDescription ? `${platformDescription}` : ""}
if (isBetween === true) { style={
if ( onLine
platformNumber == undefined && ? { borderWidth: 1, borderColor: "red", borderStyle: "solid" }
platformDescription == undefined : {}
) }
return; />
setStationInput(`${Pos.from}${Pos.to}`); </TouchableOpacity>
setStationNumberInput(
getStationID(currentTrainData?.Pos, stationList) <View style={{ flex: 1, flexDirection: mode == 2 ? "row" : "column" }}>
); <View style={{ flex: 1, flexDirection: "row" }}>
setPosInput(platformNumber?.toString() || "");
setDeleteDialog(true);
} else {
setStationInput(Pos.Pos);
setStationNumberInput(
getStationID(currentTrainData?.Pos, stationList)
);
setDescInput(platformDescription || "");
setPosInput(platformNumber?.toString() || "");
setDialog(true);
}
}}
onPress={() => {
if (!onLine) return;
const test = [];
Object.keys(mapsStationData).forEach((d) => {
mapsStationData[d].forEach((x) => {
if (x.StationNumber == currentPosition[0])
test.push({ line: d, station: x });
});
if (currentPosition[0] == "M12") {
test.push({
line: "seto",
station: { Station_JP: "児島", MyStation: "0" },
});
}
});
if (!test.length) return;
navigate("positions", { screen: "Apps" });
inject(
`MoveDisplayStation('${test[0].line}_${test[0].station.MyStation}_${test[0].station.Station_JP}');document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`
);
SheetManager.hide("EachTrainInfo");
}}
>
<StateBox <StateBox
mode={mode} mode={mode}
title={`現在地 ${currentPosition?.toString()}${onLine ? "▶️" : ""}`} title={isNaN(currentTrainData?.delay) ? "状態" : "遅延時分"}
text={trainPositionText(currentTrainData)} text={`${currentTrainData?.delay}${
endText={platformDescription ? `${platformDescription}` : ""} isNaN(currentTrainData?.delay) ? "" : "分"
style={ }`}
onLine
? { borderWidth: 1, borderColor: "red", borderStyle: "solid" }
: {}
}
/> />
</TouchableOpacity> </View>
<TouchableOpacity
<View style={{ flex: 1, flexDirection: mode == 2 ? "row" : "column" }}> style={{ flex: 1, flexDirection: "row" }}
<View style={{ flex: 1, flexDirection: "row" }}> disabled={nearTrainIDList.length == 0}
onPress={() => {
if (nearTrainIDList.length == 0) return;
openTrainInfo(nearTrainIDList[0]);
}}
>
{nearTrainIDList.length == 0 ? (
<StateBox mode={mode} title="列番" text={currentTrainData?.num} />
) : (
<StateBox <StateBox
mode={mode} mode={mode}
title={isNaN(currentTrainData?.delay) ? "状態" : "遅延時分"} title="増解結相手を表示▶️"
text={`${currentTrainData?.delay}${ text={`${nearTrainIDList}`}
isNaN(currentTrainData?.delay) ? "" : "分" style={{
}`} borderWidth: 1,
borderColor: "red",
borderStyle: "solid",
}}
/> />
</View> )}
<TouchableOpacity </TouchableOpacity>
style={{ flex: 1, flexDirection: "row" }}
disabled={nearTrainIDList.length == 0}
onPress={() => {
if (nearTrainIDList.length == 0) return;
openTrainInfo(nearTrainIDList[0]);
}}
>
{nearTrainIDList.length == 0 ? (
<StateBox mode={mode} title="列番" text={currentTrainData?.num} />
) : (
<StateBox
mode={mode}
title="増解結相手を表示▶️"
text={`${nearTrainIDList}`}
style={{
borderWidth: 1,
borderColor: "red",
borderStyle: "solid",
}}
/>
)}
</TouchableOpacity>
</View>
</View> </View>
</> </View>
</>
); );
}; };

View File

@ -10,7 +10,6 @@ import {
LayoutAnimation, LayoutAnimation,
} from "react-native"; } from "react-native";
import { SheetManager } from "react-native-actions-sheet"; import { SheetManager } from "react-native-actions-sheet";
import { useScrollHandlers } from "react-native-actions-sheet";
import { AS } from "../../storageControl"; import { AS } from "../../storageControl";
import trainList from "../../assets/originData/trainList"; import trainList from "../../assets/originData/trainList";
import { lineListPair } from "../../lib/getStationList"; import { lineListPair } from "../../lib/getStationList";
@ -189,7 +188,7 @@ export const EachTrainInfoCore = ({
const count = position * 44 - 50; const count = position * 44 - 50;
// 0.5秒待機してからスクロール // 0.5秒待機してからスクロール
setTimeout( setTimeout(
() => scrollHandlers.ref.current?.scrollTo({ y: count, animated: true }), () => ScrollViewRef.current?.scrollTo({ y: count, animated: true }),
400 400
); );
} }
@ -220,9 +219,8 @@ export const EachTrainInfoCore = ({
const { height } = useWindowDimensions(); const { height } = useWindowDimensions();
const { isLandscape } = useDeviceOrientationChange(); const { isLandscape } = useDeviceOrientationChange();
const scrollHandlers = actionSheetRef const ScrollViewRef = useRef();
? useScrollHandlers("scrollview-1", actionSheetRef)
: null;
const [trueTrainID, setTrueTrainID] = useState(); const [trueTrainID, setTrueTrainID] = useState();
useEffect(() => { useEffect(() => {
if (!data.trainNum) return; if (!data.trainNum) return;
@ -337,7 +335,8 @@ export const EachTrainInfoCore = ({
.then((d) => { .then((d) => {
if (d) setTrainPositionSwitch(d); if (d) setTrainPositionSwitch(d);
}) })
.catch(() => AS.setItem("trainPositionSwitch", "true")); //6.0で変更
.catch(() => AS.setItem("trainPositionSwitch", "false"));
}, []); }, []);
const openTrainInfo = (d) => { const openTrainInfo = (d) => {
@ -363,7 +362,7 @@ export const EachTrainInfoCore = ({
} else { } else {
SheetManager.hide("EachTrainInfo").then(() => { SheetManager.hide("EachTrainInfo").then(() => {
//0.1秒待機してから開く //0.1秒待機してから開く
setTimeout(() => SheetManager.show("EachTrainInfo", { payload }), 200); setTimeout(() => SheetManager.show("EachTrainInfo", { payload }), 2);
}); });
} }
}; };
@ -413,7 +412,7 @@ export const EachTrainInfoCore = ({
from={from} from={from}
styles={styles} styles={styles}
actionSheetRef={actionSheetRef} actionSheetRef={actionSheetRef}
scrollHandlers={scrollHandlers} ScrollViewRef={ScrollViewRef}
containerProps={{ containerProps={{
style: { style: {
maxHeight: isLandscape ? height - 94 : (height / 100) * 70, maxHeight: isLandscape ? height - 94 : (height / 100) * 70,

View File

@ -13,7 +13,7 @@ export const TrainViewIcon: FC<Props> = ({ data, navigate, from }) => {
const [isTrainView, setIsTrainView] = useState(false); const [isTrainView, setIsTrainView] = useState(false);
//トレインビュー表示対象(特急、マリン)かを判定 //トレインビュー表示対象(特急、マリン)かを判定
useEffect(() => { useEffect(() => {
if (!data.limited) return () => {}; if (!data.limited) return;
setIsTrainView( setIsTrainView(
getType(data.limited.split(":")[0]) && getType(data.limited.split(":")[0]) &&
!data.limited.split(":")[1].match("サンポート") !data.limited.split(":")[1].match("サンポート")

View File

@ -9,7 +9,6 @@ import {
import ActionSheet, { SheetManager } from "react-native-actions-sheet"; import ActionSheet, { SheetManager } from "react-native-actions-sheet";
import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useTrainMenu } from "../../stateBox/useTrainMenu"; import { useTrainMenu } from "../../stateBox/useTrainMenu";
import { useCurrentTrain } from "../../stateBox/useCurrentTrain";
import lineColorList from "../../assets/originData/lineColorList"; import lineColorList from "../../assets/originData/lineColorList";
import { stationIDPair } from "../../lib/getStationList2"; import { stationIDPair } from "../../lib/getStationList2";
import { lineListPair } from "../../lib/getStationList"; import { lineListPair } from "../../lib/getStationList";
@ -20,7 +19,6 @@ export const TrainMenuLineSelector = () => {
setSelectedLine, setSelectedLine,
mapsStationData: stationData, mapsStationData: stationData,
} = useTrainMenu(); } = useTrainMenu();
const { webview } = useCurrentTrain();
const actionSheetRef = useRef(null); const actionSheetRef = useRef(null);
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
const platformIs = Platform.OS == "android"; const platformIs = Platform.OS == "android";
@ -54,25 +52,7 @@ export const TrainMenuLineSelector = () => {
}} }}
onPress={() => { onPress={() => {
SheetManager.hide("TrainMenuLineSelector"); SheetManager.hide("TrainMenuLineSelector");
const s = selectedLine == d ? undefined : d; setSelectedLine(selectedLine == d ? undefined : d);
if(!s) return;
setSelectedLine(s);
Object.keys(stationData).forEach((data, indexBase) => {
stationData[data].forEach((D, index) => {
if (!D.StationMap) return null;
if (s && s != data) return;
const latlng = D.StationMap.replace(
"https://www.google.co.jp/maps/place/",
""
).split(",");
if (latlng.length == 0) return null;
if (index == 0 ) {
webview.current
?.injectJavaScript(`MoveDisplayStation('${data}_${D.MyStation}_${D.Station_JP}');
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`);
}
});
});
}} }}
> >
<View <View

View File

@ -20,7 +20,7 @@ import { useNavigation } from "@react-navigation/native";
import { BigButton } from "./atom/BigButton"; import { BigButton } from "./atom/BigButton";
import { Switch } from "react-native-elements"; import { Switch } from "react-native-elements";
export default function AllTrainDiagramView() { export default function AllTrainDiagramView() {
const { goBack, navigate } = useNavigation(); const { navigate } = useNavigation();
const { keyList, allTrainDiagram } = useAllTrainDiagram(); const { keyList, allTrainDiagram } = useAllTrainDiagram();
const [input, setInput] = useState(""); // 文字入力 const [input, setInput] = useState(""); // 文字入力
const [keyBoardVisible, setKeyBoardVisible] = useState(false); const [keyBoardVisible, setKeyBoardVisible] = useState(false);
@ -206,7 +206,7 @@ export default function AllTrainDiagramView() {
</View> </View>
</KeyboardAvoidingView> </KeyboardAvoidingView>
<BigButton <BigButton
onPress={goBack} onPress={() => navigate("menu")}
string="閉じる" string="閉じる"
style={{ style={{
display: display:

View File

@ -20,7 +20,7 @@ export const getInfoString = async () => {
} }
return null; return null;
}); });
//ToastAndroid.show(`${text}`, ToastAndroid.SHORT); ToastAndroid.show(`${text}`, ToastAndroid.SHORT);
return { time, text }; return { time, text };
}; };

View File

@ -20,7 +20,7 @@ export const getDelayData = async () => {
} }
return null; return null;
}); });
//ToastAndroid.show(`${delayString}`, ToastAndroid.SHORT); ToastAndroid.show(`${delayString}`, ToastAndroid.SHORT);
return { time, delayString }; return { time, delayString };
}; };
export function TraInfoEXWidget({ time, delayString }) { export function TraInfoEXWidget({ time, delayString }) {

View File

@ -20,11 +20,11 @@ export async function widgetTaskHandler(props) {
const WidgetName = await AS.getItem( const WidgetName = await AS.getItem(
`widgetType/${widgetInfo.widgetId}` `widgetType/${widgetInfo.widgetId}`
).catch((e) => "JR_shikoku_train_info"); ).catch((e) => "JR_shikoku_train_info");
// ToastAndroid.show( ToastAndroid.show(
// `Widget Action: ${JSON.stringify(widgetInfo.widgetId)}`, `Widget Action: ${JSON.stringify(widgetInfo.widgetId)}`,
// ToastAndroid.SHORT ToastAndroid.SHORT
// ); );
//ToastAndroid.show(`Widget Name: ${WidgetName}`, ToastAndroid.SHORT); ToastAndroid.show(`Widget Name: ${WidgetName}`, ToastAndroid.SHORT);
switch (widgetAction) { switch (widgetAction) {
case "WIDGET_ADDED": case "WIDGET_ADDED":
case "WIDGET_UPDATE": case "WIDGET_UPDATE":

View File

@ -60,7 +60,7 @@ export default function Apps() {
useShow: () => SheetManager.show("StationDetailView", { payload }), useShow: () => SheetManager.show("StationDetailView", { payload }),
onExit: () => SheetManager.hide("StationDetailView"), onExit: () => SheetManager.hide("StationDetailView"),
}; };
setTimeout(()=>SheetManager.show("StationDetailView", { payload }),50); SheetManager.show("StationDetailView", { payload });
} else { } else {
SheetManager.hide("StationDetailView"); SheetManager.hide("StationDetailView");
} }

View File

@ -4,12 +4,12 @@ import { useCurrentTrain } from "../stateBox/useCurrentTrain";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { BigButton } from "./atom/BigButton"; import { BigButton } from "./atom/BigButton";
export default function CurrentTrainListView() { export default function CurrentTrainListView() {
const { goBack } = useNavigation(); const { navigate } = useNavigation();
const { currentTrain } = useCurrentTrain(); const { currentTrain } = useCurrentTrain();
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>
{currentTrain && currentTrain.map((d) => <Text>{d.num}</Text>)} {currentTrain && currentTrain.map((d) => <Text>{d.num}</Text>)}
<BigButton onPress={goBack} string="閉じる" /> <BigButton onPress={() => navigate("menu")} string="閉じる" />
</View> </View>
); );
} }

View File

@ -1,6 +1,6 @@
import { ScrollView, View, Animated, LayoutAnimation } from "react-native"; import { ScrollView, View, Animated, LayoutAnimation } from "react-native";
import React, { useEffect, useMemo, useState, useLayoutEffect } from "react"; import React, { useEffect, useMemo, useState, useLayoutEffect } from "react";
import { NativeViewGestureHandler } from "react-native-gesture-handler"; import { useScrollHandlers } from "react-native-actions-sheet";
import { AS } from "../storageControl"; import { AS } from "../storageControl";
export const DynamicHeaderScrollView = (props) => { export const DynamicHeaderScrollView = (props) => {
@ -13,7 +13,7 @@ export const DynamicHeaderScrollView = (props) => {
topStickyContent, topStickyContent,
styles, styles,
from, from,
scrollHandlers, ScrollViewRef,
} = props; } = props;
const [headerSize, setHeaderSize] = useState("default"); const [headerSize, setHeaderSize] = useState("default");
useLayoutEffect(() => { useLayoutEffect(() => {
@ -53,7 +53,9 @@ export const DynamicHeaderScrollView = (props) => {
const Scroll_Distance = Max_Header_Height - Min_Header_Height; const Scroll_Distance = Max_Header_Height - Min_Header_Height;
const scrollHandlers = actionSheetRef
? useScrollHandlers("scrollview-1", actionSheetRef)
: null;
const shotHeaderStyle = { const shotHeaderStyle = {
on: { on: {
@ -108,7 +110,6 @@ export const DynamicHeaderScrollView = (props) => {
const [headerVisible, setHeaderVisible] = useState(false); const [headerVisible, setHeaderVisible] = useState(false);
const onScroll = (event) => { const onScroll = (event) => {
scrollHandlers.onScroll(event);
switch (headerSize) { switch (headerSize) {
case "big": case "big":
setHeaderVisible(false); setHeaderVisible(false);
@ -152,31 +153,26 @@ export const DynamicHeaderScrollView = (props) => {
{topStickyContent} {topStickyContent}
</Animated.View> </Animated.View>
</View> </View>
<NativeViewGestureHandler <ScrollView
simultaneousHandlers={scrollHandlers.simultaneousHandlers} {...scrollHandlers}
style={{ backgroundColor: "white", zIndex: 0 }}
stickyHeaderIndices={[1]}
scrollEventThrottle={16}
onScroll={onScroll}
ref={ScrollViewRef}
> >
<ScrollView <View style={{ height: Scroll_Distance, flexDirection: "column" }} />
nestedScrollEnabled {topStickyContent && (
ref={scrollHandlers.ref} <View
onLayout={scrollHandlers.onLayout} style={{
scrollEventThrottle={scrollHandlers.scrollEventThrottle} paddingTop: Min_Header_Height + 40,
style={{ backgroundColor: "white", zIndex: 0 }} flexDirection: "column",
stickyHeaderIndices={[1]} }}
onScroll={onScroll} index={1}
> />
<View style={{ height: Scroll_Distance, flexDirection: "column" }} /> )}
{topStickyContent && ( {children}
<View </ScrollView>
style={{
paddingTop: Min_Header_Height + 40,
flexDirection: "column",
}}
index={1}
/>
)}
{children}
</ScrollView>
</NativeViewGestureHandler>
</View> </View>
); );
}; };

View File

@ -1,5 +1,5 @@
import React, { useEffect } from "react"; import React from "react";
import { View, Text, ScrollView } from "react-native"; import { View, Text, TouchableOpacity, ScrollView } from "react-native";
import Icon from "react-native-vector-icons/Entypo"; import Icon from "react-native-vector-icons/Entypo";
import { useFavoriteStation } from "../stateBox/useFavoriteStation"; import { useFavoriteStation } from "../stateBox/useFavoriteStation";
@ -11,18 +11,9 @@ import { BigButton } from "./atom/BigButton";
export default function FavoriteList() { export default function FavoriteList() {
const { favoriteStation } = useFavoriteStation(); const { favoriteStation } = useFavoriteStation();
const { webview } = useCurrentTrain(); const { webview } = useCurrentTrain();
const { navigate, addListener, goBack, canGoBack } = useNavigation(); const { navigate, goBack } = useNavigation();
const { mapsStationData: stationData } = useTrainMenu(); const { mapsStationData: stationData } = useTrainMenu();
useEffect(() => {
const unsubscribe = addListener("tabPress", goToTrainMenu);
return unsubscribe;
}, [{ navigate, addListener }]);
const goToTrainMenu = (e) => {
e.preventDefault();
goBack();
};
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<Text <Text
@ -59,8 +50,7 @@ export default function FavoriteList() {
`MoveDisplayStation('${lineName}_${currentStation[0].MyStation}_${currentStation[0].Station_JP}'); `MoveDisplayStation('${lineName}_${currentStation[0].MyStation}_${currentStation[0].Station_JP}');
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");` document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`
); );
goBack(); navigate("Apps");
if (canGoBack()) goBack();
}} }}
> >
<View <View

View File

@ -5,11 +5,10 @@ import {
Ionicons, Ionicons,
MaterialCommunityIcons, MaterialCommunityIcons,
} from "@expo/vector-icons"; } from "@expo/vector-icons";
import { ListItem } from "@rneui/themed";
import TouchableScale from 'react-native-touchable-scale';
import Icon from "react-native-vector-icons/Entypo"; import Icon from "react-native-vector-icons/Entypo";
import { TextBox } from "../atom/TextBox"; import { TextBox } from "../atom/TextBox";
import { TicketBox } from "../atom/TicketBox"; import { TicketBox } from "../atom/TicketBox";
import { ListItem } from "native-base";
export const FixedContentBottom = (props) => { export const FixedContentBottom = (props) => {
return ( return (
@ -250,16 +249,10 @@ export const FixedContentBottom = (props) => {
name: "しこくたぬきのぽんちゃん 【四国家サポーターズクラブ】", name: "しこくたぬきのぽんちゃん 【四国家サポーターズクラブ】",
}, },
].map((d) => ( ].map((d) => (
<ListItem bottomDivider onPress={() => Linking.openURL(d.url)} <ListItem onPress={() => Linking.openURL(d.url)}>
key={d.url}friction={90} // <Text>{d.name}</Text>
tension={100} // These props are passed to the parent component (here TouchableScale) <View style={{ flex: 1 }} />
activeScale={0.95} // <Icon name="chevron-right" size={20} />
Component={TouchableScale}
>
<ListItem.Content>
<ListItem.Title>{d.name}</ListItem.Title>
</ListItem.Content>
<ListItem.Chevron />
</ListItem> </ListItem>
))} ))}
</View> </View>

View File

@ -1,27 +0,0 @@
import React, { FC } from "react";
import { Ionicons } from "@expo/vector-icons";
import { TouchableOpacity } from "react-native";
type SimpleDotProps = {
active: boolean;
onPress: () => void;
};
export const SimpleDot: FC<SimpleDotProps> = (props) => {
const { active, onPress } = props;
return (
<TouchableOpacity
style={{
width: 20,
marginHorizontal: 2,
alignItems: "center",
justifyContent: "center",
}}
onPress={onPress}
>
<Ionicons
name="ellipse"
size={active ? 20 : 14}
color={active ? "#00b8ff" : "#00b8ff55"}
/>
</TouchableOpacity>
);
};

View File

@ -1,5 +1,6 @@
import React, { FC, useState } from "react"; import React, { FC, useState } from "react";
import { View, Text, TouchableOpacity } from "react-native"; import { View, Text, TouchableOpacity } from "react-native";
import { Pagination } from "react-native-snap-carousel";
import { useInterval } from "../../lib/useInterval"; import { useInterval } from "../../lib/useInterval";
import lineColorList from "../../assets/originData/lineColorList"; import lineColorList from "../../assets/originData/lineColorList";
@ -17,6 +18,78 @@ type StationProps = {
lat: number; lat: number;
lng: number; lng: number;
}; };
type StationPaginationProps = {
entries: StationProps[][];
activeSlide: number;
carouselRef: any;
setSelectedCurrentStation: React.Dispatch<React.SetStateAction<number>>;
dotButton: boolean;
};
export const Paginations: FC<StationPaginationProps> = (props) => {
const {
entries,
activeSlide,
carouselRef,
setSelectedCurrentStation,
dotButton,
} = props;
return (
<Pagination
dotsLength={entries.length}
activeDotIndex={activeSlide}
carouselRef={carouselRef}
containerStyle={{ paddingVertical: 0 }}
dotStyle={{
width: 12,
height: 12,
borderRadius: 6,
backgroundColor: "#0099CC",
}}
inactiveDotStyle={
{
// Define styles for inactive dots here
}
}
tappableDots={true}
inactiveDotOpacity={0.4}
inactiveDotScale={0.8}
inactiveDotElement={
dotButton && (
<StationNumberMaker
currentStations={entries}
setSelectedCurrentStation={setSelectedCurrentStation}
/>
)
}
dotElement={
dotButton && (
<StationNumberMaker
currentStations={entries}
setSelectedCurrentStation={setSelectedCurrentStation}
/>
)
}
/>
);
};
type StationNumberMakerProps = {
currentStations: StationProps[][];
setSelectedCurrentStation: React.Dispatch<React.SetStateAction<number>>;
active?: boolean;
index?: number;
};
export const StationNumberMaker: FC<StationNumberMakerProps> = (props) => {
const { currentStations, active, index, setSelectedCurrentStation } = props;
return (
<StationNumber
currentStation={currentStations[index]}
active={active}
onPress={() => setSelectedCurrentStation(index)}
key={currentStations[index][0].StationNumber}
/>
);
};
type StationNumberProps = { type StationNumberProps = {
currentStation: StationProps[]; currentStation: StationProps[];
active: boolean; active: boolean;
@ -34,42 +107,41 @@ export const StationNumber: FC<StationNumberProps> = (props) => {
const lineID = data[animation].StationNumber.slice(0, 1); const lineID = data[animation].StationNumber.slice(0, 1);
const lineName = data[animation].StationNumber.slice(1); const lineName = data[animation].StationNumber.slice(1);
const size = active ? 24 : 18; const size = active ? 24 : 18;
const margin = active ? 3 : 6;
const border = active ? 2 : 1;
return ( return (
<TouchableOpacity <>
onPress={onPress} style={{
width: 28,
height:24,
alignContent:"center",
alignItems:"center",
justifyContent:"center",
position:"relative",
}}>
{active && ( {active && (
<View style={{ position: "relative", width: 0, height: 0 }}>
<View <View
style={{ style={{
flex: 1, flex: 1,
position: "absolute", position: "absolute",
width: 28, width: 28,
height: 28, height: 28,
marginHorizontal:1, marginLeft: 1,
marginRight: 1,
borderRadius: 22, borderRadius: 22,
borderColor: "black", borderColor: "black",
borderWidth: 2, borderWidth: 2,
left: -1, left: 0,
top: -2, top: -14,
zIndex:10
}} }}
/> />
</View>
)} )}
<View <TouchableOpacity
onPress={onPress}
style={{ style={{
alignContent: "center", alignContent: "center",
alignItems: "center", alignItems: "center",
width: size, width: size,
height: size, height: size,
marginLeft: margin,
marginRight: margin,
borderColor: lineColorList[lineID], borderColor: lineColorList[lineID],
backgroundColor: "white", backgroundColor: "white",
borderWidth: active ? 2 : 1, borderWidth: border,
borderRadius: 22, borderRadius: 22,
}} }}
key={currentStation[0].StationNumber + lineID} key={currentStation[0].StationNumber + lineID}
@ -89,7 +161,7 @@ export const StationNumber: FC<StationNumberProps> = (props) => {
{lineID + "\n" + lineName} {lineID + "\n" + lineName}
</Text> </Text>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
</View> </TouchableOpacity>
</TouchableOpacity> </>
); );
}; };

View File

@ -1,19 +1,17 @@
import React from "react"; import React from "react";
import { View, Text, TouchableOpacity, ScrollView } from "react-native"; import { View, Text, TouchableOpacity, ScrollView } from "react-native";
import { useNavigation } from "@react-navigation/native";
import { useFavoriteStation } from "../../stateBox/useFavoriteStation"; import { useFavoriteStation } from "../../stateBox/useFavoriteStation";
import { CheckBox } from "react-native-elements"; import { CheckBox } from "react-native-elements";
import { FavoriteSettingsItem } from "./FavoliteSettings/FavoiliteSettingsItem"; import { FavoriteSettingsItem } from "./FavoliteSettings/FavoiliteSettingsItem";
export const FavoriteSettings = () => { export const FavoriteSettings = ({ navigate }) => {
const { favoriteStation, setFavoriteStation } = useFavoriteStation(); const { favoriteStation, setFavoriteStation } = useFavoriteStation();
const { goBack } = useNavigation();
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}> <View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity <TouchableOpacity
onPress={goBack} onPress={() => navigate("settingTopPage")}
style={{ style={{
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,

View File

@ -1,147 +0,0 @@
import React, { useEffect, useState } from "react";
import { View, Text, TouchableOpacity, ScrollView, Image } from "react-native";
import { useNavigation } from "@react-navigation/native";
import { CheckBox } from "react-native-elements";
import { AS } from "../../storageControl";
import icons from "../../assets/icons/icons";
import app from "../../app.json";
import { ListItem } from "native-base";
import {
setAlternateAppIcon,
resetAppIcon,
getAppIconName,
supportsAlternateIcons,
} from "expo-alternate-app-icons";
import { widthPercentageToDP } from "react-native-responsive-screen";
export const LauncherIconSettings = ({ navigate }) => {
const { goBack } = useNavigation();
const [iconList, ] = useState(icons());
const [currentIcon, ] = useState(getAppIconName());
return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
<View style={{ flex: 1 }}>
<TouchableOpacity
onPress={goBack}
style={{
flexDirection: "column",
flex: 1,
}}
>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
fontWeight: "bold",
textAlign: "left",
textAlignVertical: "center",
color: "white",
padding: 10,
}}
>
設定
</Text>
<View style={{ flex: 1 }} />
</TouchableOpacity>
</View>
<Text
style={{
fontSize: 20,
fontWeight: "bold",
textAlign: "center",
color: "white",
padding: 10,
}}
>
アイコン設定
</Text>
<View style={{ flex: 1 }}></View>
</View>
<ScrollView style={{ flex: 1, backgroundColor: "white" }}>
{currentIcon ? (
<>
<Text
style={{
backgroundColor: "#DDDDDD",
}}
>
現在のアイコン:
{iconList.filter(({ id }) => id == currentIcon)[0].id}
</Text>
<View
style={{
flexDirection: "cokumn",
alignItems: "center",
justifyContent: "center",
backgroundColor: "#DDDDDD",
padding: 10,
}}
>
<Image
source={
iconList.filter(({ id }) => id == currentIcon)[0].icon
}
style={{
width: 50,
height: 50,
padding: 30,
borderWidth: 1,
borderRadius: 10,
borderColor: "white",
margin: 10,
backgroundColor: "white",
}}
/>
<Text>JR四国非公式アプリ</Text>
</View>
</>
) : (
<></>
)}
<View
style={{
flexDirection: "row",
flexWrap: "wrap",
alignContent: "center",
justifyContent: "center",
}}
>
{iconList.map(({ name, icon, id }) => {
return (
<TouchableOpacity
key={id}
style={{
margin: 10,
alignItems: "center",
justifyContent: "center",
width: widthPercentageToDP("30%"),
maxWidth: 60,
height: 100,
borderColor: "#999999",
borderWidth: id == currentIcon ? 2 : 0,
borderRadius: 10,
}}
onPress={() => {
setAlternateAppIcon(id)
.then((res) => {
alert(res);
})
.catch((err) => {
alert(err);
});
}}
>
<Image source={icon} style={{ width: 50, height: 50 }} />
<Text>{id}</Text>
</TouchableOpacity>
);
})}
</View>
</ScrollView>
</View>
);
};

View File

@ -1,6 +1,5 @@
import React from "react"; import React from "react";
import { View, Text, TouchableOpacity, ScrollView } from "react-native"; import { View, Text, TouchableOpacity, ScrollView } from "react-native";
import { useNavigation } from "@react-navigation/native";
import { SwitchArea } from "../atom/SwitchArea"; import { SwitchArea } from "../atom/SwitchArea";
import { CheckBox } from "react-native-elements"; import { CheckBox } from "react-native-elements";
import { TripleSwitchArea } from "../atom/TripleSwitchArea"; import { TripleSwitchArea } from "../atom/TripleSwitchArea";
@ -22,13 +21,12 @@ export const LayoutSettings = ({
headerSize, headerSize,
setHeaderSize, setHeaderSize,
}) => { }) => {
const { goBack } = useNavigation();
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}> <View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity <TouchableOpacity
onPress={goBack} onPress={() => navigate("settingTopPage")}
style={{ style={{
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,

View File

@ -1,15 +1,12 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { View, Text, TouchableOpacity, ScrollView } from "react-native"; import { View, Text, TouchableOpacity, ScrollView,Clipboard } from "react-native";
import * as Clipboard from 'expo-clipboard';
import { CheckBox } from "react-native-elements"; import { CheckBox } from "react-native-elements";
import { AS } from "../../storageControl"; import { AS } from "../../storageControl";
import { useNotification } from "../../stateBox/useNotifications"; import { useNotification } from "../../stateBox/useNotifications";
import { useNavigation } from "@react-navigation/native";
export const NotificationSettings = () => { export const NotificationSettings = ({ navigate }) => {
const { expoPushToken } = useNotification(); const { expoPushToken } = useNotification();
const { goBack } = useNavigation();
const [traInfoEX, setTraInfoEX] = useState(false); const [traInfoEX, setTraInfoEX] = useState(false);
const [informations, setInformations] = useState(false); const [informations, setInformations] = useState(false);
const [strangeTrain, setStrangeTrain] = useState(false); const [strangeTrain, setStrangeTrain] = useState(false);
@ -24,7 +21,9 @@ export const NotificationSettings = () => {
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}> <View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity <TouchableOpacity
onPress={goBack} onPress={() => {
navigate("settingTopPage");
}}
style={{ style={{
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,
@ -41,7 +40,7 @@ export const NotificationSettings = () => {
padding: 10, padding: 10,
}} }}
> >
設定 設定/送信
</Text> </Text>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
</TouchableOpacity> </TouchableOpacity>
@ -80,7 +79,7 @@ export const NotificationSettings = () => {
AS.setItem("traInfoEX", traInfoEX.toString()), AS.setItem("traInfoEX", traInfoEX.toString()),
AS.setItem("informations", informations.toString()), AS.setItem("informations", informations.toString()),
AS.setItem("strangeTrain", strangeTrain.toString()), AS.setItem("strangeTrain", strangeTrain.toString()),
]).then(() => alert("通知の設定を保存、登録しました")); ]).then(()=>alert("通知の設定を保存、登録しました"));
}); });
}} }}
style={{ style={{
@ -121,10 +120,9 @@ export const NotificationSettings = () => {
setBool={setStrangeTrain} setBool={setStrangeTrain}
str="怪レい列車" str="怪レい列車"
/> />
<Text <Text style={{fontWeight: "bold", padding: 10 }} onPress={()=>{
style={{ fontWeight: "bold", padding: 10 }} Clipboard.setString(expoPushToken);
onPress={() => Clipboard.setStringAsync(expoPushToken)} }}>
>
通知を受け取りたい項目を選択してくださいチェックボックスを選び右上の登録実行を押すと設定が反映され通知が届くようになります 通知を受け取りたい項目を選択してくださいチェックボックスを選び右上の登録実行を押すと設定が反映され通知が届くようになります
</Text> </Text>
</ScrollView> </ScrollView>

View File

@ -10,15 +10,14 @@ import {
} from "react-native"; } from "react-native";
import * as Updates from "expo-updates"; import * as Updates from "expo-updates";
import { useWindowDimensions } from "react-native"; import { useWindowDimensions } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { ListItem } from "native-base";
import { ListItem } from "@rneui/themed";
import TouchableScale from "react-native-touchable-scale";
import { SwitchArea } from "../atom/SwitchArea"; import { SwitchArea } from "../atom/SwitchArea";
import { useNotification } from "../../stateBox/useNotifications"; import { useNotification } from "../../stateBox/useNotifications";
const versionCode = "6.0"; const versionCode = "5.6.0.2";
export const SettingTopPage = ({ export const SettingTopPage = ({
navigate,
testNFC, testNFC,
startPage, startPage,
setStartPage, setStartPage,
@ -26,13 +25,12 @@ export const SettingTopPage = ({
}) => { }) => {
const { width } = useWindowDimensions(); const { width } = useWindowDimensions();
const { expoPushToken } = useNotification(); const { expoPushToken } = useNotification();
const navigation = useNavigation();
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}> <View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity <TouchableOpacity
onPress={() => navigation.goBack()} onPress={() => navigate("menu")}
style={{ style={{
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,
@ -120,63 +118,179 @@ export const SettingTopPage = ({
falseText={"リンクメニュー"} falseText={"リンクメニュー"}
trueText={"列車位置情報"} trueText={"列車位置情報"}
/> />
<SettingList <ListItem
string="お気に入り登録の並び替え" style={{ flexDirection: "row" }}
onPress={() => onPress={() => navigate("FavoriteSettings")}
navigation.navigate("setting", { screen: "FavoriteSettings" }) >
} <Text
/> style={{
<SettingList fontSize: 20,
string={`通知設定${ alignItems: "center",
expoPushToken == "" ? "(通知設定をオンにしてください)" : "(β)" alignContent: "center",
}`} textAlign: "center",
onPress={() => textAlignVertical: "center",
navigation.navigate("setting", { screen: "NotificationSettings" }) }}
} >
お気に入り登録の並び替え
</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
{">"}
</Text>
</ListItem>
<ListItem
style={{ flexDirection: "row" }}
onPress={() => navigate("NotificationSettings")}
disabled={expoPushToken == ""} disabled={expoPushToken == ""}
/> >
<Text
<SettingList style={{
string="レイアウト設定" fontSize: 20,
onPress={() => alignItems: "center",
navigation.navigate("setting", { screen: "LayoutSettings" }) alignContent: "center",
} textAlign: "center",
/> textAlignVertical: "center",
}}
>
通知設定{expoPushToken == "" ? "(通知設定をオンにしてください)" : "(β)"}
</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
{">"}
</Text>
</ListItem>
<ListItem
style={{ flexDirection: "row" }}
onPress={() => navigate("LayoutSettings")}
>
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
レイアウト設定
</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
{">"}
</Text>
</ListItem>
{Platform.OS === "android" ? ( {Platform.OS === "android" ? (
<SettingList <ListItem
string="ウィジェット設定" style={{ flexDirection: "row" }}
onPress={() => onPress={() => navigate("WidgetSettings")}
navigation.navigate("setting", { screen: "WidgetSettings" }) >
} <Text
/> style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
ウィジェット設定
</Text>
<View style={{ flex: 1 }} />
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
{">"}
</Text>
</ListItem>
) : null} ) : null}
<SettingList <ListItem
string="アイコン設定" style={{ flexDirection: "row" }}
onPress={() =>
navigation.navigate("setting", { screen: "LauncherIconSettings" })
}
/>
<SettingList
string="プライバシーポリシー"
onPress={() => onPress={() =>
Linking.openURL( Linking.openURL(
"https://nexcloud.haruk.in/sites/press-harukin/JRShikokuApps/policy" "https://nexcloud.haruk.in/sites/press-harukin/JRShikokuApps/policy"
) )
} }
/> >
<Text
<SettingList style={{
string="開発情報" fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
プライバシーポリシー
</Text>
<View style={{ flex: 1 }} />
</ListItem>
<ListItem
style={{ flexDirection: "row" }}
onPress={() => onPress={() =>
Linking.openURL("https://nexcloud.haruk.in/s/2WFEN5oLPGtrRqT") Linking.openURL("https://nexcloud.haruk.in/s/2WFEN5oLPGtrRqT")
} }
/> >
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
開発情報
</Text>
<SettingList <View style={{ flex: 1 }} />
string="運営Twitter" </ListItem>
<ListItem
style={{ flexDirection: "row" }}
onPress={() => Linking.openURL("https://twitter.com/Xprocess_main")} onPress={() => Linking.openURL("https://twitter.com/Xprocess_main")}
/> >
<Text
style={{
fontSize: 20,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
}}
>
運営Twitter
</Text>
<View style={{ flex: 1 }} />
</ListItem>
{/* <ListItem style={{ flexDirection: "row" }} onPress={() => testNFC()}> {/* <ListItem style={{ flexDirection: "row" }} onPress={() => testNFC()}>
<Text <Text
style={{ style={{
@ -214,20 +328,3 @@ export const SettingTopPage = ({
</View> </View>
); );
}; };
const SettingList = ({ string, onPress, disabled }) => {
return (
<ListItem
activeScale={0.95}
Component={TouchableScale}
bottomDivider
onPress={onPress}
disabled={disabled}
>
<ListItem.Content>
<ListItem.Title>{string}</ListItem.Title>
</ListItem.Content>
<ListItem.Chevron />
</ListItem>
);
};

View File

@ -1,7 +1,8 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { View, Text, TouchableOpacity, ScrollView } from "react-native"; import { View, Text, TouchableOpacity, ScrollView } from "react-native";
import { useNavigation } from "@react-navigation/native"; import { SwitchArea } from "../atom/SwitchArea";
import { CheckBox } from "react-native-elements"; import { CheckBox } from "react-native-elements";
import { TripleSwitchArea } from "../atom/TripleSwitchArea";
import { getWidgetInfo, WidgetPreview } from "react-native-android-widget"; import { getWidgetInfo, WidgetPreview } from "react-native-android-widget";
import { getDelayData } from "../AndroidWidget/TraInfoEXWidget"; import { getDelayData } from "../AndroidWidget/TraInfoEXWidget";
import { getInfoString } from "../AndroidWidget/InfoWidget"; import { getInfoString } from "../AndroidWidget/InfoWidget";
@ -11,7 +12,6 @@ import { ListItem } from "native-base";
export const WidgetSettings = ({ navigate }) => { export const WidgetSettings = ({ navigate }) => {
const { JR_shikoku_train_info, Info_Widget } = nameToWidget; const { JR_shikoku_train_info, Info_Widget } = nameToWidget;
const { goBack } = useNavigation();
const [time, setTime] = useState(); const [time, setTime] = useState();
const [delayString, setDelayString] = useState(); const [delayString, setDelayString] = useState();
const [trainInfo, setTrainInfo] = useState(); const [trainInfo, setTrainInfo] = useState();
@ -25,9 +25,7 @@ export const WidgetSettings = ({ navigate }) => {
setWidgetList(d); setWidgetList(d);
}; };
useEffect(() => { useEffect(reload, []);
reload();
}, []);
useEffect(() => { useEffect(() => {
getDelayData().then(({ time, delayString }) => { getDelayData().then(({ time, delayString }) => {
@ -44,7 +42,7 @@ export const WidgetSettings = ({ navigate }) => {
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}> <View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity <TouchableOpacity
onPress={goBack} onPress={() => navigate("settingTopPage")}
style={{ style={{
flexDirection: "column", flexDirection: "column",
flex: 1, flex: 1,

View File

@ -23,7 +23,6 @@ import { LayoutSettings } from "./LayoutSettings";
import { FavoriteSettings } from "./FavoriteSettings"; import { FavoriteSettings } from "./FavoriteSettings";
import { WidgetSettings } from "./WidgetSettings"; import { WidgetSettings } from "./WidgetSettings";
import { NotificationSettings } from "./NotificationSettings"; import { NotificationSettings } from "./NotificationSettings";
import { LauncherIconSettings } from "./LauncherIconSettings";
const Stack = createStackNavigator(); const Stack = createStackNavigator();
export default function Setting(props) { export default function Setting(props) {
@ -149,18 +148,6 @@ export default function Setting(props) {
> >
{(props) => <WidgetSettings {...props} navigate={navigate} />} {(props) => <WidgetSettings {...props} navigate={navigate} />}
</Stack.Screen> </Stack.Screen>
<Stack.Screen
name="LauncherIconSettings"
options={{
gestureEnabled: true,
...TransitionPresets.SlideFromRightIOS,
cardOverlayEnabled: true,
headerTransparent: true,
headerShown: false,
}}
>
{(props) => <LauncherIconSettings {...props} navigate={navigate} />}
</Stack.Screen>
<Stack.Screen <Stack.Screen
name="FavoriteSettings" name="FavoriteSettings"
options={{ options={{

View File

@ -1,6 +1,5 @@
import React, { FC } from "react"; import React, { FC } from "react";
import { Marker } from "react-native-maps"; import { Marker } from "react-native-maps";
import { useNavigation } from "@react-navigation/native";
type Props = { type Props = {
index: number; index: number;
indexBase: number; indexBase: number;
@ -13,7 +12,6 @@ type Props = {
export const MapPin: FC<Props> = (props) => { export const MapPin: FC<Props> = (props) => {
const { index, indexBase, latlng, D, d, navigate, webview } = props; const { index, indexBase, latlng, D, d, navigate, webview } = props;
const {goBack} = useNavigation();
return ( return (
<Marker <Marker
key={index + indexBase} key={index + indexBase}
@ -26,7 +24,7 @@ export const MapPin: FC<Props> = (props) => {
`MoveDisplayStation('${d}_${D.MyStation}_${D.Station_JP}'); `MoveDisplayStation('${d}_${D.MyStation}_${D.Station_JP}');
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");` document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`
); );
if (navigate) goBack(); if (navigate) navigate("Apps");
}} }}
image={require("../../assets/reccha-small.png")} image={require("../../assets/reccha-small.png")}
></Marker> ></Marker>

View File

@ -6,7 +6,7 @@ import { news } from "../config/newsUpdate";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { BigButton } from "./atom/BigButton"; import { BigButton } from "./atom/BigButton";
const News: FC = () => { const News: FC = () => {
const { goBack } = useNavigation(); const { navigate } = useNavigation();
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>
<WebView <WebView
@ -20,7 +20,7 @@ const News: FC = () => {
<BigButton <BigButton
onPress={() => { onPress={() => {
AS.setItem("status", news); AS.setItem("status", news);
goBack(); navigate("Apps");
}} }}
string="更新情報を閉じる" string="更新情報を閉じる"
/> />

View File

@ -1,6 +1,7 @@
import React, { useRef, useState, useEffect, useLayoutEffect } from "react"; import React, { useRef, useState, useEffect, useLayoutEffect } from "react";
import { View, Text, TouchableOpacity, Linking } from "react-native"; import { View, Text, TouchableOpacity, Linking } from "react-native";
import MapView from "react-native-maps"; import MapView, { Marker } from "react-native-maps";
import { MaterialCommunityIcons, Ionicons } from "@expo/vector-icons";
import { useCurrentTrain } from "../stateBox/useCurrentTrain"; import { useCurrentTrain } from "../stateBox/useCurrentTrain";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import lineColorList from "../assets/originData/lineColorList"; import lineColorList from "../assets/originData/lineColorList";
@ -14,7 +15,7 @@ import { MapsButton } from "./TrainMenu/MapsButton";
export default function TrainMenu({ style }) { export default function TrainMenu({ style }) {
const { webview } = useCurrentTrain(); const { webview } = useCurrentTrain();
const mapRef = useRef(); const mapRef = useRef();
const { navigate, goBack } = useNavigation(); const { navigate } = useNavigation();
const [stationPin, setStationPin] = useState([]); const [stationPin, setStationPin] = useState([]);
const { const {
selectedLine, selectedLine,
@ -34,6 +35,12 @@ export default function TrainMenu({ style }) {
"" ""
).split(","); ).split(",");
if (latlng.length == 0) return null; if (latlng.length == 0) return null;
if (index == 0 && stationPin.length > 0) {
setInjectJavaScript(
`MoveDisplayStation('${d}_${D.MyStation}_${D.Station_JP}');
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`
);
}
stationPinData.push({ D, d, latlng, indexBase: 0, index }); stationPinData.push({ D, d, latlng, indexBase: 0, index });
}); });
}); });
@ -75,7 +82,7 @@ export default function TrainMenu({ style }) {
d={d} d={d}
navigate={navigate} navigate={navigate}
webview={webview} webview={webview}
key={D.StationNumber + d} key={D.StationNumber+d}
/> />
))} ))}
</MapView> </MapView>
@ -145,27 +152,7 @@ export default function TrainMenu({ style }) {
opacity: selectedLine == d ? 1 : !selectedLine ? 1 : 0.5, opacity: selectedLine == d ? 1 : !selectedLine ? 1 : 0.5,
zIndex: 10, zIndex: 10,
}} }}
onPress={() => { onPress={() => setSelectedLine(selectedLine == d ? undefined : d)}
const s = selectedLine == d ? undefined : d;
if(!s) return;
setSelectedLine(s);
Object.keys(stationData).forEach((data, indexBase) => {
stationData[data].forEach((D, index) => {
if (!D.StationMap) return null;
if (s && s != data) return;
const latlng = D.StationMap.replace(
"https://www.google.co.jp/maps/place/",
""
).split(",");
if (latlng.length == 0) return null;
if (index == 0 && stationPin.length > 0) {
webview.current
?.injectJavaScript(`MoveDisplayStation('${data}_${D.MyStation}_${D.Station_JP}');
document.getElementById("disp").insertAdjacentHTML("afterbegin", "<div />");`);
}
});
});
}}
> >
<Text <Text
style={{ color: "white", fontWeight: "bold", fontSize: 20 }} style={{ color: "white", fontWeight: "bold", fontSize: 20 }}
@ -214,7 +201,7 @@ export default function TrainMenu({ style }) {
)} )}
<MapsButton <MapsButton
onPress={() => { onPress={() => {
goBack(); navigate("Apps");
webview.current?.injectJavaScript(injectJavaScript); webview.current?.injectJavaScript(injectJavaScript);
}} }}
top={0} top={0}
@ -222,4 +209,4 @@ export default function TrainMenu({ style }) {
/> />
</View> </View>
); );
} }

View File

@ -1,4 +1,4 @@
import React from "react"; import React, { useRef } from "react";
import { StatusBar, Platform, View } from "react-native"; import { StatusBar, Platform, View } from "react-native";
import { WebView } from "react-native-webview"; import { WebView } from "react-native-webview";
import { MaterialCommunityIcons } from "@expo/vector-icons"; import { MaterialCommunityIcons } from "@expo/vector-icons";
@ -6,40 +6,44 @@ import { useNavigation } from "@react-navigation/native";
import { BigButton } from "./atom/BigButton"; import { BigButton } from "./atom/BigButton";
export default function TrainBase({ route }) { export default function TrainBase({ route }) {
const { info } = route.params; const { info, from } = route.params;
const { goBack } = useNavigation(); const { navigate } = useNavigation();
const jss = ` const webview = useRef();
document.getElementById('Footer').style.display = 'none'; const jss = `document.getElementById('Footer').style.display = 'none';
${ ${
Platform.OS == "ios" Platform.OS == "ios" &&
? `document.getElementsByTagName("html")[0].style['font-size'] = '11px';` `document.getElementsByTagName("html")[0].style['font-size'] = '11px';`
: "" }`;
} //const jss = `alert("ほげ")`;
true;`;
return ( return (
<View style={{ height: "100%" }}> <View style={{ height: "100%" }}>
{Platform.OS == "ios" && <StatusBar barStyle="dark-content" />} {Platform.OS == "ios" && <StatusBar barStyle="dark-content" />}
<WebView <WebView
useWebKit //useWebKit={true}
ref={webview}
source={{ uri: "https://train.jr-shikoku.co.jp/" + info }} source={{ uri: "https://train.jr-shikoku.co.jp/" + info }}
originWhitelist={[ originWhitelist={[
"https://train.jr-shikoku.co.jp", "https://train.jr-shikoku.co.jp",
"https://train.jr-shikoku.co.jp/sp.html", "https://train.jr-shikoku.co.jp/sp.html",
]} ]}
onMessage={(event) => {}}
mixedContentMode={"compatibility"} mixedContentMode={"compatibility"}
javaScriptEnabled javaScriptEnabled={true}
injectedJavaScript={jss} injectedJavaScript={jss}
setSupportMultipleWindows setSupportMultipleWindows={false}
onMessage={(event) => {}}
/> />
<BigButton {(from == "LED" || from == "LED2" || from == "AllTrainIDList") && (
style={{ borderColor: "black" }} <BigButton
tS={{ color: "black" }} style={{ borderColor: "black" }}
string="閉じる" tS={{ color: "black" }}
onPress={goBack} string="閉じる"
> onPress={() =>
<MaterialCommunityIcons name="close" color="black" size={30} /> navigate(from == "AllTrainIDList" ? "AllTrainIDList" : "menu")
</BigButton> }
>
<MaterialCommunityIcons name="close" color="black" size={30} />
</BigButton>
)}
</View> </View>
); );
} }

View File

@ -116,7 +116,7 @@ export default function LED_vision(props) {
if (data.split(",")[0] === station.Station_JP) { if (data.split(",")[0] === station.Station_JP) {
if (data.match(",発,")) { if (data.match(",発,")) {
trainData.time = data.split(",発,")[1]; trainData.time = data.split(",発,")[1];
} else if(data.match(",着,")){ } else {
trainData.time = data.split(",着,")[1]; trainData.time = data.split(",着,")[1];
trainData.lastStation = "当駅止"; trainData.lastStation = "当駅止";
} }
@ -127,7 +127,7 @@ export default function LED_vision(props) {
time: trainData.time, time: trainData.time,
lastStation: trainData.lastStation, lastStation: trainData.lastStation,
}; };
}).filter((d) => d.time); });
return returnData.sort((a, b) => { return returnData.sort((a, b) => {
switch (true) { switch (true) {
case parseInt(a.time.split(":")[0]) < parseInt(b.time.split(":")[0]): case parseInt(a.time.split(":")[0]) < parseInt(b.time.split(":")[0]):
@ -138,8 +138,6 @@ export default function LED_vision(props) {
return -1; return -1;
case parseInt(a.time.split(":")[1]) > parseInt(b.time.split(":")[1]): case parseInt(a.time.split(":")[1]) > parseInt(b.time.split(":")[1]):
return 1; return 1;
default:
return 0;
} }
}); });
}; };

View File

@ -35,12 +35,6 @@
}, },
"production5.0": { "production5.0": {
"channel": "dmm" "channel": "dmm"
},
"beta6.0": {
"channel": "ebookjapan"
},
"production6.0": {
"channel": "ebay"
} }
}, },
"submit": { "submit": {

View File

@ -7,11 +7,12 @@ export default ({ navigation: { navigate }, route }) => {
const { info, goTo, useShow } = route.params; const { info, goTo, useShow } = route.params;
const { goBack } = useNavigation(); const { goBack } = useNavigation();
const onExit = () => { const onExit = () => {
if (goTo != "NearTrainDiagramView") { if(goTo != "NearTrainDiagramView") {
//navigate(goTo || "Apps"); navigate(goTo || "Apps");
useShow && useShow(); useShow && useShow();
} else {
goBack();
} }
goBack();
}; };
return ( return (
<View style={styles}> <View style={styles}>

View File

@ -1,5 +1,5 @@
// 種別判定 // 種別判定
export const getType = (string:string) => { export const getType = (string) => {
switch (string) { switch (string) {
case "express": case "express":
return "特急"; return "特急";

View File

@ -1,6 +1,6 @@
// Description: 電車名の変換を行う。 // Description: 電車名の変換を行う。
// マリンライナーやマリン表記をマリンライナーに変換する。 // マリンライナーやマリン表記をマリンライナーに変換する。
export const migrateTrainName = (string:string) => { export const migrateTrainName = (string) => {
return string return string
.replace("マリン", "マリンライナー") .replace("マリン", "マリンライナー")
.replace("ライナーライナー", "ライナー"); .replace("ライナーライナー", "ライナー");

View File

@ -1,7 +1,7 @@
// S列番の列車からDやMの列車を検索する // S列番の列車からDやMの列車を検索する
export const searchSpecialTrain = (trainNum: string, trainList: any[]) => { export const searchSpecialTrain = (trainNum, trainList) => {
const searchBase = trainNum.replace("S", "").replace("X", ""); const searchBase = trainNum.replace("S", "").replace("X", "");
const search = (text: string) => { const search = (text) => {
const TD = trainList[searchBase + text]; const TD = trainList[searchBase + text];
if (TD) { if (TD) {
return true; return true;

View File

@ -1,6 +1,6 @@
import { Platform } from "react-native"; import { Platform } from "react-native";
export const getPDFViewURL = (url:string) => { export const getPDFViewURL = (url) => {
if (Platform.OS == "ios") return url; if (Platform.OS == "ios") return url;
else else
return `https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURI(url)}`; return `https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURI(url)}`;

View File

@ -41,7 +41,7 @@ export const lineListPair = {
M: "瀬戸大橋線(児島-宇多津間)[M]", M: "瀬戸大橋線(児島-宇多津間)[M]",
}; };
export const getStationList = async () => { export const getStationList = async (props) => {
if (status) return status; if (status) return status;
//駅リストイニシャライズ //駅リストイニシャライズ
return await Promise.all([ return await Promise.all([
@ -68,8 +68,8 @@ export const getStationList = async () => {
stationList["徳島線(徳島-阿波池田間)[B]"], stationList["徳島線(徳島-阿波池田間)[B]"],
stationList["鳴門線(池谷-鳴門間)[N]"], stationList["鳴門線(池谷-鳴門間)[N]"],
stationList["瀬戸大橋線(児島-宇多津間)[M]"], stationList["瀬戸大橋線(児島-宇多津間)[M]"],
stationList["駅間リスト"], stationList.駅間リスト,
stationList["日英対応表"], stationList.日英対応表,
] = values; ] = values;
const concatBetweenStations = (eachRouteData) => { const concatBetweenStations = (eachRouteData) => {
let additional = []; let additional = [];
@ -82,7 +82,7 @@ export const getStationList = async () => {
eachRouteData[routeIndex + 1].StationNumber.replace(/[A-Z]/g, "") eachRouteData[routeIndex + 1].StationNumber.replace(/[A-Z]/g, "")
); );
if (nextStationID - currentStationID != 1) { if (nextStationID - currentStationID != 1) {
stationList["駅間リスト"].forEach((betweenList) => { stationList.駅間リスト.forEach((betweenList) => {
if ( if (
betweenList.BetweenStation == betweenList.BetweenStation ==
routeData.Station_JP + routeData.Station_JP +
@ -125,12 +125,12 @@ export const getStationList = async () => {
stationList["予讃線(高松-松山間)[Y]"] = addStationPosition( stationList["予讃線(高松-松山間)[Y]"] = addStationPosition(
concatBetweenStations(stationList["予讃線(高松-松山間)[Y]"]), concatBetweenStations(stationList["予讃線(高松-松山間)[Y]"]),
予讃線, 予讃線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["予讃線(松山-宇和島間)[U]"] = addStationPosition( stationList["予讃線(松山-宇和島間)[U]"] = addStationPosition(
concatBetweenStations(stationList["予讃線(松山-宇和島間)[U]"]), concatBetweenStations(stationList["予讃線(松山-宇和島間)[U]"]),
予讃線, 予讃線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]"] = stationList["予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]"] =
addStationPosition( addStationPosition(
@ -138,32 +138,32 @@ export const getStationList = async () => {
stationList["予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]"] stationList["予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]"]
), ),
予讃線, 予讃線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["土讃線(多度津-高知間)[D]"] = addStationPosition( stationList["土讃線(多度津-高知間)[D]"] = addStationPosition(
concatBetweenStations(stationList["土讃線(多度津-高知間)[D]"]), concatBetweenStations(stationList["土讃線(多度津-高知間)[D]"]),
土讃線, 土讃線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["土讃線(高知-窪川間)[K]"] = addStationPosition( stationList["土讃線(高知-窪川間)[K]"] = addStationPosition(
concatBetweenStations(stationList["土讃線(高知-窪川間)[K]"]), concatBetweenStations(stationList["土讃線(高知-窪川間)[K]"]),
土讃線, 土讃線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["高徳線(高松-徳島間)[T]"] = addStationPosition( stationList["高徳線(高松-徳島間)[T]"] = addStationPosition(
concatBetweenStations(stationList["高徳線(高松-徳島間)[T]"]), concatBetweenStations(stationList["高徳線(高松-徳島間)[T]"]),
高徳線, 高徳線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["鳴門線(池谷-鳴門間)[N]"] = addStationPosition( stationList["鳴門線(池谷-鳴門間)[N]"] = addStationPosition(
concatBetweenStations(stationList["鳴門線(池谷-鳴門間)[N]"]), concatBetweenStations(stationList["鳴門線(池谷-鳴門間)[N]"]),
鳴門線, 鳴門線,
stationList["日英対応表"] stationList.日英対応表
); );
const tokushimaCurrent = addStationPosition( const tokushimaCurrent = addStationPosition(
concatBetweenStations(stationList["徳島線(徳島-阿波池田間)[B]"]), concatBetweenStations(stationList["徳島線(徳島-阿波池田間)[B]"]),
徳島線, 徳島線,
stationList["日英対応表"] stationList.日英対応表
); );
stationList["徳島線(徳島-阿波池田間)[B]"] = [ stationList["徳島線(徳島-阿波池田間)[B]"] = [
tokushimaCurrent[tokushimaCurrent.length - 1], tokushimaCurrent[tokushimaCurrent.length - 1],

View File

@ -5,7 +5,7 @@ type nameString =
| "SPCL" | "SPCL"
| "Normal" | "Normal"
| string; | string;
type colorString = "aqua" | "red" | "#297bff" | "white"; type colorString = "aqua" | "red" | "blue" | "white";
type trainTypeString = type trainTypeString =
| "快速" | "快速"
| "特急" | "特急"
@ -29,7 +29,7 @@ export const getTrainType: getTrainType = (nameString) => {
case "NightLTDEXP": case "NightLTDEXP":
return { color: "red", name: "寝台特急", data: "express" }; return { color: "red", name: "寝台特急", data: "express" };
case "SPCL": case "SPCL":
return { color: "#297bff", name: "臨時", data: "normal" }; return { color: "blue", name: "臨時", data: "normal" };
case "OneMan": case "OneMan":
return { color: "white", name: "普通列車(ワンマン)", data: "normal" }; return { color: "white", name: "普通列車(ワンマン)", data: "normal" };
case "Normal": case "Normal":

View File

@ -1,72 +1,20 @@
import React, { FC } from "react"; import React from "react";
import { Ionicons, AntDesign } from "@expo/vector-icons"; import { Ionicons, AntDesign } from "@expo/vector-icons";
import { Text, View } from "react-native";
type name = keyof typeof Ionicons.glyphMap & keyof typeof AntDesign.glyphMap; type name = keyof typeof Ionicons.glyphMap & keyof typeof AntDesign.glyphMap;
type type = "Ionicons" | "AntDesign"; type type = "Ionicons" | "AntDesign";
export const initIcon = ( export const initIcon = (name: name, type:type) => {
name: name,
type: type,
tabBarBadge: string,
isInfo: boolean
) => {
switch (type) { switch (type) {
case "Ionicons": case "Ionicons":
return ({ focused, color, size }) => ( return ({ focused, color, size }) => (
<> <Ionicons name={name} size={32} color={focused ? "#0099CC" : "black"} />
{!!tabBarBadge && <Badge tabBarBadge={tabBarBadge} isInfo={isInfo} />}
<Ionicons
name={name}
size={30}
color={focused ? "#0099CC" : "black"}
/>
</>
); );
case "AntDesign": case "AntDesign":
return ({ focused, color, size }) => ( return ({ focused, color, size }) => (
<> <AntDesign
{!!tabBarBadge && <Badge tabBarBadge={tabBarBadge} isInfo={isInfo} />} name={name}
<AntDesign size={32}
name={name} color={focused ? "#0099CC" : "black"}
size={30} />
color={focused ? "#0099CC" : "black"}
/>
</>
); );
} }
}; };
type BadgeProps = { tabBarBadge: string; isInfo: boolean };
export const Badge: FC<BadgeProps> = ({ tabBarBadge, isInfo }) => {
return (
<View
style={{
position: "relative",
top: -5,
right: 0,
zIndex: 100,
padding: 1,
width: 0,
}}
>
<View
style={{
position: "absolute",
top: 0,
left: 0,
backgroundColor: isInfo ? "#00b8ff" : "red",
borderRadius: 10,
padding: 2,
shadowColor: "#000",
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 0.5,
shadowRadius: 4,
elevation: 2
}}
>
<Text style={{ color: "white", paddingHorizontal: 4 }}>
{tabBarBadge}
</Text>
</View>
</View>
);
};

View File

@ -1,5 +1,4 @@
import React, { FC } from "react"; export const buildProvidersTree = (providers) => {
export const buildProvidersTree:FC<any> = (providers) => {
// 基本ケースContextProviderが1つしか残っていない場合、それを返して終了する // 基本ケースContextProviderが1つしか残っていない場合、それを返して終了する
if (providers.length === 1) { if (providers.length === 1) {
return providers[0]; return providers[0];

File diff suppressed because it is too large Load Diff

115
menu.js
View File

@ -1,5 +1,5 @@
import React, { useRef, useState, useEffect } from "react"; import React, { useRef, useState, useEffect } from "react";
import Carousel from "react-native-reanimated-carousel"; import Carousel, { Pagination } from "react-native-snap-carousel";
import { import {
Platform, Platform,
View, View,
@ -8,7 +8,6 @@ import {
Text, Text,
TouchableOpacity, TouchableOpacity,
LayoutAnimation, LayoutAnimation,
Dimensions,
} from "react-native"; } from "react-native";
import Constants from "expo-constants"; import Constants from "expo-constants";
import * as Location from "expo-location"; import * as Location from "expo-location";
@ -33,10 +32,9 @@ import { SheetManager } from "react-native-actions-sheet";
import { useTrainDelayData } from "./stateBox/useTrainDelayData"; import { useTrainDelayData } from "./stateBox/useTrainDelayData";
import { useNavigation } from "@react-navigation/native"; import { useNavigation } from "@react-navigation/native";
import { useStationList } from "./stateBox/useStationList"; import { useStationList } from "./stateBox/useStationList";
import { StationNumber } from "./components/Menu/StationPagination"; import { Paginations } from "./components/Menu/StationPagination";
import lineColorList from "./assets/originData/lineColorList"; import lineColorList from "./assets/originData/lineColorList";
import { AS } from "./storageControl"; import { AS } from "./storageControl";
import { SimpleDot } from "./components/Menu/SimpleDot";
export default function Menu({ getCurrentTrain }) { export default function Menu({ getCurrentTrain }) {
const { navigate } = useNavigation(); const { navigate } = useNavigation();
@ -120,20 +118,32 @@ export default function Menu({ getCurrentTrain }) {
const count = selectedCurrentStation - 1; const count = selectedCurrentStation - 1;
setSelectedCurrentStation(count); setSelectedCurrentStation(count);
} }
}, [selectedCurrentStation, currentStation, allStationData]); }, [selectedCurrentStation, currentStation, favoriteStation]);
useEffect(() => { useEffect(() => {
if (!carouselRef.current) return; if (!carouselRef.current) return;
carouselRef?.current.scrollTo({ if (carouselRef.current?._itemToSnapTo != selectedCurrentStation) {
count: selectedCurrentStation - carouselRef.current.getCurrentIndex(), carouselRef.current.snapToItem(0);
animated: true, carouselRef.current.snapToItem(selectedCurrentStation);
}); }
}, [selectedCurrentStation]); }, [selectedCurrentStation]);
//全列車ダイヤリストを作成するuseEffect //全列車ダイヤリストを作成するuseEffect
const [trainDiagram, setTrainDiagram] = useState(null); // 全列車のダイヤを列番ベースで整理 const [trainDiagram, setTrainDiagram] = useState(null); // 全列車のダイヤを列番ベースで整理
useEffect(() => { useEffect(() => {
//全列車リストを生成する副作用[無条件初回実行] //全列車リストを生成する副作用[無条件初回実行]
setTrainDiagram(trainList); fetch(
"https://train.jr-shikoku.co.jp/g?arg1=station&arg2=traintimeinfo&arg3=dia",
HeaderConfig
)
.then((response) => response.text())
.then((d) => {
if (d.indexOf("<title>404 Not Found</title>") != -1) throw Error;
setTrainDiagram(parseAllTrainDiagram(d));
})
.catch(() => {
console.log("fallback");
setTrainDiagram(trainList);
});
}, []); }, []);
const oPSign = () => { const oPSign = () => {
@ -164,11 +174,10 @@ export default function Menu({ getCurrentTrain }) {
}); });
AS.setItem( AS.setItem(
"CarouselSettings/activeDotSettings", "CarouselSettings/activeDotSettings",
!dotButton ? "true" : "false" !dotButton ? "true": "false"
); );
setDotButton(!dotButton); setDotButton(!dotButton);
}; }
const width = Dimensions.get("window").width;
return ( return (
<View <View
style={{ style={{
@ -182,80 +191,41 @@ export default function Menu({ getCurrentTrain }) {
<ScrollView> <ScrollView>
<TopMenuButton /> <TopMenuButton />
{originalStationList.length != 0 && allStationData.length != 0 && ( {originalStationList.length != 0 && allStationData.length != 0 && (
<View style={{ flex: 1, paddingTop: 10 }}> <>
<Carousel <Carousel
ref={carouselRef} ref={carouselRef}
layout={"default"}
data={originalStationList && allStationData} data={originalStationList && allStationData}
height={(wp("80%") / 20) * 9 + 10} sliderWidth={wp("100%")}
pagingEnabled={true} itemWidth={wp("80%")}
snapEnabled={true} enableMomentum
loop={false} callbackOffsetMargin={1000}
width={width} activeAnimationOptions={0.3}
style={{ width: width, alignContent: "center" }}
mode="parallax"
modeConfig={{
parallaxScrollingScale: 1,
parallaxScrollingOffset: 100,
parallaxAdjacentItemScale: 0.8,
}}
onSnapToItem={setSelectedCurrentStation} onSnapToItem={setSelectedCurrentStation}
renderItem={({ item, index }) => { renderItem={({ item }) => {
return ( return (
<View <View
style={{ style={{ marginVertical: 10 }}
backgroundColor: "#0000",
width: width,
flexDirection: "row",
marginLeft: 0,
marginRight: 0,
}}
key={item[0].StationNumber} key={item[0].StationNumber}
> >
<View style={{ flex: 1 }} />
<Sign <Sign
currentStation={item} currentStation={item}
isCurrentStation={item == currentStation} isCurrentStation={item == currentStation}
oP={oPSign} oP={oPSign}
oLP={oLPSign} oLP={oLPSign}
/> />
<View style={{ flex: 1 }} />
</View> </View>
); );
}} }}
/> />
<View <Paginations
style={{ entries={allStationData}
flexDirection: "row", activeSlide={selectedCurrentStation}
justifyContent: "center", carouselRef={carouselRef}
alignContent: "center", setSelectedCurrentStation={setSelectedCurrentStation}
alignItems: "center", dotButton={dotButton}
}} />
> </>
{originalStationList &&
allStationData.map((d, index) => {
const active = index == selectedCurrentStation;
const numberIndex = d[0].StationNumber;
if (dotButton) {
return (
<StationNumber
onPress={() => setSelectedCurrentStation(index)}
currentStation={d}
active={active}
index={numberIndex}
/>
);
} else {
return (
<SimpleDot
onPress={() => setSelectedCurrentStation(index)}
active={active}
index={numberIndex}
/>
);
}
})}
</View>
</View>
)} )}
{allStationData.length != 0 && {allStationData.length != 0 &&
originalStationList.length != 0 && originalStationList.length != 0 &&
@ -392,13 +362,10 @@ const JRSTraInfoBox = () => {
/> />
</View> </View>
) : delayData ? ( ) : delayData ? (
delayData.map((d, index, array) => { delayData.map((d,index,array) => {
let data = d.split(" "); let data = d.split(" ");
return ( return (
<View <View style={{ flexDirection: "row" }} key={data[1] + "key"+index}>
style={{ flexDirection: "row" }}
key={data[1] + "key" + index}
>
<Text style={{ flex: 15, fontSize: 18 }}> <Text style={{ flex: 15, fontSize: 18 }}>
{data[0].replace("\n", "")} {data[0].replace("\n", "")}
</Text> </Text>

63
ndView.js Normal file
View File

@ -0,0 +1,63 @@
import React, { useRef, useState } from "react";
import { View, Platform, TouchableOpacity } from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
import { Ionicons } from "@expo/vector-icons";
export default function tndView() {
const webview = useRef();
const jsa = `
document.querySelector('.sitettl').style.display = 'none';
document.querySelector('.attention').style.display = 'none';
`;
return (
<View
style={{
backgroundColor: "#309AC3",
height: "100%",
paddingTop: Platform.OS == "ios" ? Constants.statusBarHeight : 0,
}}
>
<WebView
useWebKit={true}
ref={webview}
source={{ uri: "https://www.jr-shikoku.co.jp/info/" }}
originWhitelist={["https://www.jr-shikoku.co.jp"]}
mixedContentMode={"compatibility"}
javaScriptEnabled={true}
injectedJavaScript={jsa}
pullToRefreshEnabled
onError={() => this.webView?.reload()}
/>
<ReloadButton
onPress={() => webview.current?.reload()}
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
/>
</View>
);
}
const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => {
const styles = {
position: "absolute",
top,
right: 10,
width: 50,
height: 50,
backgroundColor: LoadError ? "red" : "#0099CC",
borderColor: "white",
borderStyle: "solid",
borderWidth: 1,
borderRadius: 50,
alignContent: "center",
alignSelf: "center",
alignItems: "center",
display: mapSwitch,
};
return (
<TouchableOpacity onPress={onPress} style={styles}>
<View style={{ flex: 1 }} />
<Ionicons name="reload" color="white" size={30} />
<View style={{ flex: 1 }} />
</TouchableOpacity>
);
};

View File

@ -1,137 +0,0 @@
import React, { Ref, useRef, useState } from "react";
import { View, Platform, TouchableOpacity, StyleProp, ViewStyle } from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
import { Ionicons } from "@expo/vector-icons";
export default function tndView() {
const webview = useRef<WebView>(null);
const jsa = `
document.querySelector('.sitettl').style.display = 'none';
document.querySelector('.attention').style.display = 'none';
document.querySelector('.mapheader').style.display = 'none';
document.querySelector('.map').style.width = '100vw';
document.querySelector('.map').style.display = 'block';
document.querySelector('.map').style.marginLeft = '-5px';
document.querySelector('.map').style.marginTop = '0px';
document.querySelector('.mapbase > img').style.width = '100vw';
document.querySelector('.ml_station > img').style.width = '100vw';
document.querySelector('.ml_seto >img').removeAttribute('width');
document.querySelector('.ml_seto >img').removeAttribute('height');
document.querySelector('.ml_seto >img').style.width = '14.5vw';
document.querySelector('.ml_seto').style.top = '0.2vw';
document.querySelector('.ml_seto').style.right = '25.8vw';
document.querySelector('.ml_yosan1 >img').removeAttribute('width');
document.querySelector('.ml_yosan1 >img').removeAttribute('height');
document.querySelector('.ml_yosan1 >img').style.width = '42.6vw';
document.querySelector('.ml_yosan1').style.top = '5.1vw';
document.querySelector('.ml_yosan1').style.left = '18.7vw';
document.querySelector('.ml_yosan2 >img').removeAttribute('width');
document.querySelector('.ml_yosan2 >img').removeAttribute('height');
document.querySelector('.ml_yosan2 >img').style.width = '12.2vw';
document.querySelector('.ml_yosan2').style.top = '8.6vw';
document.querySelector('.ml_yosan2').style.left = '8.0vw';
document.querySelector('.ml_dosan1 >img').removeAttribute('width');
document.querySelector('.ml_dosan1 >img').removeAttribute('height');
document.querySelector('.ml_dosan1 >img').style.width = '13.5vw';
document.querySelector('.ml_dosan1').style.top = '6.6vw';
document.querySelector('.ml_dosan1').style.left = '47.8vw';
document.querySelector('.ml_dosan2 >img').removeAttribute('width');
document.querySelector('.ml_dosan2 >img').removeAttribute('height');
document.querySelector('.ml_dosan2 >img').style.width = '22.5vw';
document.querySelector('.ml_dosan2').style.top = '32vw';
document.querySelector('.ml_dosan2').style.left = '26.5vw';
document.querySelector('.ml_kotoku >img').removeAttribute('width');
document.querySelector('.ml_kotoku >img').removeAttribute('height');
document.querySelector('.ml_kotoku >img').style.width = '17vw';
document.querySelector('.ml_kotoku').style.top = '6.5vw';
document.querySelector('.ml_kotoku').style.left = '72.9vw';
document.querySelector('.ml_mugi >img').removeAttribute('width');
document.querySelector('.ml_mugi >img').removeAttribute('height');
document.querySelector('.ml_mugi >img').style.width = '11.6vw';
document.querySelector('.ml_mugi').style.top = '23.6vw';
document.querySelector('.ml_mugi').style.left = '78.3vw';
document.querySelector('.ml_tokushima >img').removeAttribute('width');
document.querySelector('.ml_tokushima >img').removeAttribute('height');
document.querySelector('.ml_tokushima >img').style.width = '27.8vw';
document.querySelector('.ml_tokushima').style.top = '17vw';
document.querySelector('.ml_tokushima').style.left = '61.3vw';
document.querySelector('.ml_naruto >img').removeAttribute('width');
document.querySelector('.ml_naruto >img').removeAttribute('height');
document.querySelector('.ml_naruto >img').style.width = '5.5vw';
document.querySelector('.ml_naruto').style.top = '17.1vw';
document.querySelector('.ml_naruto').style.left = '88.5vw';
document.querySelector('.ml_yodo >img').removeAttribute('width');
document.querySelector('.ml_yodo >img').removeAttribute('height');
document.querySelector('.ml_yodo >img').style.width = '18.3vw';
document.querySelector('.ml_yodo').style.top = '30.2vw';
document.querySelector('.ml_yodo').style.left = '9.6vw';
setInterval(() => {
document.querySelectorAll('.ml_seto, .ml_yosan1, .ml_yosan2, .ml_dosan1, .ml_dosan2, .ml_kotoku, .ml_mugi, .ml_tokushima, .ml_naruto, .ml_yodo').forEach(el => {
el.style.visibility = el.style.visibility === 'hidden' ? 'visible' : 'hidden';
});
}, 1000);
`;
return (
<View
style={{
backgroundColor: "#309AC3",
height: "100%",
paddingTop: Platform.OS == "ios" ? Constants.statusBarHeight : 0,
}}
>
<WebView
ref={webview}
source={{ uri: "https://www.jr-shikoku.co.jp/info/" }}
originWhitelist={["https://www.jr-shikoku.co.jp"]}
mixedContentMode={"compatibility"}
javaScriptEnabled={true}
injectedJavaScript={jsa}
pullToRefreshEnabled
onError={() => this.webView?.reload()}
onMessage={()=>{}}
/>
<ReloadButton
onPress={() => webview.current.reload()}
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
/>
</View>
);
}
const ReloadButton = ({ onPress, top, LoadError = false }) => {
const styles:StyleProp<ViewStyle> = {
position: "absolute",
top,
right: 10,
width: 50,
height: 50,
backgroundColor: LoadError ? "red" : "#0099CC",
borderColor: "white",
borderStyle: "solid",
borderWidth: 1,
borderRadius: 50,
alignContent: "center",
alignSelf: "center",
alignItems: "center",
};
return (
<TouchableOpacity onPress={onPress} style={styles}>
<View style={{ flex: 1 }} />
<Ionicons name="reload" color="white" size={30} />
<View style={{ flex: 1 }} />
</TouchableOpacity>
);
};

View File

@ -8,69 +8,54 @@
}, },
"dependencies": { "dependencies": {
"@expo/ngrok": "^4.1.0", "@expo/ngrok": "^4.1.0",
"@expo/vector-icons": "^14.0.2", "@expo/vector-icons": "^14.0.0",
"@gorhom/bottom-sheet": "^5", "@react-native-async-storage/async-storage": "1.21.0",
"@react-native-async-storage/async-storage": "1.23.1", "@react-native-community/masked-view": "0.1.10",
"@react-native-masked-view/masked-view": "0.3.2", "@react-navigation/bottom-tabs": "^5.11.11",
"@react-navigation/bottom-tabs": "^7.2.0", "@react-navigation/native": "^5.9.4",
"@react-navigation/native": "^7.0.14", "@react-navigation/stack": "^5.14.5",
"@react-navigation/stack": "^7.1.1",
"@rneui/base": "^0.0.0-edge.2",
"@rneui/themed": "^0.0.0-edge.2",
"dayjs": "^1.11.9", "dayjs": "^1.11.9",
"expo": "^52.0.0", "eas-cli": "^5.9.1",
"expo-alternate-app-icons": "^1.3.0", "expo": "^50.0.11",
"expo-clipboard": "~7.0.1", "expo-dev-client": "~3.3.9",
"expo-constants": "~17.0.4", "expo-device": "~5.9.3",
"expo-dev-client": "~5.0.9", "expo-font": "~11.10.3",
"expo-device": "~7.0.2", "expo-location": "~16.5.5",
"expo-font": "~13.0.3", "expo-notifications": "~0.27.6",
"expo-haptics": "~14.0.1", "expo-screen-orientation": "~6.4.1",
"expo-intent-launcher": "~12.0.2", "expo-sharing": "~11.10.0",
"expo-linear-gradient": "~14.0.2", "expo-updates": "~0.24.11",
"expo-linking": "~7.0.4", "expo-web-browser": "~12.8.2",
"expo-localization": "~16.0.1",
"expo-location": "~18.0.5",
"expo-notifications": "~0.29.12",
"expo-screen-orientation": "~8.0.4",
"expo-sharing": "~13.0.1",
"expo-status-bar": "~2.0.1",
"expo-updates": "~0.26.12",
"expo-video": "~2.0.5",
"expo-web-browser": "~14.0.2",
"firebase": "8.2.3", "firebase": "8.2.3",
"lottie-react-native": "7.1.0", "lottie-react-native": "6.5.1",
"native-base": "^2.15.2", "native-base": "^2.15.2",
"npm": "^7.18.1",
"pushy-react-native": "^1.0.18", "pushy-react-native": "^1.0.18",
"react": "18.3.1", "react": "18.2.0",
"react-native": "0.76.6", "react-native": "0.73.4",
"react-native-actions-sheet": "0.8.21", "react-native-actions-sheet": "0.8.21",
"react-native-android-widget": "^0.15.1", "react-native-android-widget": "^0.11.2",
"react-native-auto-height-image": "^3.2.4", "react-native-auto-height-image": "^3.2.4",
"react-native-elements": "^3.4.2", "react-native-elements": "^3.4.2",
"react-native-gesture-handler": "~2.20.2", "react-native-gesture-handler": "~2.14.0",
"react-native-maps": "1.18.0", "react-native-maps": "1.10.0",
"react-native-reanimated": "~3.16.1", "react-native-reanimated": "~3.6.2",
"react-native-reanimated-carousel": "^3.5.1",
"react-native-remote-svg": "^2.0.6", "react-native-remote-svg": "^2.0.6",
"react-native-responsive-screen": "^1.4.2", "react-native-responsive-screen": "^1.4.2",
"react-native-router-flux": "^4.3.1", "react-native-router-flux": "^4.3.1",
"react-native-safe-area-context": "4.12.0", "react-native-safe-area-context": "4.8.2",
"react-native-screens": "~4.4.0", "react-native-screens": "~3.29.0",
"react-native-snap-carousel": "^3.9.1", "react-native-snap-carousel": "^3.9.1",
"react-native-sortables": "^1.1.0",
"react-native-storage": "^1.0.1", "react-native-storage": "^1.0.1",
"react-native-svg": "15.8.0", "react-native-svg": "14.1.0",
"react-native-svg-uri": "^1.2.3", "react-native-svg-uri": "^1.2.3",
"react-native-touchable-scale": "^2.2.0", "react-native-vector-icons": "^8.1.0",
"react-native-vector-icons": "^10.2.0", "react-native-view-shot": "3.8.0",
"react-native-view-shot": "~4.0.3", "react-native-webview": "13.6.4",
"react-native-walkthrough-tooltip": "^1.6.0",
"react-native-webview": "13.12.5",
"typescript": "^5.3.0" "typescript": "^5.3.0"
}, },
"devDependencies": { "devDependencies": {
"babel-preset-expo": "~12.0.0" "babel-preset-expo": "^10.0.0"
}, },
"private": true "private": true
} }

View File

@ -4,7 +4,6 @@ import React, {
useState, useState,
useEffect, useEffect,
useLayoutEffect, useLayoutEffect,
FC,
} from "react"; } from "react";
import { AS } from "../storageControl"; import { AS } from "../storageControl";
import { useStationList } from "./useStationList"; import { useStationList } from "./useStationList";
@ -14,20 +13,13 @@ const initialState = {
lodAddMigration: () => {}, lodAddMigration: () => {},
}; };
type initialStateType = { const FavoriteStationContext = createContext(initialState);
favoriteStation: any[];
setFavoriteStation: (d:any)=>void;
lodAddMigration: ()=>void;
};
const FavoriteStationContext = createContext<initialStateType>(initialState);
export const useFavoriteStation = () => { export const useFavoriteStation = () => {
return useContext(FavoriteStationContext); return useContext(FavoriteStationContext);
}; };
type Props = {
children: React.ReactNode; export const FavoriteStationProvider = ({ children }) => {
};
export const FavoriteStationProvider:FC<Props> = ({ children }) => {
const [favoriteStation, setFavoriteStation] = useState([]); const [favoriteStation, setFavoriteStation] = useState([]);
const { getStationData } = useStationList(); const { getStationData } = useStationList();
const lodAddMigration = () => { const lodAddMigration = () => {

View File

@ -6,7 +6,9 @@ import React, {
FC, FC,
useRef, useRef,
} from "react"; } from "react";
import { Platform } from "react-native"; // 6.0でライブラリ変更
import { Platform, Clipboard } from "react-native";
// 6.0でライブラリ更新、tsの型定義が変わった
import * as Notifications from "expo-notifications"; import * as Notifications from "expo-notifications";
import * as Device from "expo-device"; import * as Device from "expo-device";
import Constants from "expo-constants"; import Constants from "expo-constants";

View File

@ -42,9 +42,7 @@ export const TrainMenuProvider = ({ children }) => {
const [mapsStationData, setMapsStationData] = useState(undefined); const [mapsStationData, setMapsStationData] = useState(undefined);
const [injectJavaScript, setInjectJavaScript] = useState(); const [injectJavaScript, setInjectJavaScript] = useState();
useEffect(() => { useEffect(() => getStationList2().then(setMapsStationData), []);
getStationList2().then(setMapsStationData);
}, []);
//画面表示関連 //画面表示関連
const [iconSetting, setIconSetting] = useState(undefined); const [iconSetting, setIconSetting] = useState(undefined);
@ -74,6 +72,7 @@ export const TrainMenuProvider = ({ children }) => {
//列車アイコンスイッチ //列車アイコンスイッチ
ASCore({ k: "iconSwitch", s: setIconSetting, d: "true", u: true }); ASCore({ k: "iconSwitch", s: setIconSetting, d: "true", u: true });
//地図スイッチ //地図スイッチ
//6.0.0以降true
ASCore({ k: "mapSwitch", s: setMapSwitch, d: "false", u: true }); ASCore({ k: "mapSwitch", s: setMapSwitch, d: "false", u: true });
//駅メニュースイッチ //駅メニュースイッチ
ASCore({ k: "stationSwitch", s: setStationMenu, d: "true", u: true }); ASCore({ k: "stationSwitch", s: setStationMenu, d: "true", u: true });

7074
yarn.lock

File diff suppressed because it is too large Load Diff