Merge commit '3ff585a577d45227ec7bfa473eb658fea0853f9c' into develop
This commit is contained in:
commit
67f9b8b698
132
App.js
132
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,15 @@ 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 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 FavoriteList from "./components/FavoriteList.js";
|
||||||
const Stack = createStackNavigator();
|
const Stack = createStackNavigator();
|
||||||
const Tab = createBottomTabNavigator();
|
const Tab = createBottomTabNavigator();
|
||||||
@ -25,14 +26,14 @@ if (Platform.OS === "android") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const navigationRef = useRef();
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
UpdateAsync();
|
UpdateAsync();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
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}
|
component={top}
|
||||||
options={{
|
options={{
|
||||||
@ -42,7 +43,7 @@ export default function App() {
|
|||||||
tabBarIcon: () => <AntDesign name="barchart" size={32} />,
|
tabBarIcon: () => <AntDesign name="barchart" size={32} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Tab.Screen
|
||||||
name="menuPage"
|
name="menuPage"
|
||||||
component={menuPage}
|
component={menuPage}
|
||||||
options={{
|
options={{
|
||||||
@ -52,7 +53,7 @@ export default function App() {
|
|||||||
tabBarIcon: () => <Ionicons name="ios-radio" size={32} />,
|
tabBarIcon: () => <Ionicons name="ios-radio" size={32} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Tab.Screen
|
||||||
name="home"
|
name="home"
|
||||||
component={tndView}
|
component={tndView}
|
||||||
options={{
|
options={{
|
||||||
@ -66,43 +67,80 @@ export default function App() {
|
|||||||
</NavigationContainer>
|
</NavigationContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const top = () => (
|
const top = ({ navigation }) => {
|
||||||
<Stack.Navigator>
|
const webview = useRef();
|
||||||
<Stack.Screen
|
|
||||||
name="Apps"
|
//地図用
|
||||||
component={Apps}
|
const [mapsStationData, setMapsStationData] = useState(undefined);
|
||||||
options={{
|
useEffect(() => {
|
||||||
headerShown: false,
|
getStationList2().then(setMapsStationData);
|
||||||
gestureEnabled: true,
|
}, []);
|
||||||
headerTransparent: true,
|
useEffect(() => {
|
||||||
}}
|
const unsubscribe = navigation.addListener("tabLongPress", (e) => {
|
||||||
/>
|
navigation.navigate("favoriteList");
|
||||||
<Stack.Screen
|
});
|
||||||
name="trainbase"
|
|
||||||
component={trainbase}
|
return unsubscribe;
|
||||||
options={{
|
}, [navigation]);
|
||||||
title: "トレインビジョン",
|
|
||||||
gestureEnabled: true,
|
return (
|
||||||
...TransitionPresets.SlideFromRightIOS,
|
<Stack.Navigator>
|
||||||
}}
|
<Stack.Screen
|
||||||
/>
|
name="Apps"
|
||||||
<Stack.Screen
|
options={{
|
||||||
name="howto"
|
headerShown: false,
|
||||||
component={howto}
|
gestureEnabled: true,
|
||||||
options={{
|
headerTransparent: true,
|
||||||
title: "使い方",
|
}}
|
||||||
...optionData,
|
>
|
||||||
}}
|
{(props) => <Apps {...props} webview={webview} />}
|
||||||
/>
|
</Stack.Screen>
|
||||||
<Stack.Screen name="news" component={News} options={optionData} />
|
<Stack.Screen
|
||||||
<Stack.Screen name="trainMenu" component={trainMenu} options={optionData} />
|
name="trainbase"
|
||||||
<Stack.Screen
|
options={{
|
||||||
name="favoriteList"
|
title: "トレインビジョン",
|
||||||
component={FavoriteList}
|
gestureEnabled: true,
|
||||||
options={{ ...optionData, gestureEnabled: false }}
|
...TransitionPresets.SlideFromRightIOS,
|
||||||
/>
|
}}
|
||||||
</Stack.Navigator>
|
>
|
||||||
);
|
{(props) => <TrainBase {...props} webview={webview} />}
|
||||||
|
</Stack.Screen>
|
||||||
|
<Stack.Screen
|
||||||
|
name="howto"
|
||||||
|
options={{
|
||||||
|
title: "使い方",
|
||||||
|
...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>
|
||||||
|
<Stack.Screen
|
||||||
|
name="favoriteList"
|
||||||
|
options={{ ...optionData, gestureEnabled: false }}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<FavoriteList
|
||||||
|
{...props}
|
||||||
|
webview={webview}
|
||||||
|
stationData={mapsStationData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Stack.Screen>
|
||||||
|
</Stack.Navigator>
|
||||||
|
);
|
||||||
|
};
|
||||||
function menuPage() {
|
function menuPage() {
|
||||||
return (
|
return (
|
||||||
<Stack.Navigator>
|
<Stack.Navigator>
|
||||||
@ -118,7 +156,7 @@ function menuPage() {
|
|||||||
<Stack.Screen name="setting" component={Setting} options={optionData} />
|
<Stack.Screen name="setting" component={Setting} options={optionData} />
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="trainbase"
|
name="trainbase"
|
||||||
component={trainbase}
|
component={TrainBase}
|
||||||
options={{
|
options={{
|
||||||
...TransitionPresets.ModalPresentationIOS,
|
...TransitionPresets.ModalPresentationIOS,
|
||||||
cardOverlayEnabled: true,
|
cardOverlayEnabled: true,
|
||||||
|
18
Apps.js
18
Apps.js
@ -19,23 +19,15 @@ 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({ navigation, webview }) {
|
||||||
const {
|
const { navigate } = navigation;
|
||||||
navigation: { navigate },
|
|
||||||
} = props;
|
|
||||||
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 +179,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"}
|
||||||
/>
|
/>
|
||||||
|
@ -8,14 +8,8 @@ import { AS } from "../storageControl";
|
|||||||
import { news } from "../config/newsUpdate";
|
import { news } from "../config/newsUpdate";
|
||||||
import { getStationList, lineList } from "../lib/getStationList";
|
import { getStationList, lineList } from "../lib/getStationList";
|
||||||
var Status = StatusbarDetect();
|
var Status = StatusbarDetect();
|
||||||
export default function FavoriteList(props) {
|
export default function FavoriteList({ navigation, webview, stationData }) {
|
||||||
const {
|
const { navigate } = navigation;
|
||||||
route: {
|
|
||||||
params: { webview, stationData },
|
|
||||||
},
|
|
||||||
navigation: { navigate },
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
const [favoriteStation, setFavoriteStation] = useState([]);
|
const [favoriteStation, setFavoriteStation] = useState([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -31,6 +25,17 @@ export default function FavoriteList(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ height: "100%", backgroundColor: "#0099CC" }}>
|
<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" }}>
|
<ScrollView style={{ height: "100%", backgroundColor: "white" }}>
|
||||||
{favoriteStation
|
{favoriteStation
|
||||||
.filter((d) => d[0].StationMap)
|
.filter((d) => d[0].StationMap)
|
||||||
@ -100,9 +105,7 @@ export default function FavoriteList(props) {
|
|||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => navigation.goBack()}
|
||||||
navigate("trainMenu");
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<View style={{ flex: 1 }} />
|
<View style={{ flex: 1 }} />
|
||||||
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
<Text style={{ fontSize: 25, fontWeight: "bold", color: "white" }}>
|
||||||
|
@ -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,9 +66,7 @@ export default function trainMenu({
|
|||||||
backgroundColor={"#EA4752"}
|
backgroundColor={"#EA4752"}
|
||||||
icon="star"
|
icon="star"
|
||||||
flex={1}
|
flex={1}
|
||||||
onPressButton={() =>
|
onPressButton={() => navigate("favoriteList")}
|
||||||
navigate("favoriteList", { webview, stationData })
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
お気に入り
|
お気に入り
|
||||||
</UsefulBox>
|
</UsefulBox>
|
||||||
@ -96,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" }}>
|
||||||
|
Loading…
Reference in New Issue
Block a user