Merge commit '77328bf97acfac463b198d6cea559a14873f6d46' into develop
31
Apps.js
@ -18,36 +18,43 @@ export function AppContainer() {
|
|||||||
name,
|
name,
|
||||||
options: {
|
options: {
|
||||||
tabBarLabel: label,
|
tabBarLabel: label,
|
||||||
headerTransparent: true,
|
headerShown: false,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
tabBarIcon: initIcon(icon, iconFamily),
|
tabBarIcon: initIcon(icon, iconFamily),
|
||||||
tabBarBadge,
|
tabBarBadge,
|
||||||
tabBarBadgeStyle: style,
|
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 name="Root" style={{ flex: 1 }} ref={navigationRef}>
|
<NavigationContainer ref={navigationRef}>
|
||||||
<Tab.Navigator
|
<Tab.Navigator
|
||||||
tabBarOptions={{ keyboardHidesTabBar: Platform.OS === "android" }}
|
tabBarOptions={{ keyboardHidesTabBar: Platform.OS === "android" }}
|
||||||
initialRouteName="menuPage"
|
initialRouteName="topMenu"
|
||||||
|
screenOptions={{
|
||||||
|
lazy: false,
|
||||||
|
animation: "shift",
|
||||||
|
tabBarVariant: "uikit",
|
||||||
|
}}
|
||||||
|
detachInactiveScreens={false}
|
||||||
lazy={false}
|
lazy={false}
|
||||||
>
|
>
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
{...getTabProps("login", "位置情報", "barchart", "AntDesign")}
|
{...getTabProps("positions", "走行位置", "barchart", "AntDesign")}
|
||||||
children={(props) => <Top {...props} navigationRef={navigationRef} />}
|
component={Top}
|
||||||
/>
|
/>
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
{...getTabProps("menuPage", "リンク", "radio", "Ionicons")}
|
{...getTabProps("topMenu", "トップメニュー", "radio", "Ionicons")}
|
||||||
component={MenuPage}
|
component={MenuPage}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
{...getTabProps(
|
{...getTabProps(
|
||||||
"home",
|
"information",
|
||||||
"運行情報",
|
"運行情報",
|
||||||
"train",
|
"train",
|
||||||
"Ionicons",
|
"Ionicons",
|
||||||
@ -57,7 +64,7 @@ export function AppContainer() {
|
|||||||
color: "white",
|
color: "white",
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
children={(props) => <TNDView {...props} />}
|
children={TNDView}
|
||||||
/>
|
/>
|
||||||
</Tab.Navigator>
|
</Tab.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
|
29
MenuPage.js
@ -1,12 +1,11 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import {
|
import { createStackNavigator } from "@react-navigation/stack";
|
||||||
createStackNavigator,
|
import { CommonActions } from "@react-navigation/native";
|
||||||
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";
|
||||||
@ -14,6 +13,7 @@ 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,12 +24,19 @@ export function MenuPage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
AS.getItem("startPage")
|
AS.getItem("startPage")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res == "true") navigation.navigate("login");
|
if (res == "true") navigation.navigate("positions");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
//6.0以降false
|
//6.0以降false
|
||||||
AS.setItem("startPage", "true");
|
AS.setItem("startPage", "false");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//ニュース表示
|
||||||
|
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) => {
|
||||||
@ -56,6 +63,7 @@ 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={{
|
||||||
@ -67,13 +75,8 @@ export function MenuPage() {
|
|||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="trainbase"
|
name="trainbase"
|
||||||
options={{ ...optionData, gestureResponseDistance: { vertical: 300 } }}
|
options={{ ...optionData }}
|
||||||
children={(props) => <TrainBase {...props} />}
|
component={TrainBase}
|
||||||
/>
|
|
||||||
<Stack.Screen
|
|
||||||
name="currentTrainIDList"
|
|
||||||
options={{ ...optionData, gestureResponseDistance: { vertical: 300 } }}
|
|
||||||
component={CurrentTrainListView}
|
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="AllTrainIDList"
|
name="AllTrainIDList"
|
||||||
|
70
Top.js
@ -1,8 +1,6 @@
|
|||||||
import React, { useEffect, useRef, useState } from "react";
|
import React, { useEffect } from "react";
|
||||||
import {
|
import { createStackNavigator } from "@react-navigation/stack";
|
||||||
createStackNavigator,
|
import { useNavigation } from "@react-navigation/native";
|
||||||
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";
|
||||||
@ -10,91 +8,67 @@ 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 = ({ navigationRef }) => {
|
export const Top = () => {
|
||||||
const { webview } = useCurrentTrain();
|
const { webview } = useCurrentTrain();
|
||||||
const { navigate, addListener } = useNavigation();
|
const { navigate, addListener, isFocused } = useNavigation();
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
//ニュース表示
|
|
||||||
AS.getItem("status")
|
|
||||||
.then((d) => {
|
|
||||||
if (d != news) navigate("news");
|
|
||||||
})
|
|
||||||
.catch(() => navigate("news"));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//地図用
|
//地図用
|
||||||
const { injectJavaScript, setInjectJavaScript, mapSwitch } = useTrainMenu();
|
const { injectJavaScript, mapSwitch } = useTrainMenu();
|
||||||
|
|
||||||
const goToFavoriteList = () => navigate("favoriteList");
|
const goToFavoriteList = () =>
|
||||||
|
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 (navigationRef.current?.getCurrentRoute().name == "Apps") {
|
if (!isFocused()) {
|
||||||
if (mapSwitch == "true") {
|
navigate("positions", { screen: "Apps" });
|
||||||
navigate("trainMenu");
|
|
||||||
setInjectJavaScript("");
|
|
||||||
} else {
|
|
||||||
webview.current?.injectJavaScript(`AccordionClassEvent()`);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (mapSwitch == "true") {
|
|
||||||
if (injectJavaScript) {
|
|
||||||
webview.current?.injectJavaScript(injectJavaScript);
|
|
||||||
setInjectJavaScript("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
navigate("Apps");
|
|
||||||
}
|
}
|
||||||
|
if (mapSwitch == "true") {
|
||||||
|
navigate("positions", { screen: "trainMenu" });
|
||||||
|
} else {
|
||||||
|
webview.current?.injectJavaScript(`AccordionClassEvent()`);
|
||||||
|
}
|
||||||
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unsubscribe = addListener("tabPress", goToTrainMenu);
|
const unsubscribe = addListener("tabPress", goToTrainMenu);
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
}, [{ navigate, addListener }, mapSwitch, injectJavaScript]);
|
}, [addListener, mapSwitch, injectJavaScript]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack.Navigator>
|
<Stack.Navigator detachInactiveScreens={false}>
|
||||||
<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={{
|
options={{ ...optionData }}
|
||||||
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 }}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ToastAndroid } from "react-native";
|
import { Platform, 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
@ -1,47 +1,13 @@
|
|||||||
{
|
{
|
||||||
"expo": {
|
"expo": {
|
||||||
"name": "JR四国運行状況",
|
"name": "JR四国非公式",
|
||||||
"slug": "jrshikoku",
|
"slug": "jrshikoku",
|
||||||
"privacy": "public",
|
|
||||||
"platforms": ["ios", "android"],
|
"platforms": ["ios", "android"],
|
||||||
"plugins": [
|
"version": "6.0",
|
||||||
[
|
|
||||||
"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/icon.png",
|
"icon": "./assets/icons/s8600.png",
|
||||||
"splash": {
|
"splash": {
|
||||||
"image": "./assets/splash.png",
|
"image": "./assets/splash.png",
|
||||||
"resizeMode": "contain",
|
|
||||||
"backgroundColor": "#00b8ff"
|
"backgroundColor": "#00b8ff"
|
||||||
},
|
},
|
||||||
"updates": {
|
"updates": {
|
||||||
@ -50,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"assetBundlePatterns": ["**/*"],
|
"assetBundlePatterns": ["**/*"],
|
||||||
"ios": {
|
"ios": {
|
||||||
"buildNumber": "39",
|
"buildNumber": "42",
|
||||||
"supportsTablet": false,
|
"supportsTablet": false,
|
||||||
"bundleIdentifier": "jrshikokuinfo.xprocess.hrkn",
|
"bundleIdentifier": "jrshikokuinfo.xprocess.hrkn",
|
||||||
"config": {
|
"config": {
|
||||||
@ -64,13 +30,18 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"entitlements": {
|
"entitlements": {
|
||||||
"com.apple.developer.nfc.readersession.formats": ["TAG"]
|
"com.apple.developer.nfc.readersession.formats": [
|
||||||
|
"TAG"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"package": "jrshikokuinfo.xprocess.hrkn",
|
"package": "jrshikokuinfo.xprocess.hrkn",
|
||||||
"versionCode": 22,
|
"versionCode": 23,
|
||||||
"permissions": ["ACCESS_FINE_LOCATION", "NFC"],
|
"permissions": [
|
||||||
|
"ACCESS_FINE_LOCATION",
|
||||||
|
"NFC"
|
||||||
|
],
|
||||||
"googleServicesFile": "./google-services.json",
|
"googleServicesFile": "./google-services.json",
|
||||||
"config": {
|
"config": {
|
||||||
"googleMaps": {
|
"googleMaps": {
|
||||||
@ -85,6 +56,401 @@
|
|||||||
},
|
},
|
||||||
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
assets/icons/32.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
assets/icons/32at.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
assets/icons/32kpuuy.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
assets/icons/32tht.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
assets/icons/40.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
assets/icons/54.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/54st.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
assets/icons/ef210.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
assets/icons/ef65.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
45
assets/icons/icons.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
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") },
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
BIN
assets/icons/s1000.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
assets/icons/s1200n.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
assets/icons/s1500.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
assets/icons/s185_mrt.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
assets/icons/s185iyor.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s185iyoy.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
assets/icons/s185mm1.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
assets/icons/s185to_ai.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s185tu.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s185ym1.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
assets/icons/s2000_asi.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s2000n.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/icons/s2002a.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s2600.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
assets/icons/s2700.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
assets/icons/s2700apr.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s2700apy.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
assets/icons/s5001.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
assets/icons/s5001k.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
assets/icons/s6000p.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
assets/icons/s7000.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/icons/s7200.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/icons/s8000ap.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
assets/icons/s8000nn.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
assets/icons/s8000no.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
assets/icons/s8000nr.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
assets/icons/s8600.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
assets/icons/tosa9640.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
assets/icons/tosa9640jgr.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
assets/icons/w213w.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
assets/icons/w285.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
@ -8,7 +8,6 @@ export const EachTrainInfo = ({ payload }) => {
|
|||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
gestureEnabled={true}
|
gestureEnabled={true}
|
||||||
//gestureEnabled={!actionSheetHorizonalScroll}
|
|
||||||
CustomHeaderComponent={<></>}
|
CustomHeaderComponent={<></>}
|
||||||
ref={actionSheetRef}
|
ref={actionSheetRef}
|
||||||
drawUnderStatusBar={false}
|
drawUnderStatusBar={false}
|
||||||
|
@ -9,9 +9,6 @@ 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,
|
||||||
@ -21,7 +18,6 @@ export const TrainDataView = ({
|
|||||||
mode = 0,
|
mode = 0,
|
||||||
navigate,
|
navigate,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const { stationList } = useStationList();
|
const { stationList } = useStationList();
|
||||||
|
|
||||||
const { width, height } = useWindowDimensions();
|
const { width, height } = useWindowDimensions();
|
||||||
@ -62,8 +58,9 @@ export const TrainDataView = ({
|
|||||||
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}
|
||||||
@ -73,111 +70,118 @@ export const TrainDataView = ({
|
|||||||
descInput={descInput}
|
descInput={descInput}
|
||||||
setPosInput={setPosInput}
|
setPosInput={setPosInput}
|
||||||
setDescInput={setDescInput}
|
setDescInput={setDescInput}
|
||||||
station={{Station_JP:trainPositionText(currentTrainData),StationNumber:currentPosition[0]}} />
|
station={{
|
||||||
<View
|
Station_JP: trainPositionText(currentTrainData),
|
||||||
style={{
|
StationNumber: currentPosition[0],
|
||||||
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={() => {
|
/>
|
||||||
if(!onLine) return;
|
<View
|
||||||
const test = [];
|
style={{
|
||||||
Object.keys(mapsStationData).forEach((d) => {
|
flexDirection: "row",
|
||||||
mapsStationData[d].forEach((x) => {
|
//minHeight: 200,
|
||||||
if (x.StationNumber == currentPosition[0])
|
//height: heightPercentageToDP("20%"),
|
||||||
test.push({ line: d, station: x });
|
width: isLandscape ? (width / 100) * 40 : width,
|
||||||
});
|
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");
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<StateBox
|
|
||||||
mode={mode}
|
|
||||||
title={`現在地 ${currentPosition?.toString()}${onLine ? "▶️" : ""}`}
|
|
||||||
text={trainPositionText(currentTrainData)}
|
|
||||||
endText={platformDescription ? `${platformDescription}` : ""}
|
|
||||||
style={
|
|
||||||
onLine
|
|
||||||
? { borderWidth: 1, borderColor: "red", borderStyle: "solid" }
|
|
||||||
: {}
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
|
|
||||||
<View style={{ flex: 1, flexDirection: mode == 2 ? "row" : "column" }}>
|
|
||||||
<View style={{ flex: 1, flexDirection: "row" }}>
|
|
||||||
<StateBox
|
|
||||||
mode={mode}
|
|
||||||
title={isNaN(currentTrainData?.delay) ? "状態" : "遅延時分"}
|
|
||||||
text={`${currentTrainData?.delay}${
|
|
||||||
isNaN(currentTrainData?.delay) ? "" : "分"
|
|
||||||
}`}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{ flex: 1, flexDirection: "row" }}
|
style={{ flex: 1, flexDirection: "row" }}
|
||||||
disabled={nearTrainIDList.length == 0}
|
//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={() => {
|
onPress={() => {
|
||||||
if (nearTrainIDList.length == 0) return;
|
if (!onLine) return;
|
||||||
openTrainInfo(nearTrainIDList[0]);
|
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");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{nearTrainIDList.length == 0 ? (
|
<StateBox
|
||||||
<StateBox mode={mode} title="列番" text={currentTrainData?.num} />
|
mode={mode}
|
||||||
) : (
|
title={`現在地 ${currentPosition?.toString()}${onLine ? "▶️" : ""}`}
|
||||||
|
text={trainPositionText(currentTrainData)}
|
||||||
|
endText={platformDescription ? `${platformDescription}` : ""}
|
||||||
|
style={
|
||||||
|
onLine
|
||||||
|
? { borderWidth: 1, borderColor: "red", borderStyle: "solid" }
|
||||||
|
: {}
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<View style={{ flex: 1, flexDirection: mode == 2 ? "row" : "column" }}>
|
||||||
|
<View style={{ flex: 1, flexDirection: "row" }}>
|
||||||
<StateBox
|
<StateBox
|
||||||
mode={mode}
|
mode={mode}
|
||||||
title="増解結相手を表示▶️"
|
title={isNaN(currentTrainData?.delay) ? "状態" : "遅延時分"}
|
||||||
text={`${nearTrainIDList}`}
|
text={`${currentTrainData?.delay}${
|
||||||
style={{
|
isNaN(currentTrainData?.delay) ? "" : "分"
|
||||||
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>
|
</>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -10,6 +10,7 @@ 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";
|
||||||
@ -188,7 +189,7 @@ export const EachTrainInfoCore = ({
|
|||||||
const count = position * 44 - 50;
|
const count = position * 44 - 50;
|
||||||
// 0.5秒待機してからスクロール
|
// 0.5秒待機してからスクロール
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => ScrollViewRef.current?.scrollTo({ y: count, animated: true }),
|
() => scrollHandlers.ref.current?.scrollTo({ y: count, animated: true }),
|
||||||
400
|
400
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -219,8 +220,9 @@ export const EachTrainInfoCore = ({
|
|||||||
|
|
||||||
const { height } = useWindowDimensions();
|
const { height } = useWindowDimensions();
|
||||||
const { isLandscape } = useDeviceOrientationChange();
|
const { isLandscape } = useDeviceOrientationChange();
|
||||||
const ScrollViewRef = useRef();
|
const scrollHandlers = actionSheetRef
|
||||||
|
? useScrollHandlers("scrollview-1", actionSheetRef)
|
||||||
|
: null;
|
||||||
const [trueTrainID, setTrueTrainID] = useState();
|
const [trueTrainID, setTrueTrainID] = useState();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!data.trainNum) return;
|
if (!data.trainNum) return;
|
||||||
@ -335,8 +337,7 @@ export const EachTrainInfoCore = ({
|
|||||||
.then((d) => {
|
.then((d) => {
|
||||||
if (d) setTrainPositionSwitch(d);
|
if (d) setTrainPositionSwitch(d);
|
||||||
})
|
})
|
||||||
//6.0で変更
|
.catch(() => AS.setItem("trainPositionSwitch", "true"));
|
||||||
.catch(() => AS.setItem("trainPositionSwitch", "false"));
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const openTrainInfo = (d) => {
|
const openTrainInfo = (d) => {
|
||||||
@ -412,7 +413,7 @@ export const EachTrainInfoCore = ({
|
|||||||
from={from}
|
from={from}
|
||||||
styles={styles}
|
styles={styles}
|
||||||
actionSheetRef={actionSheetRef}
|
actionSheetRef={actionSheetRef}
|
||||||
ScrollViewRef={ScrollViewRef}
|
scrollHandlers={scrollHandlers}
|
||||||
containerProps={{
|
containerProps={{
|
||||||
style: {
|
style: {
|
||||||
maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
|
maxHeight: isLandscape ? height - 94 : (height / 100) * 70,
|
||||||
|
@ -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("サンポート")
|
||||||
|
@ -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 { navigate } = useNavigation();
|
const { goBack, 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={() => navigate("menu")}
|
onPress={goBack}
|
||||||
string="閉じる"
|
string="閉じる"
|
||||||
style={{
|
style={{
|
||||||
display:
|
display:
|
||||||
|
@ -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 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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 }) {
|
||||||
|
@ -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":
|
||||||
|
@ -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"),
|
||||||
};
|
};
|
||||||
SheetManager.show("StationDetailView", { payload });
|
setTimeout(()=>SheetManager.show("StationDetailView", { payload }),50);
|
||||||
} else {
|
} else {
|
||||||
SheetManager.hide("StationDetailView");
|
SheetManager.hide("StationDetailView");
|
||||||
}
|
}
|
||||||
|
@ -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 { navigate } = useNavigation();
|
const { goBack } = 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={() => navigate("menu")} string="閉じる" />
|
<BigButton onPress={goBack} string="閉じる" />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -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 { useScrollHandlers } from "react-native-actions-sheet";
|
import { NativeViewGestureHandler } from "react-native-gesture-handler";
|
||||||
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,
|
||||||
ScrollViewRef,
|
scrollHandlers,
|
||||||
} = props;
|
} = props;
|
||||||
const [headerSize, setHeaderSize] = useState("default");
|
const [headerSize, setHeaderSize] = useState("default");
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
@ -53,9 +53,7 @@ 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: {
|
||||||
@ -110,6 +108,7 @@ 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);
|
||||||
@ -153,26 +152,31 @@ export const DynamicHeaderScrollView = (props) => {
|
|||||||
{topStickyContent}
|
{topStickyContent}
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</View>
|
</View>
|
||||||
<ScrollView
|
<NativeViewGestureHandler
|
||||||
{...scrollHandlers}
|
simultaneousHandlers={scrollHandlers.simultaneousHandlers}
|
||||||
style={{ backgroundColor: "white", zIndex: 0 }}
|
|
||||||
stickyHeaderIndices={[1]}
|
|
||||||
scrollEventThrottle={16}
|
|
||||||
onScroll={onScroll}
|
|
||||||
ref={ScrollViewRef}
|
|
||||||
>
|
>
|
||||||
<View style={{ height: Scroll_Distance, flexDirection: "column" }} />
|
<ScrollView
|
||||||
{topStickyContent && (
|
nestedScrollEnabled
|
||||||
<View
|
ref={scrollHandlers.ref}
|
||||||
style={{
|
onLayout={scrollHandlers.onLayout}
|
||||||
paddingTop: Min_Header_Height + 40,
|
scrollEventThrottle={scrollHandlers.scrollEventThrottle}
|
||||||
flexDirection: "column",
|
style={{ backgroundColor: "white", zIndex: 0 }}
|
||||||
}}
|
stickyHeaderIndices={[1]}
|
||||||
index={1}
|
onScroll={onScroll}
|
||||||
/>
|
>
|
||||||
)}
|
<View style={{ height: Scroll_Distance, flexDirection: "column" }} />
|
||||||
{children}
|
{topStickyContent && (
|
||||||
</ScrollView>
|
<View
|
||||||
|
style={{
|
||||||
|
paddingTop: Min_Header_Height + 40,
|
||||||
|
flexDirection: "column",
|
||||||
|
}}
|
||||||
|
index={1}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{children}
|
||||||
|
</ScrollView>
|
||||||
|
</NativeViewGestureHandler>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React, { useEffect } from "react";
|
||||||
import { View, Text, TouchableOpacity, ScrollView } from "react-native";
|
import { View, Text, 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,9 +11,18 @@ 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, goBack } = useNavigation();
|
const { navigate, addListener, goBack, canGoBack } = 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
|
||||||
@ -50,7 +59,8 @@ 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 />");`
|
||||||
);
|
);
|
||||||
navigate("Apps");
|
goBack();
|
||||||
|
if (canGoBack()) goBack();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
|
@ -5,10 +5,11 @@ 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 (
|
||||||
@ -249,10 +250,16 @@ export const FixedContentBottom = (props) => {
|
|||||||
name: "しこくたぬきのぽんちゃん 【四国家サポーターズクラブ】",
|
name: "しこくたぬきのぽんちゃん 【四国家サポーターズクラブ】",
|
||||||
},
|
},
|
||||||
].map((d) => (
|
].map((d) => (
|
||||||
<ListItem onPress={() => Linking.openURL(d.url)}>
|
<ListItem bottomDivider onPress={() => Linking.openURL(d.url)}
|
||||||
<Text>{d.name}</Text>
|
key={d.url}friction={90} //
|
||||||
<View style={{ flex: 1 }} />
|
tension={100} // These props are passed to the parent component (here TouchableScale)
|
||||||
<Icon name="chevron-right" size={20} />
|
activeScale={0.95} //
|
||||||
|
Component={TouchableScale}
|
||||||
|
>
|
||||||
|
<ListItem.Content>
|
||||||
|
<ListItem.Title>{d.name}</ListItem.Title>
|
||||||
|
</ListItem.Content>
|
||||||
|
<ListItem.Chevron />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
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";
|
||||||
@ -27,49 +26,11 @@ type StationPaginationProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Paginations: FC<StationPaginationProps> = (props) => {
|
export const Paginations: FC<StationPaginationProps> = (props) => {
|
||||||
const {
|
const { entries, setSelectedCurrentStation } = props;
|
||||||
entries,
|
|
||||||
activeSlide,
|
|
||||||
carouselRef,
|
|
||||||
setSelectedCurrentStation,
|
|
||||||
dotButton,
|
|
||||||
} = props;
|
|
||||||
return (
|
return (
|
||||||
<Pagination
|
<StationNumberMaker
|
||||||
dotsLength={entries.length}
|
currentStations={entries}
|
||||||
activeDotIndex={activeSlide}
|
setSelectedCurrentStation={setSelectedCurrentStation}
|
||||||
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}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
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 = ({ navigate }) => {
|
export const FavoriteSettings = () => {
|
||||||
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={() => navigate("settingTopPage")}
|
onPress={goBack}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
147
components/Settings/LauncherIconSettings.js
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
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>
|
||||||
|
);
|
||||||
|
};
|
@ -1,5 +1,6 @@
|
|||||||
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";
|
||||||
@ -21,12 +22,13 @@ 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={() => navigate("settingTopPage")}
|
onPress={goBack}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { View, Text, TouchableOpacity, ScrollView,Clipboard } from "react-native";
|
import { View, Text, TouchableOpacity, ScrollView } 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 = ({ navigate }) => {
|
export const NotificationSettings = () => {
|
||||||
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);
|
||||||
@ -21,9 +24,7 @@ export const NotificationSettings = ({ navigate }) => {
|
|||||||
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
|
<View style={{ backgroundColor: "#0099CC", flexDirection: "row" }}>
|
||||||
<View style={{ flex: 1 }}>
|
<View style={{ flex: 1 }}>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
onPress={() => {
|
onPress={goBack}
|
||||||
navigate("settingTopPage");
|
|
||||||
}}
|
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@ -40,7 +41,7 @@ export const NotificationSettings = ({ navigate }) => {
|
|||||||
padding: 10,
|
padding: 10,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
< 設定/送信
|
< 設定
|
||||||
</Text>
|
</Text>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
@ -79,7 +80,7 @@ export const NotificationSettings = ({ navigate }) => {
|
|||||||
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={{
|
||||||
@ -120,9 +121,10 @@ export const NotificationSettings = ({ navigate }) => {
|
|||||||
setBool={setStrangeTrain}
|
setBool={setStrangeTrain}
|
||||||
str="怪レい列車"
|
str="怪レい列車"
|
||||||
/>
|
/>
|
||||||
<Text style={{fontWeight: "bold", padding: 10 }} onPress={()=>{
|
<Text
|
||||||
Clipboard.setString(expoPushToken);
|
style={{ fontWeight: "bold", padding: 10 }}
|
||||||
}}>
|
onPress={() => Clipboard.setStringAsync(expoPushToken)}
|
||||||
|
>
|
||||||
通知を受け取りたい項目を選択してください。チェックボックスを選び、右上の「登録実行」を押すと設定が反映され、通知が届くようになります。
|
通知を受け取りたい項目を選択してください。チェックボックスを選び、右上の「登録実行」を押すと設定が反映され、通知が届くようになります。
|
||||||
</Text>
|
</Text>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -10,14 +10,15 @@ 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 { ListItem } from "native-base";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
|
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 = "5.6.0.2";
|
const versionCode = "6.0";
|
||||||
|
|
||||||
export const SettingTopPage = ({
|
export const SettingTopPage = ({
|
||||||
navigate,
|
|
||||||
testNFC,
|
testNFC,
|
||||||
startPage,
|
startPage,
|
||||||
setStartPage,
|
setStartPage,
|
||||||
@ -25,12 +26,13 @@ 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={() => navigate("menu")}
|
onPress={() => navigation.goBack()}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@ -118,179 +120,63 @@ export const SettingTopPage = ({
|
|||||||
falseText={"リンクメニュー"}
|
falseText={"リンクメニュー"}
|
||||||
trueText={"列車位置情報"}
|
trueText={"列車位置情報"}
|
||||||
/>
|
/>
|
||||||
<ListItem
|
<SettingList
|
||||||
style={{ flexDirection: "row" }}
|
string="お気に入り登録の並び替え"
|
||||||
onPress={() => navigate("FavoriteSettings")}
|
onPress={() =>
|
||||||
>
|
navigation.navigate("setting", { screen: "FavoriteSettings" })
|
||||||
<Text
|
}
|
||||||
style={{
|
/>
|
||||||
fontSize: 20,
|
<SettingList
|
||||||
alignItems: "center",
|
string={`通知設定${
|
||||||
alignContent: "center",
|
expoPushToken == "" ? "(通知設定をオンにしてください)" : "(β)"
|
||||||
textAlign: "center",
|
}`}
|
||||||
textAlignVertical: "center",
|
onPress={() =>
|
||||||
}}
|
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
|
|
||||||
style={{
|
<SettingList
|
||||||
fontSize: 20,
|
string="レイアウト設定"
|
||||||
alignItems: "center",
|
onPress={() =>
|
||||||
alignContent: "center",
|
navigation.navigate("setting", { screen: "LayoutSettings" })
|
||||||
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" ? (
|
||||||
<ListItem
|
<SettingList
|
||||||
style={{ flexDirection: "row" }}
|
string="ウィジェット設定"
|
||||||
onPress={() => navigate("WidgetSettings")}
|
onPress={() =>
|
||||||
>
|
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}
|
||||||
<ListItem
|
<SettingList
|
||||||
style={{ flexDirection: "row" }}
|
string="アイコン設定"
|
||||||
|
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
|
|
||||||
style={{
|
<SettingList
|
||||||
fontSize: 20,
|
string="開発情報"
|
||||||
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>
|
|
||||||
|
|
||||||
<View style={{ flex: 1 }} />
|
<SettingList
|
||||||
</ListItem>
|
string="運営Twitter"
|
||||||
<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={{
|
||||||
@ -328,3 +214,20 @@ 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>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
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 { SwitchArea } from "../atom/SwitchArea";
|
import { useNavigation } from "@react-navigation/native";
|
||||||
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";
|
||||||
@ -12,6 +11,7 @@ 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,7 +25,9 @@ export const WidgetSettings = ({ navigate }) => {
|
|||||||
setWidgetList(d);
|
setWidgetList(d);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(reload, []);
|
useEffect(() => {
|
||||||
|
reload();
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDelayData().then(({ time, delayString }) => {
|
getDelayData().then(({ time, delayString }) => {
|
||||||
@ -42,7 +44,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={() => navigate("settingTopPage")}
|
onPress={goBack}
|
||||||
style={{
|
style={{
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
@ -23,6 +23,7 @@ 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) {
|
||||||
@ -148,6 +149,18 @@ 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={{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@ -12,6 +13,7 @@ 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}
|
||||||
@ -24,7 +26,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) navigate("Apps");
|
if (navigate) goBack();
|
||||||
}}
|
}}
|
||||||
image={require("../../assets/reccha-small.png")}
|
image={require("../../assets/reccha-small.png")}
|
||||||
></Marker>
|
></Marker>
|
||||||
|
@ -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 { navigate } = useNavigation();
|
const { goBack } = 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);
|
||||||
navigate("Apps");
|
goBack();
|
||||||
}}
|
}}
|
||||||
string="更新情報を閉じる"
|
string="更新情報を閉じる"
|
||||||
/>
|
/>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
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, { Marker } from "react-native-maps";
|
import MapView 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";
|
||||||
@ -15,7 +14,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 } = useNavigation();
|
const { navigate, goBack } = useNavigation();
|
||||||
const [stationPin, setStationPin] = useState([]);
|
const [stationPin, setStationPin] = useState([]);
|
||||||
const {
|
const {
|
||||||
selectedLine,
|
selectedLine,
|
||||||
@ -35,12 +34,6 @@ 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 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -82,7 +75,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>
|
||||||
@ -152,7 +145,26 @@ 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={() => setSelectedLine(selectedLine == d ? undefined : d)}
|
onPress={() => {
|
||||||
|
const s = selectedLine == d ? undefined : d;
|
||||||
|
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 }}
|
||||||
@ -201,7 +213,7 @@ export default function TrainMenu({ style }) {
|
|||||||
)}
|
)}
|
||||||
<MapsButton
|
<MapsButton
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
navigate("Apps");
|
goBack();
|
||||||
webview.current?.injectJavaScript(injectJavaScript);
|
webview.current?.injectJavaScript(injectJavaScript);
|
||||||
}}
|
}}
|
||||||
top={0}
|
top={0}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useRef } from "react";
|
import React 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,44 +6,40 @@ 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, from } = route.params;
|
const { info } = route.params;
|
||||||
const { navigate } = useNavigation();
|
const { goBack } = useNavigation();
|
||||||
const webview = useRef();
|
const jss = `
|
||||||
const jss = `document.getElementById('Footer').style.display = 'none';
|
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={true}
|
useWebKit
|
||||||
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",
|
||||||
]}
|
]}
|
||||||
mixedContentMode={"compatibility"}
|
|
||||||
javaScriptEnabled={true}
|
|
||||||
injectedJavaScript={jss}
|
|
||||||
setSupportMultipleWindows={false}
|
|
||||||
onMessage={(event) => {}}
|
onMessage={(event) => {}}
|
||||||
|
mixedContentMode={"compatibility"}
|
||||||
|
javaScriptEnabled
|
||||||
|
injectedJavaScript={jss}
|
||||||
|
setSupportMultipleWindows
|
||||||
/>
|
/>
|
||||||
{(from == "LED" || from == "LED2" || from == "AllTrainIDList") && (
|
<BigButton
|
||||||
<BigButton
|
style={{ borderColor: "black" }}
|
||||||
style={{ borderColor: "black" }}
|
tS={{ color: "black" }}
|
||||||
tS={{ color: "black" }}
|
string="閉じる"
|
||||||
string="閉じる"
|
onPress={goBack}
|
||||||
onPress={() =>
|
>
|
||||||
navigate(from == "AllTrainIDList" ? "AllTrainIDList" : "menu")
|
<MaterialCommunityIcons name="close" color="black" size={30} />
|
||||||
}
|
</BigButton>
|
||||||
>
|
|
||||||
<MaterialCommunityIcons name="close" color="black" size={30} />
|
|
||||||
</BigButton>
|
|
||||||
)}
|
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
6
eas.json
@ -35,6 +35,12 @@
|
|||||||
},
|
},
|
||||||
"production5.0": {
|
"production5.0": {
|
||||||
"channel": "dmm"
|
"channel": "dmm"
|
||||||
|
},
|
||||||
|
"beta6.0": {
|
||||||
|
"channel": "ebookjapan"
|
||||||
|
},
|
||||||
|
"production6.0": {
|
||||||
|
"channel": "ebay"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"submit": {
|
"submit": {
|
||||||
|
7
howto.js
@ -7,12 +7,11 @@ 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}>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// 種別判定
|
// 種別判定
|
||||||
export const getType = (string) => {
|
export const getType = (string:string) => {
|
||||||
switch (string) {
|
switch (string) {
|
||||||
case "express":
|
case "express":
|
||||||
return "特急";
|
return "特急";
|
@ -1,6 +1,6 @@
|
|||||||
// Description: 電車名の変換を行う。
|
// Description: 電車名の変換を行う。
|
||||||
// マリンライナーやマリン表記をマリンライナーに変換する。
|
// マリンライナーやマリン表記をマリンライナーに変換する。
|
||||||
export const migrateTrainName = (string) => {
|
export const migrateTrainName = (string:string) => {
|
||||||
return string
|
return string
|
||||||
.replace("マリン", "マリンライナー")
|
.replace("マリン", "マリンライナー")
|
||||||
.replace("ライナーライナー", "ライナー");
|
.replace("ライナーライナー", "ライナー");
|
@ -1,7 +1,7 @@
|
|||||||
// S列番の列車からDやMの列車を検索する
|
// S列番の列車からDやMの列車を検索する
|
||||||
export const searchSpecialTrain = (trainNum, trainList) => {
|
export const searchSpecialTrain = (trainNum: string, trainList: any[]) => {
|
||||||
const searchBase = trainNum.replace("S", "").replace("X", "");
|
const searchBase = trainNum.replace("S", "").replace("X", "");
|
||||||
const search = (text) => {
|
const search = (text: string) => {
|
||||||
const TD = trainList[searchBase + text];
|
const TD = trainList[searchBase + text];
|
||||||
if (TD) {
|
if (TD) {
|
||||||
return true;
|
return true;
|
@ -1,6 +1,6 @@
|
|||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export const getPDFViewURL = (url) => {
|
export const getPDFViewURL = (url:string) => {
|
||||||
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)}`;
|
@ -41,7 +41,7 @@ export const lineListPair = {
|
|||||||
M: "瀬戸大橋線(児島-宇多津間)[M]",
|
M: "瀬戸大橋線(児島-宇多津間)[M]",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getStationList = async (props) => {
|
export const getStationList = async () => {
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
//駅リストイニシャライズ
|
//駅リストイニシャライズ
|
||||||
return await Promise.all([
|
return await Promise.all([
|
||||||
@ -68,8 +68,8 @@ export const getStationList = async (props) => {
|
|||||||
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 (props) => {
|
|||||||
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 (props) => {
|
|||||||
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 (props) => {
|
|||||||
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],
|
@ -6,13 +6,13 @@ export const initIcon = (name: name, type:type) => {
|
|||||||
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"} />
|
<Ionicons name={name} size={30} color={focused ? "#0099CC" : "black"} />
|
||||||
);
|
);
|
||||||
case "AntDesign":
|
case "AntDesign":
|
||||||
return ({ focused, color, size }) => (
|
return ({ focused, color, size }) => (
|
||||||
<AntDesign
|
<AntDesign
|
||||||
name={name}
|
name={name}
|
||||||
size={32}
|
size={30}
|
||||||
color={focused ? "#0099CC" : "black"}
|
color={focused ? "#0099CC" : "black"}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export const buildProvidersTree = (providers) => {
|
import React, { FC } from "react";
|
||||||
|
export const buildProvidersTree:FC<any> = (providers) => {
|
||||||
// 基本ケース:ContextProviderが1つしか残っていない場合、それを返して終了する
|
// 基本ケース:ContextProviderが1つしか残っていない場合、それを返して終了する
|
||||||
if (providers.length === 1) {
|
if (providers.length === 1) {
|
||||||
return providers[0];
|
return providers[0];
|
87
menu.js
@ -1,5 +1,5 @@
|
|||||||
import React, { useRef, useState, useEffect } from "react";
|
import React, { useRef, useState, useEffect } from "react";
|
||||||
import Carousel, { Pagination } from "react-native-snap-carousel";
|
import Carousel from "react-native-reanimated-carousel";
|
||||||
import {
|
import {
|
||||||
Platform,
|
Platform,
|
||||||
View,
|
View,
|
||||||
@ -8,6 +8,7 @@ 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";
|
||||||
@ -32,7 +33,7 @@ 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 { Paginations } from "./components/Menu/StationPagination";
|
import { StationNumber } from "./components/Menu/StationPagination";
|
||||||
import lineColorList from "./assets/originData/lineColorList";
|
import lineColorList from "./assets/originData/lineColorList";
|
||||||
import { AS } from "./storageControl";
|
import { AS } from "./storageControl";
|
||||||
|
|
||||||
@ -118,13 +119,13 @@ export default function Menu({ getCurrentTrain }) {
|
|||||||
const count = selectedCurrentStation - 1;
|
const count = selectedCurrentStation - 1;
|
||||||
setSelectedCurrentStation(count);
|
setSelectedCurrentStation(count);
|
||||||
}
|
}
|
||||||
}, [selectedCurrentStation, currentStation, favoriteStation]);
|
}, [selectedCurrentStation, currentStation, allStationData]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!carouselRef.current) return;
|
if (!carouselRef.current) return;
|
||||||
if (carouselRef.current?._itemToSnapTo != selectedCurrentStation) {
|
carouselRef?.current.scrollTo({
|
||||||
carouselRef.current.snapToItem(0);
|
count: selectedCurrentStation - carouselRef.current.getCurrentIndex(),
|
||||||
carouselRef.current.snapToItem(selectedCurrentStation);
|
animated: true,
|
||||||
}
|
});
|
||||||
}, [selectedCurrentStation]);
|
}, [selectedCurrentStation]);
|
||||||
|
|
||||||
//全列車ダイヤリストを作成するuseEffect
|
//全列車ダイヤリストを作成するuseEffect
|
||||||
@ -174,10 +175,11 @@ 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={{
|
||||||
@ -191,41 +193,67 @@ 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}
|
||||||
sliderWidth={wp("100%")}
|
height={(wp("80%") / 20) * 9 + 10}
|
||||||
itemWidth={wp("80%")}
|
pagingEnabled={true}
|
||||||
enableMomentum
|
snapEnabled={true}
|
||||||
callbackOffsetMargin={1000}
|
loop={false}
|
||||||
activeAnimationOptions={0.3}
|
width={width}
|
||||||
|
style={{ width: width, alignContent: "center" }}
|
||||||
|
mode="parallax"
|
||||||
|
modeConfig={{
|
||||||
|
parallaxScrollingScale: 1,
|
||||||
|
parallaxScrollingOffset: 100,
|
||||||
|
parallaxAdjacentItemScale: 0.8,
|
||||||
|
}}
|
||||||
onSnapToItem={setSelectedCurrentStation}
|
onSnapToItem={setSelectedCurrentStation}
|
||||||
renderItem={({ item }) => {
|
renderItem={({ item, index }) => {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{ marginVertical: 10 }}
|
style={{
|
||||||
|
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>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Paginations
|
<View
|
||||||
entries={allStationData}
|
style={{
|
||||||
activeSlide={selectedCurrentStation}
|
flexDirection: "row",
|
||||||
carouselRef={carouselRef}
|
justifyContent: "center",
|
||||||
setSelectedCurrentStation={setSelectedCurrentStation}
|
alignContent: "center",
|
||||||
dotButton={dotButton}
|
alignItems: "center",
|
||||||
/>
|
}}
|
||||||
</>
|
>
|
||||||
|
{originalStationList &&
|
||||||
|
allStationData.map((d, index) => {
|
||||||
|
return (
|
||||||
|
<StationNumber
|
||||||
|
currentStation={d}
|
||||||
|
active={index == selectedCurrentStation}
|
||||||
|
onPress={() => setSelectedCurrentStation(index)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
{allStationData.length != 0 &&
|
{allStationData.length != 0 &&
|
||||||
originalStationList.length != 0 &&
|
originalStationList.length != 0 &&
|
||||||
@ -362,10 +390,13 @@ 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 style={{ flexDirection: "row" }} key={data[1] + "key"+index}>
|
<View
|
||||||
|
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>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import React, { useRef, useState } from "react";
|
import React, { Ref, useRef, useState } from "react";
|
||||||
import { View, Platform, TouchableOpacity } from "react-native";
|
import { View, Platform, TouchableOpacity, StyleProp, ViewStyle } from "react-native";
|
||||||
import { WebView } from "react-native-webview";
|
import { WebView } from "react-native-webview";
|
||||||
import Constants from "expo-constants";
|
import Constants from "expo-constants";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
export default function tndView() {
|
export default function tndView() {
|
||||||
const webview = useRef();
|
const webview = useRef<WebView>(null);
|
||||||
const jsa = `
|
const jsa = `
|
||||||
document.querySelector('.sitettl').style.display = 'none';
|
document.querySelector('.sitettl').style.display = 'none';
|
||||||
document.querySelector('.attention').style.display = 'none';
|
document.querySelector('.attention').style.display = 'none';
|
||||||
@ -18,7 +18,6 @@ export default function tndView() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<WebView
|
<WebView
|
||||||
useWebKit={true}
|
|
||||||
ref={webview}
|
ref={webview}
|
||||||
source={{ uri: "https://www.jr-shikoku.co.jp/info/" }}
|
source={{ uri: "https://www.jr-shikoku.co.jp/info/" }}
|
||||||
originWhitelist={["https://www.jr-shikoku.co.jp"]}
|
originWhitelist={["https://www.jr-shikoku.co.jp"]}
|
||||||
@ -29,15 +28,15 @@ export default function tndView() {
|
|||||||
onError={() => this.webView?.reload()}
|
onError={() => this.webView?.reload()}
|
||||||
/>
|
/>
|
||||||
<ReloadButton
|
<ReloadButton
|
||||||
onPress={() => webview.current?.reload()}
|
onPress={() => webview.current.reload()}
|
||||||
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
|
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => {
|
const ReloadButton = ({ onPress, top, LoadError = false }) => {
|
||||||
const styles = {
|
const styles:StyleProp<ViewStyle> = {
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top,
|
top,
|
||||||
right: 10,
|
right: 10,
|
||||||
@ -51,7 +50,6 @@ const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => {
|
|||||||
alignContent: "center",
|
alignContent: "center",
|
||||||
alignSelf: "center",
|
alignSelf: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
display: mapSwitch,
|
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={onPress} style={styles}>
|
<TouchableOpacity onPress={onPress} style={styles}>
|
77
package.json
@ -8,54 +8,67 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/ngrok": "^4.1.0",
|
"@expo/ngrok": "^4.1.0",
|
||||||
"@expo/vector-icons": "^14.0.0",
|
"@expo/vector-icons": "^14.0.2",
|
||||||
"@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",
|
||||||
"eas-cli": "^5.9.1",
|
"expo": "^52.0.0",
|
||||||
"expo": "^50.0.11",
|
"expo-alternate-app-icons": "^1.3.0",
|
||||||
"expo-dev-client": "~3.3.9",
|
"expo-clipboard": "~7.0.1",
|
||||||
"expo-device": "~5.9.3",
|
"expo-constants": "~17.0.4",
|
||||||
"expo-font": "~11.10.3",
|
"expo-dev-client": "~5.0.9",
|
||||||
"expo-location": "~16.5.5",
|
"expo-device": "~7.0.2",
|
||||||
"expo-notifications": "~0.27.6",
|
"expo-font": "~13.0.3",
|
||||||
"expo-screen-orientation": "~6.4.1",
|
"expo-haptics": "~14.0.1",
|
||||||
"expo-sharing": "~11.10.0",
|
"expo-intent-launcher": "~12.0.2",
|
||||||
"expo-updates": "~0.24.11",
|
"expo-linear-gradient": "~14.0.2",
|
||||||
"expo-web-browser": "~12.8.2",
|
"expo-linking": "~7.0.4",
|
||||||
|
"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": "6.5.1",
|
"lottie-react-native": "7.1.0",
|
||||||
"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.2.0",
|
"react": "18.3.1",
|
||||||
"react-native": "0.73.4",
|
"react-native": "0.76.6",
|
||||||
"react-native-actions-sheet": "0.8.21",
|
"react-native-actions-sheet": "0.8.21",
|
||||||
"react-native-android-widget": "^0.11.2",
|
"react-native-android-widget": "^0.15.1",
|
||||||
"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.14.0",
|
"react-native-gesture-handler": "~2.20.2",
|
||||||
"react-native-maps": "1.10.0",
|
"react-native-maps": "1.18.0",
|
||||||
"react-native-reanimated": "~3.6.2",
|
"react-native-reanimated": "~3.16.1",
|
||||||
|
"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.8.2",
|
"react-native-safe-area-context": "4.12.0",
|
||||||
"react-native-screens": "~3.29.0",
|
"react-native-screens": "~4.4.0",
|
||||||
"react-native-snap-carousel": "^3.9.1",
|
"react-native-snap-carousel": "^3.9.1",
|
||||||
"react-native-storage": "^1.0.1",
|
"react-native-storage": "^1.0.1",
|
||||||
"react-native-svg": "14.1.0",
|
"react-native-svg": "15.8.0",
|
||||||
"react-native-svg-uri": "^1.2.3",
|
"react-native-svg-uri": "^1.2.3",
|
||||||
"react-native-vector-icons": "^8.1.0",
|
"react-native-touchable-scale": "^2.2.0",
|
||||||
"react-native-view-shot": "3.8.0",
|
"react-native-vector-icons": "^10.2.0",
|
||||||
"react-native-webview": "13.6.4",
|
"react-native-view-shot": "~4.0.3",
|
||||||
|
"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": "^10.0.0"
|
"babel-preset-expo": "~12.0.0"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ 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";
|
||||||
@ -13,13 +14,20 @@ const initialState = {
|
|||||||
lodAddMigration: () => {},
|
lodAddMigration: () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
const FavoriteStationContext = createContext(initialState);
|
type initialStateType = {
|
||||||
|
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 = {
|
||||||
export const FavoriteStationProvider = ({ children }) => {
|
children: React.ReactNode;
|
||||||
|
};
|
||||||
|
export const FavoriteStationProvider:FC<Props> = ({ children }) => {
|
||||||
const [favoriteStation, setFavoriteStation] = useState([]);
|
const [favoriteStation, setFavoriteStation] = useState([]);
|
||||||
const { getStationData } = useStationList();
|
const { getStationData } = useStationList();
|
||||||
const lodAddMigration = () => {
|
const lodAddMigration = () => {
|
@ -6,9 +6,7 @@ import React, {
|
|||||||
FC,
|
FC,
|
||||||
useRef,
|
useRef,
|
||||||
} from "react";
|
} from "react";
|
||||||
// 6.0でライブラリ変更
|
import { Platform } from "react-native";
|
||||||
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";
|
||||||
|
@ -42,7 +42,9 @@ export const TrainMenuProvider = ({ children }) => {
|
|||||||
const [mapsStationData, setMapsStationData] = useState(undefined);
|
const [mapsStationData, setMapsStationData] = useState(undefined);
|
||||||
const [injectJavaScript, setInjectJavaScript] = useState();
|
const [injectJavaScript, setInjectJavaScript] = useState();
|
||||||
|
|
||||||
useEffect(() => getStationList2().then(setMapsStationData), []);
|
useEffect(() => {
|
||||||
|
getStationList2().then(setMapsStationData);
|
||||||
|
}, []);
|
||||||
|
|
||||||
//画面表示関連
|
//画面表示関連
|
||||||
const [iconSetting, setIconSetting] = useState(undefined);
|
const [iconSetting, setIconSetting] = useState(undefined);
|
||||||
@ -72,7 +74,6 @@ 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 });
|
||||||
|