Compare commits
20 Commits
patch/4.4.
...
feature/fi
Author | SHA1 | Date | |
---|---|---|---|
|
58340bb608 | ||
|
32fb402126 | ||
|
44b6a113ff | ||
|
bb89149876 | ||
|
12f23bef16 | ||
|
f580e319cf | ||
|
7dc72ef433 | ||
|
746c996cba | ||
|
556b04e3b0 | ||
|
67f9b8b698 | ||
|
3ff585a577 | ||
|
f5e4947c3b | ||
|
fae18a6a47 | ||
|
1fd2be5ddf | ||
|
f993577e34 | ||
|
50973db9ce | ||
|
d475b5c8a4 | ||
|
3a45288eee | ||
|
c996b31dad | ||
|
2040d829fe |
175
App.js
175
App.js
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef, useState } from "react";
|
||||||
import { NavigationContainer } from "@react-navigation/native";
|
import { NavigationContainer } from "@react-navigation/native";
|
||||||
import {
|
import {
|
||||||
createStackNavigator,
|
createStackNavigator,
|
||||||
@@ -8,14 +8,23 @@ import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
|||||||
import { AntDesign, Ionicons } from "@expo/vector-icons";
|
import { AntDesign, Ionicons } from "@expo/vector-icons";
|
||||||
import { Platform, UIManager } from "react-native";
|
import { Platform, UIManager } from "react-native";
|
||||||
import { UpdateAsync } from "./UpdateAsync.js";
|
import { UpdateAsync } from "./UpdateAsync.js";
|
||||||
|
import { getStationList2 } from "./lib/getStationList2";
|
||||||
|
import { AS } from "./storageControl";
|
||||||
import Apps from "./Apps";
|
import Apps from "./Apps";
|
||||||
import tndView from "./ndView";
|
import TNDView from "./ndView";
|
||||||
import trainbase from "./trainbaseview";
|
import TrainBase from "./trainbaseview";
|
||||||
import howto from "./howto";
|
import HowTo from "./howto";
|
||||||
import menu from "./menu";
|
import Menu from "./menu";
|
||||||
import News from "./components/news.js";
|
import News from "./components/news.js";
|
||||||
import Setting from "./components/settings.js";
|
import Setting from "./components/settings.js";
|
||||||
import trainMenu from "./components/trainMenu.js";
|
import TrainMenu from "./components/trainMenu.js";
|
||||||
|
import FavoriteList from "./components/FavoriteList.js";
|
||||||
|
import { LogBox } from "react-native";
|
||||||
|
|
||||||
|
LogBox.ignoreLogs([
|
||||||
|
"ViewPropTypes will be removed",
|
||||||
|
"ColorPropType will be removed",
|
||||||
|
]);
|
||||||
const Stack = createStackNavigator();
|
const Stack = createStackNavigator();
|
||||||
const Tab = createBottomTabNavigator();
|
const Tab = createBottomTabNavigator();
|
||||||
if (Platform.OS === "android") {
|
if (Platform.OS === "android") {
|
||||||
@@ -24,95 +33,199 @@ if (Platform.OS === "android") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const navigationRef = useRef();
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
UpdateAsync();
|
UpdateAsync();
|
||||||
}, []);
|
}, []);
|
||||||
|
const [favoriteStation, setFavoriteStation] = useState([]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
AS.getItem("favoriteStation")
|
||||||
|
.then((d) => {
|
||||||
|
const returnData = JSON.parse(d);
|
||||||
|
setFavoriteStation(returnData);
|
||||||
|
})
|
||||||
|
.catch((d) => console.log(d));
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NavigationContainer name="Root" ref={navigationRef} style={{ flex: 1 }}>
|
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
||||||
<Tab.Navigator>
|
<Tab.Navigator>
|
||||||
<Stack.Screen
|
<Tab.Screen
|
||||||
name="login"
|
name="login"
|
||||||
component={top}
|
|
||||||
options={{
|
options={{
|
||||||
tabBarLabel: "位置情報",
|
tabBarLabel: "位置情報",
|
||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
tabBarIcon: () => <AntDesign name="barchart" size={32} />,
|
tabBarIcon: initIcon("barchart", "AntDesign"),
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<Top
|
||||||
|
{...props}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
)}
|
||||||
|
</Tab.Screen>
|
||||||
|
<Tab.Screen
|
||||||
name="menuPage"
|
name="menuPage"
|
||||||
component={menuPage}
|
|
||||||
options={{
|
options={{
|
||||||
tabBarLabel: "リンク",
|
tabBarLabel: "リンク",
|
||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
tabBarIcon: () => <Ionicons name="ios-radio" size={32} />,
|
tabBarIcon: initIcon("ios-radio", "Ionicons"),
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<MenuPage
|
||||||
|
{...props}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
)}
|
||||||
|
</Tab.Screen>
|
||||||
|
<Tab.Screen
|
||||||
name="home"
|
name="home"
|
||||||
component={tndView}
|
|
||||||
options={{
|
options={{
|
||||||
tabBarLabel: "運行情報",
|
tabBarLabel: "運行情報",
|
||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
tabBarIcon: () => <Ionicons name="md-train" size={32} />,
|
tabBarIcon: initIcon("md-train", "Ionicons"),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
{(props) => <TNDView {...props} />}
|
||||||
|
</Tab.Screen>
|
||||||
</Tab.Navigator>
|
</Tab.Navigator>
|
||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const top = () => (
|
|
||||||
|
const initIcon = (name, type) => {
|
||||||
|
switch (type) {
|
||||||
|
case "Ionicons":
|
||||||
|
return ({ focused, color, size }) => (
|
||||||
|
<Ionicons name={name} size={32} color={focused ? "#0099CC" : "black"} />
|
||||||
|
);
|
||||||
|
case "AntDesign":
|
||||||
|
return ({ focused, color, size }) => (
|
||||||
|
<AntDesign
|
||||||
|
name={name}
|
||||||
|
size={32}
|
||||||
|
color={focused ? "#0099CC" : "black"}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const Top = ({ navigation, favoriteStation, setFavoriteStation }) => {
|
||||||
|
const webview = useRef();
|
||||||
|
|
||||||
|
//地図用
|
||||||
|
const [mapsStationData, setMapsStationData] = useState(undefined);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getStationList2().then(setMapsStationData);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const unsubscribe = navigation.addListener("tabLongPress", (e) => {
|
||||||
|
navigation.navigate("favoriteList");
|
||||||
|
});
|
||||||
|
|
||||||
|
return unsubscribe;
|
||||||
|
}, [navigation]);
|
||||||
|
|
||||||
|
return (
|
||||||
<Stack.Navigator>
|
<Stack.Navigator>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="Apps"
|
name="Apps"
|
||||||
component={Apps}
|
|
||||||
options={{
|
options={{
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<Apps
|
||||||
|
{...props}
|
||||||
|
webview={webview}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
|
</Stack.Screen>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="trainbase"
|
name="trainbase"
|
||||||
component={trainbase}
|
|
||||||
options={{
|
options={{
|
||||||
title: "トレインビジョン",
|
title: "トレインビジョン",
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
...TransitionPresets.SlideFromRightIOS,
|
...TransitionPresets.SlideFromRightIOS,
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
{(props) => <TrainBase {...props} />}
|
||||||
|
</Stack.Screen>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="howto"
|
name="howto"
|
||||||
component={howto}
|
|
||||||
options={{
|
options={{
|
||||||
title: "使い方",
|
title: "使い方",
|
||||||
...optionData,
|
...optionData,
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
{(props) => <HowTo {...props} />}
|
||||||
|
</Stack.Screen>
|
||||||
|
<Stack.Screen name="news" options={optionData}>
|
||||||
|
{(props) => <News {...props} />}
|
||||||
|
</Stack.Screen>
|
||||||
|
<Stack.Screen name="trainMenu" options={optionData}>
|
||||||
|
{(props) => (
|
||||||
|
<TrainMenu
|
||||||
|
{...props}
|
||||||
|
webview={webview}
|
||||||
|
stationData={mapsStationData}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen name="news" component={News} options={optionData} />
|
)}
|
||||||
<Stack.Screen name="trainMenu" component={trainMenu} options={optionData} />
|
</Stack.Screen>
|
||||||
|
<Stack.Screen
|
||||||
|
name="favoriteList"
|
||||||
|
options={{ ...optionData, gestureEnabled: false }}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<FavoriteList
|
||||||
|
{...props}
|
||||||
|
webview={webview}
|
||||||
|
stationData={mapsStationData}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Stack.Screen>
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
);
|
);
|
||||||
function menuPage() {
|
};
|
||||||
|
function MenuPage({ favoriteStation, setFavoriteStation }) {
|
||||||
return (
|
return (
|
||||||
<Stack.Navigator>
|
<Stack.Navigator>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="menu"
|
name="menu"
|
||||||
component={menu}
|
|
||||||
options={{
|
options={{
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<Menu
|
||||||
|
{...props}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen name="setting" component={Setting} options={optionData} />
|
)}
|
||||||
|
</Stack.Screen>
|
||||||
|
<Stack.Screen name="setting" options={optionData}>
|
||||||
|
{(props) => <Setting {...props} />}
|
||||||
|
</Stack.Screen>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="trainbase"
|
name="trainbase"
|
||||||
component={trainbase}
|
|
||||||
options={{
|
options={{
|
||||||
...TransitionPresets.ModalPresentationIOS,
|
...TransitionPresets.ModalPresentationIOS,
|
||||||
cardOverlayEnabled: true,
|
cardOverlayEnabled: true,
|
||||||
@@ -121,7 +234,9 @@ function menuPage() {
|
|||||||
headerTransparent: true,
|
headerTransparent: true,
|
||||||
gestureResponseDistance: { vertical: 300 },
|
gestureResponseDistance: { vertical: 300 },
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
{(props) => <TrainBase {...props} />}
|
||||||
|
</Stack.Screen>
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
25
Apps.js
25
Apps.js
@@ -19,23 +19,20 @@ import { getStationList2 } from "./lib/getStationList2";
|
|||||||
import StatusbarDetect from './StatusbarDetect';
|
import StatusbarDetect from './StatusbarDetect';
|
||||||
var Status = StatusbarDetect(); */
|
var Status = StatusbarDetect(); */
|
||||||
|
|
||||||
export default function Apps(props) {
|
export default function Apps({
|
||||||
const {
|
navigation,
|
||||||
navigation: { navigate },
|
webview,
|
||||||
} = props;
|
favoriteStation,
|
||||||
|
setFavoriteStation,
|
||||||
|
}) {
|
||||||
|
const { navigate } = navigation;
|
||||||
var urlcache = "";
|
var urlcache = "";
|
||||||
const webview = useRef();
|
|
||||||
//画面表示関連
|
//画面表示関連
|
||||||
const [iconSetting, setIconSetting] = useState(undefined);
|
const [iconSetting, setIconSetting] = useState(undefined);
|
||||||
const [mapSwitch, setMapSwitch] = useState(undefined);
|
const [mapSwitch, setMapSwitch] = useState(undefined);
|
||||||
const [stationMenu, setStationMenu] = useState(undefined);
|
const [stationMenu, setStationMenu] = useState(undefined);
|
||||||
|
|
||||||
//地図用
|
|
||||||
const [mapsStationData, setMapsStationData] = useState(undefined);
|
|
||||||
useEffect(() => {
|
|
||||||
getStationList2().then(setMapsStationData);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
//駅情報画面用
|
//駅情報画面用
|
||||||
const StationBoardAcSR = useRef(null);
|
const StationBoardAcSR = useRef(null);
|
||||||
const [stationBoardData, setStationBoardData] = useState(undefined);
|
const [stationBoardData, setStationBoardData] = useState(undefined);
|
||||||
@@ -187,9 +184,7 @@ export default function Apps(props) {
|
|||||||
onTouchMove={() => StationBoardAcSR.current?.hide()}
|
onTouchMove={() => StationBoardAcSR.current?.hide()}
|
||||||
/>
|
/>
|
||||||
<MapsButton
|
<MapsButton
|
||||||
onPress={() =>
|
onPress={() => navigate("trainMenu", { webview })}
|
||||||
navigate("trainMenu", { webview, stationData: mapsStationData })
|
|
||||||
}
|
|
||||||
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
|
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
|
||||||
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
|
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
|
||||||
/>
|
/>
|
||||||
@@ -202,6 +197,8 @@ export default function Apps(props) {
|
|||||||
StationBoardAcSR={StationBoardAcSR}
|
StationBoardAcSR={StationBoardAcSR}
|
||||||
currentStation={stationBoardData}
|
currentStation={stationBoardData}
|
||||||
originalStationList={originalStationList}
|
originalStationList={originalStationList}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
2
app.json
2
app.json
@@ -4,7 +4,7 @@
|
|||||||
"slug": "jrshikoku",
|
"slug": "jrshikoku",
|
||||||
"privacy": "public",
|
"privacy": "public",
|
||||||
"platforms": ["ios", "android"],
|
"platforms": ["ios", "android"],
|
||||||
"version": "4.4",
|
"version": "4.5",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"icon": "./assets/icon.png",
|
"icon": "./assets/icon.png",
|
||||||
"splash": {
|
"splash": {
|
||||||
|
1
assets/939-star.json
Normal file
1
assets/939-star.json
Normal file
File diff suppressed because one or more lines are too long
@@ -5,9 +5,19 @@ import ActionSheet from "react-native-actions-sheet";
|
|||||||
import Sign from "../../components/駅名表/Sign";
|
import Sign from "../../components/駅名表/Sign";
|
||||||
|
|
||||||
import { TicketBox } from "../atom/TicketBox";
|
import { TicketBox } from "../atom/TicketBox";
|
||||||
|
import {
|
||||||
|
widthPercentageToDP as wp,
|
||||||
|
heightPercentageToDP as hp,
|
||||||
|
} from "react-native-responsive-screen";
|
||||||
|
|
||||||
export const StationDeteilView = (props) => {
|
export const StationDeteilView = (props) => {
|
||||||
const { StationBoardAcSR, currentStation, originalStationList } = props;
|
const {
|
||||||
|
StationBoardAcSR,
|
||||||
|
currentStation,
|
||||||
|
originalStationList,
|
||||||
|
favoriteStation,
|
||||||
|
setFavoriteStation,
|
||||||
|
} = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<ActionSheet
|
||||||
@@ -38,11 +48,20 @@ export const StationDeteilView = (props) => {
|
|||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
{currentStation && (
|
{currentStation && (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
margin: 10,
|
||||||
|
marginHorizontal: wp("10%"),
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Sign
|
<Sign
|
||||||
currentStation={currentStation}
|
currentStation={currentStation}
|
||||||
originalStationList={originalStationList}
|
originalStationList={originalStationList}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
oP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
oP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
||||||
/>
|
/>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
{currentStation && (
|
{currentStation && (
|
||||||
<View style={{ flexDirection: "row" }}>
|
<View style={{ flexDirection: "row" }}>
|
||||||
|
112
components/FavoriteList.js
Normal file
112
components/FavoriteList.js
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
import React, { Component, useRef, useState, useEffect } from "react";
|
||||||
|
import { View, Text, TouchableOpacity, ScrollView } from "react-native";
|
||||||
|
import { WebView } from "react-native-webview";
|
||||||
|
import { ListItem } from "native-base";
|
||||||
|
import Icon from "react-native-vector-icons/Entypo";
|
||||||
|
import StatusbarDetect from "../StatusbarDetect";
|
||||||
|
import { AS } from "../storageControl";
|
||||||
|
import { news } from "../config/newsUpdate";
|
||||||
|
import { getStationList, lineList } from "../lib/getStationList";
|
||||||
|
var Status = StatusbarDetect();
|
||||||
|
export default function FavoriteList({
|
||||||
|
navigation,
|
||||||
|
webview,
|
||||||
|
stationData,
|
||||||
|
favoriteStation,
|
||||||
|
setFavoriteStation,
|
||||||
|
}) {
|
||||||
|
const { navigate } = navigation;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{ height: "100%", backgroundColor: "#0099CC" }}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
textAlign: "center",
|
||||||
|
fontSize: 25,
|
||||||
|
color: "white",
|
||||||
|
fontWeight: "bold",
|
||||||
|
paddingVertical: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
位置情報クイック移動メニュー
|
||||||
|
</Text>
|
||||||
|
<ScrollView style={{ height: "100%", backgroundColor: "white" }}>
|
||||||
|
{favoriteStation
|
||||||
|
.filter((d) => d[0].StationMap)
|
||||||
|
.map((currentStation) => {
|
||||||
|
console.log(currentStation);
|
||||||
|
return (
|
||||||
|
<ListItem
|
||||||
|
onPress={() => {
|
||||||
|
const getStationLine = (now) => {
|
||||||
|
const returnData = Object.keys(stationData).filter((d) => {
|
||||||
|
const cache = stationData[d].findIndex(
|
||||||
|
(data) => data.Station_JP == now.Station_JP
|
||||||
|
);
|
||||||
|
return cache != -1;
|
||||||
|
});
|
||||||
|
return returnData[0];
|
||||||
|
};
|
||||||
|
const lineName = getStationLine(currentStation[0]);
|
||||||
|
|
||||||
|
webview.current?.injectJavaScript(
|
||||||
|
`MoveDisplayStation('${lineName}_${currentStation[0].MyStation}_${currentStation[0].Station_JP}')`
|
||||||
|
);
|
||||||
|
navigate("Apps");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ fontSize: 20, flex: 2 }}>
|
||||||
|
{currentStation
|
||||||
|
.map((d) => d.StationNumber)
|
||||||
|
.filter((d) => d !== null)
|
||||||
|
.join("/")}
|
||||||
|
</Text>
|
||||||
|
<Text style={{ fontSize: 20, flex: 3 }}>
|
||||||
|
{currentStation[0].Station_JP}
|
||||||
|
</Text>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flex: 2,
|
||||||
|
flexDirection: "row",
|
||||||
|
alignContent: "center",
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View style={{ flex: 1 }} />
|
||||||
|
<Text style={{ fontSize: 20 }}>移動する</Text>
|
||||||
|
<Icon name="chevron-right" size={20} />
|
||||||
|
</View>
|
||||||
|
</ListItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ScrollView>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
backgroundColor: "white",
|
||||||
|
borderWidth: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
お気に入り登録した駅のうち、位置情報システムで移動可能な駅が表示されています。タップすることで位置情報システムの当該の駅に移動します。
|
||||||
|
</Text>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{
|
||||||
|
padding: 10,
|
||||||
|
flexDirection: "row",
|
||||||
|
borderColor: "white",
|
||||||
|
borderWidth: 1,
|
||||||
|
margin: 10,
|
||||||
|
borderRadius: 5,
|
||||||
|
alignItems: "center",
|
||||||
|
}}
|
||||||
|
onPress={() => navigation.goBack()}
|
||||||
|
>
|
||||||
|
<View style={{ flex: 1 }} />
|
||||||
|
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
||||||
|
閉じる
|
||||||
|
</Text>
|
||||||
|
<View style={{ flex: 1 }} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
@@ -102,7 +102,7 @@ export default function Setting(props) {
|
|||||||
textAlignVertical: "center",
|
textAlignVertical: "center",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
内部バージョン: 4.4.2.9
|
内部バージョン: 4.5 beta-1
|
||||||
</Text>
|
</Text>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
</View>
|
</View>
|
||||||
|
@@ -2,11 +2,10 @@ import React, { useRef } 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, { Marker } from "react-native-maps";
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
export default function trainMenu({
|
export default function TrainMenu({
|
||||||
route: {
|
|
||||||
params: { webview, stationData },
|
|
||||||
},
|
|
||||||
navigation: { navigate },
|
navigation: { navigate },
|
||||||
|
webview,
|
||||||
|
stationData,
|
||||||
}) {
|
}) {
|
||||||
const mapRef = useRef();
|
const mapRef = useRef();
|
||||||
return (
|
return (
|
||||||
@@ -67,12 +66,7 @@ export default function trainMenu({
|
|||||||
backgroundColor={"#EA4752"}
|
backgroundColor={"#EA4752"}
|
||||||
icon="star"
|
icon="star"
|
||||||
flex={1}
|
flex={1}
|
||||||
onPressButton={() =>
|
onPressButton={() => navigate("favoriteList")}
|
||||||
/* Linking.openURL(
|
|
||||||
"https://www.jr-shikoku.co.jp/01_trainbus/jikoku/sp/#mainprice-box"
|
|
||||||
) */
|
|
||||||
alert("お気に入り駅登録機能は現在開発中です!レイアウト募集中!")
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
お気に入り
|
お気に入り
|
||||||
</UsefulBox>
|
</UsefulBox>
|
||||||
@@ -99,9 +93,7 @@ export default function trainMenu({
|
|||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => navigate("Apps")}
|
||||||
navigate("Apps");
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
||||||
|
@@ -12,14 +12,36 @@ import {
|
|||||||
widthPercentageToDP as wp,
|
widthPercentageToDP as wp,
|
||||||
heightPercentageToDP as hp,
|
heightPercentageToDP as hp,
|
||||||
} from "react-native-responsive-screen";
|
} from "react-native-responsive-screen";
|
||||||
|
import LottieView from "lottie-react-native";
|
||||||
import { useInterval } from "../../lib/useInterval";
|
import { useInterval } from "../../lib/useInterval";
|
||||||
|
import { AS } from "../../storageControl";
|
||||||
|
|
||||||
export default function Sign(props) {
|
export default function Sign(props) {
|
||||||
const { currentStation, originalStationList, oP } = props;
|
const {
|
||||||
|
currentStation,
|
||||||
|
originalStationList,
|
||||||
|
oP,
|
||||||
|
favoriteStation,
|
||||||
|
setFavoriteStation,
|
||||||
|
} = props;
|
||||||
const [nexPrePosition, setNexPrePosition] = useState(0);
|
const [nexPrePosition, setNexPrePosition] = useState(0);
|
||||||
|
|
||||||
const [preStation, setPreStation] = useState();
|
const [preStation, setPreStation] = useState();
|
||||||
const [nexStation, setNexStation] = useState();
|
const [nexStation, setNexStation] = useState();
|
||||||
|
const [testButtonStatus, setTestButtonStatus] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const isFavorite = favoriteStation.filter((d) => {
|
||||||
|
const compare = JSON.stringify(d);
|
||||||
|
const current = JSON.stringify(currentStation);
|
||||||
|
if (compare === current) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTestButtonStatus(isFavorite.length != 0);
|
||||||
|
}, [favoriteStation, currentStation]);
|
||||||
|
|
||||||
useInterval(() => {
|
useInterval(() => {
|
||||||
if (currentStation.length == 1) {
|
if (currentStation.length == 1) {
|
||||||
@@ -68,10 +90,48 @@ export default function Sign(props) {
|
|||||||
setPreStation(returnData[0]);
|
setPreStation(returnData[0]);
|
||||||
setNexStation(returnData[1]);
|
setNexStation(returnData[1]);
|
||||||
};
|
};
|
||||||
|
const lottieRef = useRef();
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
<TouchableOpacity style={styleSheet.外枠} onPress={oP}>
|
||||||
<StationNumberMaker currentStation={currentStation} />
|
<StationNumberMaker currentStation={currentStation} />
|
||||||
<StationNameArea currentStation={currentStation} />
|
<StationNameArea currentStation={currentStation} />
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{ position: "absolute", right: -15, top: -20 }}
|
||||||
|
onPress={() => {
|
||||||
|
if (testButtonStatus) {
|
||||||
|
lottieRef.current.play(35, 7);
|
||||||
|
const otherData = favoriteStation.filter((d) => {
|
||||||
|
const compare = JSON.stringify(d);
|
||||||
|
const current = JSON.stringify(currentStation);
|
||||||
|
if (compare !== current) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AS.setItem("favoriteStation", JSON.stringify(otherData));
|
||||||
|
setFavoriteStation(otherData);
|
||||||
|
} else {
|
||||||
|
lottieRef.current.play(7, 35);
|
||||||
|
let ret = favoriteStation;
|
||||||
|
console.log(currentStation);
|
||||||
|
ret.push(currentStation);
|
||||||
|
AS.setItem("favoriteStation", JSON.stringify(ret));
|
||||||
|
setFavoriteStation(ret);
|
||||||
|
}
|
||||||
|
setTestButtonStatus(!testButtonStatus);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<LottieView
|
||||||
|
progress={testButtonStatus ? 1 : 0}
|
||||||
|
speed={1.4}
|
||||||
|
style={{ width: 80, height: 80 }}
|
||||||
|
source={require("../../assets/939-star.json")}
|
||||||
|
ref={lottieRef}
|
||||||
|
loop={false}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
<Text style={styleSheet.JRStyle}>JR</Text>
|
<Text style={styleSheet.JRStyle}>JR</Text>
|
||||||
<View style={styleSheet.下帯} />
|
<View style={styleSheet.下帯} />
|
||||||
<View style={styleSheet.下帯内容}>
|
<View style={styleSheet.下帯内容}>
|
||||||
@@ -199,8 +259,6 @@ const styleSheet = {
|
|||||||
height: (wp("80%") / 20) * 9,
|
height: (wp("80%") / 20) * 9,
|
||||||
borderColor: "#2E94BB",
|
borderColor: "#2E94BB",
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
margin: 10,
|
|
||||||
marginHorizontal: wp("10%"),
|
|
||||||
backgroundColor: "white",
|
backgroundColor: "white",
|
||||||
},
|
},
|
||||||
下帯: {
|
下帯: {
|
||||||
|
6
eas.json
6
eas.json
@@ -15,6 +15,12 @@
|
|||||||
},
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"releaseChannel": "aliexpress"
|
"releaseChannel": "aliexpress"
|
||||||
|
},
|
||||||
|
"beta4.5": {
|
||||||
|
"releaseChannel": "base"
|
||||||
|
},
|
||||||
|
"production4.5": {
|
||||||
|
"releaseChannel": "buyma"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"submit": {
|
"submit": {
|
||||||
|
76
menu.js
76
menu.js
@@ -1,4 +1,5 @@
|
|||||||
import React, { useRef, useState, useEffect } from "react";
|
import React, { useRef, useState, useEffect } from "react";
|
||||||
|
import Carousel from "react-native-snap-carousel";
|
||||||
import {
|
import {
|
||||||
Platform,
|
Platform,
|
||||||
View,
|
View,
|
||||||
@@ -38,6 +39,8 @@ import useInterval from "./lib/useInterval";
|
|||||||
export default function Menu(props) {
|
export default function Menu(props) {
|
||||||
const {
|
const {
|
||||||
navigation: { navigate },
|
navigation: { navigate },
|
||||||
|
favoriteStation,
|
||||||
|
setFavoriteStation,
|
||||||
} = props;
|
} = props;
|
||||||
const JRSTraInfoEXAcSR = useRef(null);
|
const JRSTraInfoEXAcSR = useRef(null);
|
||||||
const StationBoardAcSR = useRef(null);
|
const StationBoardAcSR = useRef(null);
|
||||||
@@ -72,6 +75,22 @@ export default function Menu(props) {
|
|||||||
getStationList().then(setOriginalStationList);
|
getStationList().then(setOriginalStationList);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const [locationAndFavorite, setLocationAndFavorite] = useState([]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (!favoriteStation) return () => {};
|
||||||
|
const data = favoriteStation.filter((d) =>
|
||||||
|
JSON.stringify(d) === JSON.stringify(currentStation) ? false : true
|
||||||
|
);
|
||||||
|
setLocationAndFavorite(data);
|
||||||
|
}, [currentStation, favoriteStation]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!(selectedCurrentStation < favoriteStation.length)) {
|
||||||
|
setSelectedCurrentStation(favoriteStation.length - 1);
|
||||||
|
carouselRef.current.snapToItem(favoriteStation.length - 1);
|
||||||
|
}
|
||||||
|
}, [favoriteStation]);
|
||||||
|
|
||||||
const [stationName, setStationName] = useState(undefined);
|
const [stationName, setStationName] = useState(undefined);
|
||||||
const [currentStation, setCurrentStation] = useState(undefined);
|
const [currentStation, setCurrentStation] = useState(undefined);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -117,6 +136,10 @@ export default function Menu(props) {
|
|||||||
const [delayData, setDelayData] = useState(undefined);
|
const [delayData, setDelayData] = useState(undefined);
|
||||||
const [getTime, setGetTime] = useState(new Date());
|
const [getTime, setGetTime] = useState(new Date());
|
||||||
const [loadingDelayData, setLoadingDelayData] = useState(true);
|
const [loadingDelayData, setLoadingDelayData] = useState(true);
|
||||||
|
const carouselRef = useRef();
|
||||||
|
const scrollRef = useRef();
|
||||||
|
const [isScroll, setIsScroll] = useState(true);
|
||||||
|
const [selectedCurrentStation, setSelectedCurrentStation] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch(
|
fetch(
|
||||||
@@ -139,7 +162,7 @@ export default function Menu(props) {
|
|||||||
>
|
>
|
||||||
<StatusbarDetect />
|
<StatusbarDetect />
|
||||||
<TitleBar />
|
<TitleBar />
|
||||||
<ScrollView>
|
<ScrollView ref={scrollRef} scrollEnabled={isScroll}>
|
||||||
<TopMenuButton />
|
<TopMenuButton />
|
||||||
<TextBox
|
<TextBox
|
||||||
backgroundColor="#0099CC"
|
backgroundColor="#0099CC"
|
||||||
@@ -157,15 +180,47 @@ export default function Menu(props) {
|
|||||||
列車の運行計画・混雑状況・感染症対策への取り組み
|
列車の運行計画・混雑状況・感染症対策への取り組み
|
||||||
</Text>
|
</Text>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
{currentStation && (
|
<Carousel
|
||||||
<>
|
ref={carouselRef}
|
||||||
|
layout={"default"}
|
||||||
|
data={
|
||||||
|
originalStationList &&
|
||||||
|
(currentStation
|
||||||
|
? [currentStation, ...locationAndFavorite]
|
||||||
|
: locationAndFavorite)
|
||||||
|
}
|
||||||
|
sliderWidth={wp("100%")}
|
||||||
|
itemWidth={wp("80%")}
|
||||||
|
enableMomentum
|
||||||
|
callbackOffsetMargin={1000}
|
||||||
|
activeAnimationOptions={0.3}
|
||||||
|
onSnapToItem={(d) => {
|
||||||
|
setSelectedCurrentStation(d);
|
||||||
|
}}
|
||||||
|
renderItem={({ item, index }) => {
|
||||||
|
return (
|
||||||
|
<View style={{ marginVertical: 10 }} key={item[0].StationNumber}>
|
||||||
<Sign
|
<Sign
|
||||||
currentStation={currentStation}
|
currentStation={item}
|
||||||
originalStationList={originalStationList}
|
originalStationList={originalStationList}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
oP={StationBoardAcSR.current?.setModalVisible}
|
oP={StationBoardAcSR.current?.setModalVisible}
|
||||||
/>
|
/>
|
||||||
<LED_vision station={currentStation[0]} navigate={navigate} />
|
</View>
|
||||||
</>
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{(currentStation || originalStationList) && (
|
||||||
|
<LED_vision
|
||||||
|
station={
|
||||||
|
originalStationList &&
|
||||||
|
(currentStation
|
||||||
|
? [currentStation, ...locationAndFavorite]
|
||||||
|
: locationAndFavorite)[selectedCurrentStation][0]
|
||||||
|
}
|
||||||
|
navigate={navigate}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
<JRSTraInfoBox
|
<JRSTraInfoBox
|
||||||
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
||||||
@@ -456,8 +511,15 @@ export default function Menu(props) {
|
|||||||
</ScrollView>
|
</ScrollView>
|
||||||
<StationDeteilView
|
<StationDeteilView
|
||||||
StationBoardAcSR={StationBoardAcSR}
|
StationBoardAcSR={StationBoardAcSR}
|
||||||
currentStation={currentStation}
|
currentStation={
|
||||||
|
originalStationList &&
|
||||||
|
(currentStation
|
||||||
|
? [currentStation, ...locationAndFavorite]
|
||||||
|
: locationAndFavorite)[selectedCurrentStation]
|
||||||
|
}
|
||||||
originalStationList={originalStationList}
|
originalStationList={originalStationList}
|
||||||
|
favoriteStation={favoriteStation}
|
||||||
|
setFavoriteStation={setFavoriteStation}
|
||||||
/>
|
/>
|
||||||
<JRSTraInfo
|
<JRSTraInfo
|
||||||
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
||||||
|
12485
package-lock.json
generated
Normal file
12485
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@@ -8,42 +8,43 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^13.0.0",
|
"@expo/vector-icons": "^13.0.0",
|
||||||
"@react-native-async-storage/async-storage": "1.17.11",
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
||||||
"@react-native-community/masked-view": "0.1.10",
|
"@react-native-community/masked-view": "0.1.10",
|
||||||
"@react-navigation/bottom-tabs": "^5.11.11",
|
"@react-navigation/bottom-tabs": "^5.11.11",
|
||||||
"@react-navigation/native": "^5.9.4",
|
"@react-navigation/native": "^5.9.4",
|
||||||
"@react-navigation/stack": "^5.14.5",
|
"@react-navigation/stack": "^5.14.5",
|
||||||
"expo": "^48.0.0",
|
"expo": "^45.0.0",
|
||||||
"expo-font": "~11.1.1",
|
"expo-font": "~10.1.0",
|
||||||
"expo-location": "~15.1.1",
|
"expo-location": "~14.2.2",
|
||||||
"expo-updates": "~0.16.3",
|
"expo-updates": "~0.13.4",
|
||||||
"expo-web-browser": "~12.1.1",
|
"expo-web-browser": "~10.2.1",
|
||||||
"firebase": "8.2.3",
|
"firebase": "8.2.3",
|
||||||
"lottie-react-native": "5.1.4",
|
"lottie-react-native": "5.0.1",
|
||||||
"native-base": "^2.15.2",
|
"native-base": "^2.15.2",
|
||||||
"npm": "^7.18.1",
|
"npm": "^7.18.1",
|
||||||
"pushy-react-native": "^1.0.18",
|
"pushy-react-native": "^1.0.18",
|
||||||
"react": "18.2.0",
|
"react": "17.0.2",
|
||||||
"react-native": "0.71.3",
|
"react-native": "0.68.2",
|
||||||
"react-native-actions-sheet": "^0.4.9",
|
"react-native-actions-sheet": "^0.4.9",
|
||||||
"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.9.0",
|
"react-native-gesture-handler": "~2.2.1",
|
||||||
"react-native-maps": "1.3.2",
|
"react-native-maps": "0.30.2",
|
||||||
"react-native-reanimated": "~2.14.4",
|
"react-native-reanimated": "~2.8.0",
|
||||||
"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.5.0",
|
"react-native-safe-area-context": "4.2.4",
|
||||||
"react-native-screens": "~3.20.0",
|
"react-native-screens": "~3.11.1",
|
||||||
|
"react-native-snap-carousel": "^3.9.1",
|
||||||
"react-native-storage": "^1.0.1",
|
"react-native-storage": "^1.0.1",
|
||||||
"react-native-svg": "13.4.0",
|
"react-native-svg": "12.3.0",
|
||||||
"react-native-svg-uri": "^1.2.3",
|
"react-native-svg-uri": "^1.2.3",
|
||||||
"react-native-vector-icons": "^8.1.0",
|
"react-native-vector-icons": "^8.1.0",
|
||||||
"react-native-webview": "11.26.0"
|
"react-native-webview": "11.18.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-preset-expo": "^9.3.0"
|
"babel-preset-expo": "~9.1.0"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user