Merge commit '0d2330a31434f2eacc2fa5f418cd07dccdca6032' into develop
This commit is contained in:
commit
81dd57ba14
2
App.js
2
App.js
@ -16,6 +16,7 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
import { DeviceOrientationChangeProvider } from "./stateBox/useDeviceOrientationChange";
|
||||
import { TrainMenuProvider } from "./stateBox/useTrainMenu";
|
||||
import { buildProvidersTree } from "./lib/providerTreeProvider";
|
||||
import { StationListProvider } from "./stateBox/useStationList";
|
||||
|
||||
LogBox.ignoreLogs([
|
||||
"ViewPropTypes will be removed",
|
||||
@ -32,6 +33,7 @@ export default function App() {
|
||||
useEffect(() => UpdateAsync(), []);
|
||||
|
||||
const ProviderTree = buildProvidersTree([
|
||||
StationListProvider,
|
||||
FavoriteStationProvider,
|
||||
TrainDelayDataProvider,
|
||||
CurrentTrainProvider,
|
||||
|
@ -73,7 +73,7 @@ export function MenuPage() {
|
||||
<Stack.Screen
|
||||
name="howto"
|
||||
options={optionData}
|
||||
children={(props) => <HowTo {...props} />}
|
||||
component={HowTo}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
);
|
||||
|
15
Top.js
15
Top.js
@ -13,7 +13,6 @@ import FavoriteList from "./components/FavoriteList";
|
||||
import { optionData } from "./lib/stackOption";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useCurrentTrain } from "./stateBox/useCurrentTrain";
|
||||
import { ASCore } from "./storageControl";
|
||||
import { useTrainMenu } from "./stateBox/useTrainMenu";
|
||||
const Stack = createStackNavigator();
|
||||
export const Top = ({ navigationRef }) => {
|
||||
@ -21,18 +20,7 @@ export const Top = ({ navigationRef }) => {
|
||||
const { navigate, addListener } = useNavigation();
|
||||
|
||||
//地図用
|
||||
const { setMapsStationData, injectJavaScript, setInjectJavaScript } =
|
||||
useTrainMenu();
|
||||
|
||||
useEffect(() => {
|
||||
getStationList2().then(setMapsStationData);
|
||||
}, []);
|
||||
const [mapSwitch, setMapSwitch] = React.useState("false");
|
||||
useEffect(() => {
|
||||
//地図スイッチ
|
||||
ASCore({ k: "mapSwitch", s: setMapSwitch, d: "false" });
|
||||
}, []);
|
||||
|
||||
const { injectJavaScript, setInjectJavaScript, mapSwitch } = useTrainMenu();
|
||||
|
||||
const goToFavoriteList = () => navigate("favoriteList");
|
||||
|
||||
@ -60,7 +48,6 @@ export const Top = ({ navigationRef }) => {
|
||||
navigate("Apps");
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = addListener("tabPress", goToTrainMenu);
|
||||
return unsubscribe;
|
||||
|
29444
assets/四国旅客鉄道予讃線.json
29444
assets/四国旅客鉄道予讃線.json
File diff suppressed because it is too large
Load Diff
@ -1 +1,224 @@
|
||||
{"type":"FeatureCollection","features":[{"properties":{"name":"五十崎","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/五十崎","color":"FBAF18"},"type":"Feature","geometry":{"type":"LineString","coordinates":[[132.63672,33.53833],[132.63599,33.53782]]}},{"properties":{"name":"五十崎","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/五十崎"},"type":"Feature","geometry":{"type":"Point","coordinates":[132.63599,33.53782]}},{"properties":{"name":"内子","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/内子","color":"FBAF18"},"type":"Feature","geometry":{"type":"LineString","coordinates":[[132.64634,33.55023],[132.64618,33.54873]]}},{"properties":{"name":"内子","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/内子"},"type":"Feature","geometry":{"type":"Point","coordinates":[132.64634,33.55023]}},{"properties":{"name":"喜多山","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/喜多山","color":"FBAF18"},"type":"Feature","geometry":{"type":"LineString","coordinates":[[132.61103,33.53326],[132.61184,33.53359]]}},{"properties":{"name":"喜多山","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/喜多山"},"type":"Feature","geometry":{"type":"Point","coordinates":[132.61103,33.53326]}},{"properties":{"name":"新谷","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/新谷","color":"FBAF18"},"type":"Feature","geometry":{"type":"LineString","coordinates":[[132.59812,33.53417],[132.59894,33.53414]]}},{"properties":{"name":"新谷","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線/新谷"},"type":"Feature","geometry":{"type":"Point","coordinates":[132.59812,33.53417]}},{"properties":{"name":"内子線","uri":"https://uedayou.net/jrslod/四国旅客鉄道/内子線","color":"FBAF18"},"type":"Feature","geometry":{"type":"MultiLineString","coordinates":[[[132.61103,33.53326],[132.61184,33.53359]],[[132.63672,33.53833],[132.63599,33.53782]],[[132.59894,33.53414],[132.60008,33.53411],[132.60062,33.5341],[132.60165,33.53407],[132.60238,33.53402],[132.603,33.53393],[132.60436,33.53374],[132.60653,33.53343],[132.60837,33.53317],[132.60913,33.53306],[132.60942,33.53306],[132.60975,33.53306],[132.6103,33.53312],[132.61055,33.53315],[132.61086,33.53321],[132.61103,33.53326]],[[132.64634,33.55023],[132.64618,33.54873]],[[132.59812,33.53417],[132.59894,33.53414]],[[132.64618,33.54873],[132.64615,33.54836],[132.64606,33.5477],[132.64603,33.54735],[132.64593,33.54665],[132.64581,33.54616],[132.64569,33.54575],[132.64547,33.54524],[132.64527,33.54496],[132.64488,33.54449],[132.64463,33.54425],[132.64453,33.54415],[132.64379,33.54359],[132.64294,33.54293],[132.64204,33.54222],[132.64181,33.54204],[132.64106,33.54147],[132.63989,33.54055],[132.63898,33.53985],[132.63788,33.53906],[132.63691,33.53844],[132.6368,33.53838],[132.63672,33.53833]],[[132.63599,33.53782],[132.63492,33.53712],[132.63383,33.53646],[132.63354,33.53631],[132.63319,33.53621],[132.6323,33.53609],[132.63157,33.53597],[132.63102,33.53585],[132.63058,33.53569],[132.63016,33.53549],[132.62986,33.53527],[132.6297,33.53515],[132.62939,33.5348],[132.62913,33.53449],[132.62893,33.5343],[132.62862,33.53407],[132.62839,33.53393],[132.62791,33.53379],[132.62699,33.53356],[132.62575,33.53327],[132.62491,33.53313],[132.62449,33.53306],[132.62386,33.53307],[132.62341,33.53308],[132.6231,33.53306],[132.62248,33.53291],[132.62207,33.5328],[132.62171,33.53272],[132.62149,33.53271],[132.62126,33.53273],[132.62069,33.53283],[132.6203,33.53286],[132.61996,33.53288],[132.61954,33.5329],[132.61937,33.53292],[132.61913,33.53298],[132.6187,33.53311],[132.61841,33.53319],[132.61808,33.53329],[132.61675,33.53368],[132.6161,33.53387],[132.61546,33.53407],[132.615,33.53419],[132.61486,33.53421],[132.61474,33.53419],[132.61458,33.53417],[132.61428,33.5341],[132.61409,33.53407],[132.61341,33.53401],[132.6131,33.53397],[132.61285,33.5339],[132.61221,33.53373],[132.61184,33.53359]]]}}]}
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"properties": {
|
||||
"name": "新谷",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/新谷",
|
||||
"color": "FBAF18"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[132.59812, 33.53417],
|
||||
[132.59894, 33.53414]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "新谷",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/新谷"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": { "type": "Point", "coordinates": [132.59812, 33.53417] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "喜多山",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/喜多山",
|
||||
"color": "FBAF18"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[132.61103, 33.53326],
|
||||
[132.61184, 33.53359]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "喜多山",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/喜多山"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": { "type": "Point", "coordinates": [132.61103, 33.53326] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "五十崎",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/五十崎",
|
||||
"color": "FBAF18"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[132.63672, 33.53833],
|
||||
[132.63599, 33.53782]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "五十崎",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/五十崎"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": { "type": "Point", "coordinates": [132.63599, 33.53782] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "内子",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/内子",
|
||||
"color": "FBAF18"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[132.64634, 33.55023],
|
||||
[132.64618, 33.54873]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "内子",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線/内子"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": { "type": "Point", "coordinates": [132.64634, 33.55023] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "内子線",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/内子線",
|
||||
"color": "FBAF18"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "MultiLineString",
|
||||
"coordinates": [
|
||||
[
|
||||
[132.61103, 33.53326],
|
||||
[132.61184, 33.53359]
|
||||
],
|
||||
[
|
||||
[132.63672, 33.53833],
|
||||
[132.63599, 33.53782]
|
||||
],
|
||||
[
|
||||
[132.59894, 33.53414],
|
||||
[132.60008, 33.53411],
|
||||
[132.60062, 33.5341],
|
||||
[132.60165, 33.53407],
|
||||
[132.60238, 33.53402],
|
||||
[132.603, 33.53393],
|
||||
[132.60436, 33.53374],
|
||||
[132.60653, 33.53343],
|
||||
[132.60837, 33.53317],
|
||||
[132.60913, 33.53306],
|
||||
[132.60942, 33.53306],
|
||||
[132.60975, 33.53306],
|
||||
[132.6103, 33.53312],
|
||||
[132.61055, 33.53315],
|
||||
[132.61086, 33.53321],
|
||||
[132.61103, 33.53326]
|
||||
],
|
||||
[
|
||||
[132.64634, 33.55023],
|
||||
[132.64618, 33.54873]
|
||||
],
|
||||
[
|
||||
[132.59812, 33.53417],
|
||||
[132.59894, 33.53414]
|
||||
],
|
||||
[
|
||||
[132.64618, 33.54873],
|
||||
[132.64615, 33.54836],
|
||||
[132.64606, 33.5477],
|
||||
[132.64603, 33.54735],
|
||||
[132.64593, 33.54665],
|
||||
[132.64581, 33.54616],
|
||||
[132.64569, 33.54575],
|
||||
[132.64547, 33.54524],
|
||||
[132.64527, 33.54496],
|
||||
[132.64488, 33.54449],
|
||||
[132.64463, 33.54425],
|
||||
[132.64453, 33.54415],
|
||||
[132.64379, 33.54359],
|
||||
[132.64294, 33.54293],
|
||||
[132.64204, 33.54222],
|
||||
[132.64181, 33.54204],
|
||||
[132.64106, 33.54147],
|
||||
[132.63989, 33.54055],
|
||||
[132.63898, 33.53985],
|
||||
[132.63788, 33.53906],
|
||||
[132.63691, 33.53844],
|
||||
[132.6368, 33.53838],
|
||||
[132.63672, 33.53833]
|
||||
],
|
||||
[
|
||||
[132.63599, 33.53782],
|
||||
[132.63492, 33.53712],
|
||||
[132.63383, 33.53646],
|
||||
[132.63354, 33.53631],
|
||||
[132.63319, 33.53621],
|
||||
[132.6323, 33.53609],
|
||||
[132.63157, 33.53597],
|
||||
[132.63102, 33.53585],
|
||||
[132.63058, 33.53569],
|
||||
[132.63016, 33.53549],
|
||||
[132.62986, 33.53527],
|
||||
[132.6297, 33.53515],
|
||||
[132.62939, 33.5348],
|
||||
[132.62913, 33.53449],
|
||||
[132.62893, 33.5343],
|
||||
[132.62862, 33.53407],
|
||||
[132.62839, 33.53393],
|
||||
[132.62791, 33.53379],
|
||||
[132.62699, 33.53356],
|
||||
[132.62575, 33.53327],
|
||||
[132.62491, 33.53313],
|
||||
[132.62449, 33.53306],
|
||||
[132.62386, 33.53307],
|
||||
[132.62341, 33.53308],
|
||||
[132.6231, 33.53306],
|
||||
[132.62248, 33.53291],
|
||||
[132.62207, 33.5328],
|
||||
[132.62171, 33.53272],
|
||||
[132.62149, 33.53271],
|
||||
[132.62126, 33.53273],
|
||||
[132.62069, 33.53283],
|
||||
[132.6203, 33.53286],
|
||||
[132.61996, 33.53288],
|
||||
[132.61954, 33.5329],
|
||||
[132.61937, 33.53292],
|
||||
[132.61913, 33.53298],
|
||||
[132.6187, 33.53311],
|
||||
[132.61841, 33.53319],
|
||||
[132.61808, 33.53329],
|
||||
[132.61675, 33.53368],
|
||||
[132.6161, 33.53387],
|
||||
[132.61546, 33.53407],
|
||||
[132.615, 33.53419],
|
||||
[132.61486, 33.53421],
|
||||
[132.61474, 33.53419],
|
||||
[132.61458, 33.53417],
|
||||
[132.61428, 33.5341],
|
||||
[132.61409, 33.53407],
|
||||
[132.61341, 33.53401],
|
||||
[132.6131, 33.53397],
|
||||
[132.61285, 33.5339],
|
||||
[132.61221, 33.53373],
|
||||
[132.61184, 33.53359]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
20357
assets/四国旅客鉄道土讃線.json
20357
assets/四国旅客鉄道土讃線.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
256
assets/四国旅客鉄道本四備讃線.json
Normal file
256
assets/四国旅客鉄道本四備讃線.json
Normal file
@ -0,0 +1,256 @@
|
||||
{
|
||||
"type": "FeatureCollection",
|
||||
"features": [
|
||||
{
|
||||
"properties": {
|
||||
"name": "児島",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線/児島",
|
||||
"color": "0073BC"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[133.80748, 34.46183],
|
||||
[133.8079, 34.4638]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "児島",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線/児島"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": { "type": "Point", "coordinates": [133.80748, 34.46183] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "宇多津",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線/宇多津",
|
||||
"color": "0073BC"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "LineString",
|
||||
"coordinates": [
|
||||
[133.81324, 34.30552],
|
||||
[133.81426, 34.30712]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "宇多津",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線/宇多津"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": { "type": "Point", "coordinates": [133.81324, 34.30552] }
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"name": "本四備讃線",
|
||||
"uri": "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線",
|
||||
"color": "0073BC"
|
||||
},
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "MultiLineString",
|
||||
"coordinates": [
|
||||
[
|
||||
[133.81426, 34.30712],
|
||||
[133.81504, 34.30838],
|
||||
[133.81622, 34.31028],
|
||||
[133.81778, 34.31274]
|
||||
],
|
||||
[
|
||||
[133.81324, 34.30552],
|
||||
[133.81426, 34.30712]
|
||||
],
|
||||
[
|
||||
[133.80748, 34.46183],
|
||||
[133.8079, 34.4638]
|
||||
],
|
||||
[
|
||||
[133.80745, 34.46169],
|
||||
[133.80748, 34.46183]
|
||||
],
|
||||
[
|
||||
[133.80745, 34.46169],
|
||||
[133.80735, 34.46116],
|
||||
[133.80723, 34.46026],
|
||||
[133.80714, 34.45964],
|
||||
[133.807, 34.45809],
|
||||
[133.80697, 34.45769],
|
||||
[133.80697, 34.45753],
|
||||
[133.80693, 34.45694],
|
||||
[133.80691, 34.4557],
|
||||
[133.80692, 34.45548],
|
||||
[133.80691, 34.45543],
|
||||
[133.80693, 34.45494],
|
||||
[133.80696, 34.45464],
|
||||
[133.80704, 34.45385],
|
||||
[133.80714, 34.45314],
|
||||
[133.8072, 34.45271],
|
||||
[133.80727, 34.45221],
|
||||
[133.80737, 34.45148],
|
||||
[133.80742, 34.45102],
|
||||
[133.80745, 34.45087],
|
||||
[133.80762, 34.44957],
|
||||
[133.80765, 34.4494],
|
||||
[133.80779, 34.44837],
|
||||
[133.80789, 34.44765],
|
||||
[133.80793, 34.44736],
|
||||
[133.80804, 34.4467],
|
||||
[133.80813, 34.44589],
|
||||
[133.80828, 34.4445],
|
||||
[133.80825, 34.4442],
|
||||
[133.80833, 34.44366],
|
||||
[133.80837, 34.44336],
|
||||
[133.8084, 34.44309],
|
||||
[133.80842, 34.44263],
|
||||
[133.80842, 34.44233],
|
||||
[133.80842, 34.44203],
|
||||
[133.8084, 34.44183],
|
||||
[133.8083, 34.44071],
|
||||
[133.80828, 34.44059],
|
||||
[133.80819, 34.4399],
|
||||
[133.80807, 34.43932],
|
||||
[133.80763, 34.43745],
|
||||
[133.80731, 34.4362],
|
||||
[133.80714, 34.43555],
|
||||
[133.80706, 34.43527],
|
||||
[133.80691, 34.4346],
|
||||
[133.80643, 34.43278],
|
||||
[133.80594, 34.43084],
|
||||
[133.8057, 34.42991],
|
||||
[133.80545, 34.42891],
|
||||
[133.8054, 34.42866],
|
||||
[133.805, 34.42706],
|
||||
[133.80491, 34.42672],
|
||||
[133.80491, 34.4267],
|
||||
[133.80463, 34.42556],
|
||||
[133.80445, 34.42488],
|
||||
[133.80435, 34.42447],
|
||||
[133.8043, 34.4243],
|
||||
[133.80403, 34.42323],
|
||||
[133.804, 34.4231],
|
||||
[133.8039, 34.42246],
|
||||
[133.80386, 34.42206],
|
||||
[133.80385, 34.42197],
|
||||
[133.80384, 34.42187],
|
||||
[133.80382, 34.42161],
|
||||
[133.80383, 34.42155],
|
||||
[133.80383, 34.42146],
|
||||
[133.80382, 34.4212],
|
||||
[133.80383, 34.42093],
|
||||
[133.80384, 34.42074],
|
||||
[133.8039, 34.42026],
|
||||
[133.80393, 34.41992],
|
||||
[133.80403, 34.41939],
|
||||
[133.80425, 34.41856],
|
||||
[133.80446, 34.41786],
|
||||
[133.80506, 34.41631],
|
||||
[133.80553, 34.41514],
|
||||
[133.80581, 34.41441],
|
||||
[133.80615, 34.41329],
|
||||
[133.80657, 34.41181],
|
||||
[133.80675, 34.41122],
|
||||
[133.8068, 34.41106],
|
||||
[133.80715, 34.40959],
|
||||
[133.80768, 34.40746],
|
||||
[133.8082, 34.40555],
|
||||
[133.80908, 34.4024],
|
||||
[133.80918, 34.40207],
|
||||
[133.80999, 34.39922],
|
||||
[133.81061, 34.39702],
|
||||
[133.81079, 34.39659],
|
||||
[133.8111, 34.39597],
|
||||
[133.8114, 34.39544],
|
||||
[133.81192, 34.39468],
|
||||
[133.81254, 34.39392],
|
||||
[133.8126, 34.39384],
|
||||
[133.81397, 34.39239],
|
||||
[133.81532, 34.39103],
|
||||
[133.81581, 34.39044],
|
||||
[133.81636, 34.38977],
|
||||
[133.81687, 34.38902],
|
||||
[133.81732, 34.38818],
|
||||
[133.81775, 34.38715],
|
||||
[133.81804, 34.38621],
|
||||
[133.81811, 34.386],
|
||||
[133.81902, 34.38312],
|
||||
[133.81974, 34.38088],
|
||||
[133.8208, 34.37748],
|
||||
[133.82082, 34.37741],
|
||||
[133.82236, 34.3725],
|
||||
[133.8236, 34.36876],
|
||||
[133.82361, 34.36872],
|
||||
[133.82487, 34.365],
|
||||
[133.82609, 34.3614],
|
||||
[133.82654, 34.36006],
|
||||
[133.82729, 34.35785],
|
||||
[133.82828, 34.35487],
|
||||
[133.82839, 34.35449],
|
||||
[133.82854, 34.35392],
|
||||
[133.82861, 34.35335],
|
||||
[133.82865, 34.35271],
|
||||
[133.8286, 34.35153],
|
||||
[133.82857, 34.35127],
|
||||
[133.82854, 34.35097],
|
||||
[133.82835, 34.34966],
|
||||
[133.82809, 34.34812],
|
||||
[133.8277, 34.34593],
|
||||
[133.82715, 34.34275],
|
||||
[133.82707, 34.34234],
|
||||
[133.82665, 34.33997],
|
||||
[133.82636, 34.33823],
|
||||
[133.82627, 34.33756],
|
||||
[133.82627, 34.33706],
|
||||
[133.82626, 34.3366],
|
||||
[133.82642, 34.33542],
|
||||
[133.82657, 34.33461],
|
||||
[133.82678, 34.33343],
|
||||
[133.82688, 34.33296],
|
||||
[133.82703, 34.33215],
|
||||
[133.82724, 34.33088],
|
||||
[133.82714, 34.33036],
|
||||
[133.8271, 34.33009],
|
||||
[133.82706, 34.3297],
|
||||
[133.82702, 34.32933],
|
||||
[133.8268, 34.3284],
|
||||
[133.82653, 34.32749],
|
||||
[133.82626, 34.32674],
|
||||
[133.82574, 34.32565],
|
||||
[133.82473, 34.32388],
|
||||
[133.82344, 34.32159],
|
||||
[133.82326, 34.32129],
|
||||
[133.82235, 34.31973],
|
||||
[133.82224, 34.31954]
|
||||
],
|
||||
[
|
||||
[133.81778, 34.31274],
|
||||
[133.81853, 34.31395],
|
||||
[133.82015, 34.31632],
|
||||
[133.82147, 34.31828],
|
||||
[133.82224, 34.31954]
|
||||
],
|
||||
[
|
||||
[133.82224, 34.31954],
|
||||
[133.82207, 34.31872],
|
||||
[133.82199, 34.31824],
|
||||
[133.82198, 34.31764],
|
||||
[133.82204, 34.31701],
|
||||
[133.82219, 34.31661],
|
||||
[133.8226, 34.31597],
|
||||
[133.82315, 34.31523],
|
||||
[133.8237, 34.31472],
|
||||
[133.8241, 34.3144],
|
||||
[133.82457, 34.31411],
|
||||
[133.82565, 34.31357]
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,9 +2,8 @@ import React, { useRef } from "react";
|
||||
import { Platform } from "react-native";
|
||||
import ActionSheet from "react-native-actions-sheet";
|
||||
import { EachTrainInfoCore } from "./EachTrainInfoCore";
|
||||
export const EachTrainInfo = (props) => {
|
||||
if (!props.payload) return <></>;
|
||||
|
||||
export const EachTrainInfo = ({ payload }) => {
|
||||
if (!payload) return <></>;
|
||||
const actionSheetRef = useRef(null);
|
||||
return (
|
||||
<ActionSheet
|
||||
@ -17,7 +16,7 @@ export const EachTrainInfo = (props) => {
|
||||
|
||||
//useBottomSafeAreaPadding={Platform.OS == "android"}
|
||||
>
|
||||
<EachTrainInfoCore {...{ actionSheetRef, ...props.payload }} />
|
||||
<EachTrainInfoCore {...{ actionSheetRef, ...payload }} />
|
||||
</ActionSheet>
|
||||
);
|
||||
};
|
||||
|
@ -1,7 +1,6 @@
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import {
|
||||
View,
|
||||
LayoutAnimation,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
StyleSheet,
|
||||
@ -9,7 +8,6 @@ import {
|
||||
BackHandler,
|
||||
Linking,
|
||||
} from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { AS } from "../../storageControl";
|
||||
import trainList from "../../assets/originData/trainList";
|
||||
@ -33,19 +31,19 @@ import { getType } from "../../lib/eachTrainInfoCoreLib/getType";
|
||||
import { searchSpecialTrain } from "../../lib/eachTrainInfoCoreLib/searchSpecialTrain";
|
||||
import { openBackTrainInfo } from "../../lib/eachTrainInfoCoreLib/openBackTrainInfo";
|
||||
import { ShowSpecialTrain } from "./EachTrainInfo/ShowSpecialTrain";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
import { HeaderText } from "./EachTrainInfoCore/HeaderText";
|
||||
|
||||
export const EachTrainInfoCore = ({
|
||||
actionSheetRef,
|
||||
data,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
from,
|
||||
setTrainInfo,
|
||||
navigate,
|
||||
}) => {
|
||||
// const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false);
|
||||
const { currentTrain } = useCurrentTrain();
|
||||
const { setTrainInfo, originalStationList } = useTrainMenu();
|
||||
const [currentTrainData, setCurrentTrainData] = useState();
|
||||
|
||||
// const [actionSheetHorizonalScroll, setActionSheetHorizonalScroll] = useState(false);
|
||||
@ -91,7 +89,7 @@ export const EachTrainInfoCore = ({
|
||||
);
|
||||
|
||||
// 使用例
|
||||
const stopStationIDList = trainData.map((i, index) => {
|
||||
const stopStationIDList = trainData.map((i) => {
|
||||
const [station, se, time] = i.split(",");
|
||||
const Stations = stationList.map((a) =>
|
||||
a.filter((d) => d.StationName == station)
|
||||
@ -132,7 +130,7 @@ export const EachTrainInfoCore = ({
|
||||
}
|
||||
}, [data.limited, trainData]);
|
||||
|
||||
const { height, width } = useWindowDimensions();
|
||||
const { height } = useWindowDimensions();
|
||||
const { isLandscape } = useDeviceOrientationChange();
|
||||
|
||||
const [trueTrainID, setTrueTrainID] = useState();
|
||||
@ -217,7 +215,7 @@ export const EachTrainInfoCore = ({
|
||||
.then((d) => {
|
||||
if (d) setTrainPositionSwitch(d);
|
||||
})
|
||||
.catch((d) => AS.setItem("trainPositionSwitch", "false"));
|
||||
.catch(() => AS.setItem("trainPositionSwitch", "false"));
|
||||
}, []);
|
||||
|
||||
const openTrainInfo = (d) => {
|
||||
@ -236,10 +234,9 @@ export const EachTrainInfoCore = ({
|
||||
}${TrainNumber}`,
|
||||
},
|
||||
navigate,
|
||||
originalStationList,
|
||||
from: from == "LED" ? "LED2" : "NearTrainDiagramView",
|
||||
};
|
||||
if (setTrainInfo) {
|
||||
if (isLandscape) {
|
||||
setTrainInfo(payload.data);
|
||||
} else {
|
||||
SheetManager.hide("EachTrainInfo").then(() => {
|
||||
@ -279,36 +276,17 @@ export const EachTrainInfoCore = ({
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
<View style={{ padding: 10, flexDirection: "row", alignItems: "center" }}>
|
||||
<Text style={{ fontSize: 20, fontWeight: "bold", color: "white" }}>
|
||||
{trainName}
|
||||
</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={{ fontSize: 20, fontWeight: "bold", color: "white" }}>
|
||||
{showHeadStation.map((d) => `${headStation[d].id} + `)}
|
||||
{data.trainNum}
|
||||
{showTailStation.map((d) => ` + ${tailStation[d].id}`)}
|
||||
</Text>
|
||||
<HeaderText
|
||||
data={data}
|
||||
trainData={trainData}
|
||||
showHeadStation={showHeadStation}
|
||||
showTailStation={showTailStation}
|
||||
headStation={headStation}
|
||||
tailStation={tailStation}
|
||||
navigate={navigate}
|
||||
from={from}
|
||||
/>
|
||||
|
||||
{data.limited != undefined &&
|
||||
getType(data.limited.split(":")[0]) &&
|
||||
!data.limited.split(":")[1].match("サンポート") && (
|
||||
<Ionicons
|
||||
name="subway"
|
||||
color="white"
|
||||
size={30}
|
||||
style={{ margin: 5 }}
|
||||
onPress={() => {
|
||||
LayoutAnimation.easeInEaseOut(); //setLoadingDelayData(true);
|
||||
navigate("trainbase", {
|
||||
info: "train.html?tn=" + data.trainNum,
|
||||
from,
|
||||
});
|
||||
SheetManager.hide("EachTrainInfo");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
<DynamicHeaderScrollView
|
||||
from={from}
|
||||
styles={styles}
|
||||
|
@ -0,0 +1,71 @@
|
||||
import React, { CSSProperties, FC, useEffect, useMemo, useState } from "react";
|
||||
import { Text, View, LayoutAnimation, TextStyle } from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { getType } from "../../../lib/eachTrainInfoCoreLib/getType";
|
||||
import { migrateTrainName } from "../../../lib/eachTrainInfoCoreLib/migrateTrainName";
|
||||
import { TrainViewIcon } from "./trainViewIcon";
|
||||
|
||||
type Props = {
|
||||
data: { trainNum: string; limited: string };
|
||||
trainData: string[];
|
||||
showHeadStation: number[];
|
||||
showTailStation: number[];
|
||||
headStation: { id: string }[];
|
||||
tailStation: { id: string }[];
|
||||
navigate: any;
|
||||
from: string;
|
||||
};
|
||||
|
||||
const textConfig: TextStyle = {
|
||||
fontSize: 20,
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
};
|
||||
|
||||
export const HeaderText: FC<Props> = ({
|
||||
data,
|
||||
trainData,
|
||||
showHeadStation,
|
||||
showTailStation,
|
||||
headStation,
|
||||
tailStation,
|
||||
navigate,
|
||||
from,
|
||||
}) => {
|
||||
const trainName = useMemo(() => {
|
||||
if (!data.limited) return "";
|
||||
const limitedArray = data.limited.split(":");
|
||||
const type = getType(limitedArray[0]);
|
||||
|
||||
switch (true) {
|
||||
case !!limitedArray[1]:
|
||||
// 特急の場合は、列車名を取得
|
||||
return type + migrateTrainName(limitedArray[1]);
|
||||
case trainData.length == 0:
|
||||
// 特急以外の場合は、列車番号を取得
|
||||
return type;
|
||||
default:
|
||||
// 行先がある場合は、行先を取得
|
||||
return (
|
||||
type +
|
||||
migrateTrainName(
|
||||
trainData[trainData.length - 1].split(",")[0] + "行き"
|
||||
)
|
||||
);
|
||||
}
|
||||
}, [data.limited, trainData]);
|
||||
return (
|
||||
<View style={{ padding: 10, flexDirection: "row", alignItems: "center" }}>
|
||||
<Text style={textConfig}>{trainName}</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={textConfig}>
|
||||
{showHeadStation.map((d) => `${headStation[d].id} + `)}
|
||||
{data.trainNum}
|
||||
{showTailStation.map((d) => ` + ${tailStation[d].id}`)}
|
||||
</Text>
|
||||
|
||||
<TrainViewIcon {...{ data, navigate, from }} />
|
||||
</View>
|
||||
);
|
||||
};
|
@ -0,0 +1,41 @@
|
||||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { LayoutAnimation } from "react-native";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { getType } from "../../../lib/eachTrainInfoCoreLib/getType";
|
||||
|
||||
type Props = {
|
||||
data: { trainNum: string; limited: string };
|
||||
navigate: any;
|
||||
from: string;
|
||||
};
|
||||
export const TrainViewIcon: FC<Props> = ({ data, navigate, from }) => {
|
||||
const [isTrainView, setIsTrainView] = useState(false);
|
||||
//トレインビュー表示対象(特急、マリン)かを判定
|
||||
useEffect(() => {
|
||||
if (!data.limited) return;
|
||||
setIsTrainView(
|
||||
getType(data.limited.split(":")[0]) &&
|
||||
!data.limited.split(":")[1].match("サンポート")
|
||||
);
|
||||
}, [data.limited]);
|
||||
const onPressTrainView = () => {
|
||||
LayoutAnimation.easeInEaseOut(); //setLoadingDelayData(true);
|
||||
navigate("trainbase", {
|
||||
info: "train.html?tn=" + data.trainNum,
|
||||
from,
|
||||
});
|
||||
SheetManager.hide("EachTrainInfo");
|
||||
};
|
||||
return isTrainView ? (
|
||||
<Ionicons
|
||||
name="subway"
|
||||
color="white"
|
||||
size={30}
|
||||
style={{ margin: 5 }}
|
||||
onPress={onPressTrainView}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
);
|
||||
};
|
@ -23,7 +23,6 @@ export const StationDeteilView = (props) => {
|
||||
if (!props.payload) return <></>;
|
||||
const {
|
||||
currentStation,
|
||||
originalStationList,
|
||||
navigate,
|
||||
onExit,
|
||||
goTo,
|
||||
@ -99,7 +98,6 @@ export const StationDeteilView = (props) => {
|
||||
>
|
||||
<Sign
|
||||
currentStation={currentStation}
|
||||
originalStationList={originalStationList}
|
||||
oP={() => {
|
||||
usePDFView == "true"
|
||||
? Linking.openURL(currentStation[0].StationTimeTable)
|
||||
@ -114,13 +112,6 @@ export const StationDeteilView = (props) => {
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
{/* {currentStation &&
|
||||
currentStation.map((d) => (
|
||||
<NexPreStationLine
|
||||
currentStation={d}
|
||||
originalStationList={originalStationList}
|
||||
/>
|
||||
))} */}
|
||||
{currentStation &&
|
||||
currentStation[0].JrHpUrl &&
|
||||
currentStation[0].StationNumber != "M12" && (
|
||||
|
@ -1,42 +1,26 @@
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import {
|
||||
View,
|
||||
LayoutAnimation,
|
||||
ScrollView,
|
||||
Linking,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
Platform,
|
||||
BackHandler,
|
||||
} from "react-native";
|
||||
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import ActionSheet, {
|
||||
SheetManager,
|
||||
useScrollHandlers,
|
||||
} from "react-native-actions-sheet";
|
||||
import LottieView from "lottie-react-native";
|
||||
import ActionSheet, { SheetManager } from "react-native-actions-sheet";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import ViewShot from "react-native-view-shot";
|
||||
import * as Sharing from "expo-sharing";
|
||||
import { useTrainDelayData } from "../../stateBox/useTrainDelayData";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
import lineColorList from "../../assets/originData/lineColorList";
|
||||
import { stationIDPair } from "../../lib/getStationList2";
|
||||
import { lineListPair } from "../../lib/getStationList";
|
||||
|
||||
export const TrainMenuLineSelector = () => {
|
||||
const { getTime, delayData, loadingDelayData, setLoadingDelayData } =
|
||||
useTrainDelayData();
|
||||
const {
|
||||
selectedLine,
|
||||
setSelectedLine,
|
||||
mapsStationData: stationData,
|
||||
setMapsStationData,
|
||||
} = useTrainMenu();
|
||||
const actionSheetRef = useRef(null);
|
||||
const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef);
|
||||
const insets = useSafeAreaInsets();
|
||||
const viewShot = useRef(null);
|
||||
const platformIs = Platform.OS == "android";
|
||||
return (
|
||||
<ActionSheet
|
||||
|
@ -16,12 +16,11 @@ import { getStationList } from "../lib/getStationList";
|
||||
import { getTrainType } from "../lib/getTrainType";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useTrainMenu } from "../stateBox/useTrainMenu";
|
||||
export default function AllTrainDiagramView() {
|
||||
const { navigate } = useNavigation();
|
||||
const { allTrainDiagram } = useAllTrainDiagram();
|
||||
const [originalStationList, setOriginalStationList] = useState(); // 第一要素
|
||||
const [keyList, setKeyList] = useState(); // 第二要素
|
||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
||||
useEffect(
|
||||
() => allTrainDiagram && setKeyList(Object.keys(allTrainDiagram)),
|
||||
[]
|
||||
@ -59,7 +58,6 @@ export default function AllTrainDiagramView() {
|
||||
}${TrainNumber}`,
|
||||
},
|
||||
navigate,
|
||||
originalStationList,
|
||||
from: "AllTrainDiagramView",
|
||||
};
|
||||
SheetManager.show("EachTrainInfo", {
|
||||
|
@ -1,20 +1,14 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React from "react";
|
||||
import {
|
||||
View,
|
||||
Platform,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
useWindowDimensions,
|
||||
LayoutAnimation,
|
||||
} from "react-native";
|
||||
import Constants from "expo-constants";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import * as Updates from "expo-updates";
|
||||
|
||||
import { AS, ASCore } from "../storageControl";
|
||||
import { news } from "../config/newsUpdate";
|
||||
import { getStationList, lineList } from "../lib/getStationList";
|
||||
import { injectJavascriptData } from "../lib/webViewInjectjavascript";
|
||||
import { lineList } from "../lib/getStationList";
|
||||
import { useCurrentTrain } from "../stateBox/useCurrentTrain";
|
||||
import { useDeviceOrientationChange } from "../stateBox/useDeviceOrientationChange";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
@ -24,6 +18,10 @@ import { EachTrainInfoCore } from "../components/ActionSheetComponents/EachTrain
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useTrainMenu } from "../stateBox/useTrainMenu";
|
||||
import { AppsWebView } from "./Apps/WebView";
|
||||
import { NewMenu } from "./Apps/NewMenu";
|
||||
import { MapsButton } from "./Apps/MapsButton";
|
||||
import { ReloadButton } from "./Apps/ReloadButton";
|
||||
import { LandscapeBackButton } from "./Apps/LandscapeBackButton";
|
||||
/*
|
||||
import StatusbarDetect from '../StatusbarDetect';
|
||||
var Status = StatusbarDetect(); */
|
||||
@ -36,53 +34,13 @@ export default function Apps() {
|
||||
const { navigate } = useNavigation();
|
||||
const { isLandscape } = useDeviceOrientationChange();
|
||||
const handleLayout = () => {};
|
||||
const { setInjectJavaScript, mapsStationData } = useTrainMenu();
|
||||
|
||||
//画面表示関連
|
||||
const [iconSetting, setIconSetting] = useState(undefined);
|
||||
const [mapSwitch, setMapSwitch] = useState(undefined);
|
||||
const [stationMenu, setStationMenu] = useState(undefined);
|
||||
const [LoadError, setLoadError] = useState(false);
|
||||
|
||||
//列車情報表示関連
|
||||
const [trainInfo, setTrainInfo] = useState({
|
||||
trainNum: undefined,
|
||||
limited: undefined,
|
||||
trainData: undefined,
|
||||
});
|
||||
|
||||
//駅情報画面用
|
||||
const [originalStationList, setOriginalStationList] = useState();
|
||||
const [trainMenu, setTrainMenu] = useState("true");
|
||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
||||
|
||||
//地図表示テキスト
|
||||
const injectJavascript = injectJavascriptData(
|
||||
const {
|
||||
setInjectJavaScript,
|
||||
mapSwitch,
|
||||
iconSetting,
|
||||
stationMenu,
|
||||
trainMenu
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
//ニュース表示
|
||||
AS.getItem("status")
|
||||
.then((d) => {
|
||||
if (d != news) navigate("news");
|
||||
})
|
||||
.catch(() => navigate("news"));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
//列車アイコンスイッチ
|
||||
ASCore({ k: "iconSwitch", s: setIconSetting, d: "true", u: true });
|
||||
//地図スイッチ
|
||||
ASCore({ k: "mapSwitch", s: setMapSwitch, d: "false", u: true });
|
||||
//駅メニュースイッチ
|
||||
ASCore({ k: "stationSwitch", s: setStationMenu, d: "true", u: true });
|
||||
//列車メニュースイッチ
|
||||
ASCore({ k: "trainSwitch", s: setTrainMenu, d: "true", u: true });
|
||||
}, []);
|
||||
trainInfo,
|
||||
setTrainInfo,
|
||||
originalStationList,
|
||||
} = useTrainMenu();
|
||||
|
||||
const openStationACFromEachTrainInfo = async (stationName) => {
|
||||
await SheetManager.hide("EachTrainInfo");
|
||||
@ -100,8 +58,7 @@ export default function Apps() {
|
||||
if (returnDataBase.length) {
|
||||
const payload = {
|
||||
currentStation: returnDataBase,
|
||||
originalStationList: originalStationList,
|
||||
navigate: navigate,
|
||||
navigate,
|
||||
goTo: "Apps",
|
||||
useShow: () => SheetManager.show("StationDetailView", { payload }),
|
||||
onExit: () => SheetManager.hide("StationDetailView"),
|
||||
@ -122,9 +79,6 @@ export default function Apps() {
|
||||
>
|
||||
{!trainInfo.trainNum && isLandscape ? (
|
||||
<TrainMenu
|
||||
webview={webview}
|
||||
stationData={mapsStationData}
|
||||
navigation={{ navigate: null }}
|
||||
style={{
|
||||
width: (width / 100) * 40,
|
||||
height: "100%",
|
||||
@ -134,12 +88,8 @@ export default function Apps() {
|
||||
) : null}
|
||||
{/* {Status} */}
|
||||
<AppsWebView
|
||||
originalStationList={originalStationList}
|
||||
{...{
|
||||
setLoadError,
|
||||
setTrainInfo,
|
||||
openStationACFromEachTrainInfo,
|
||||
injectJavascript,
|
||||
}}
|
||||
/>
|
||||
{isLandscape && trainInfo.trainNum && (
|
||||
@ -153,10 +103,8 @@ export default function Apps() {
|
||||
<EachTrainInfoCore
|
||||
{...{
|
||||
data: trainInfo.trainNum ? trainInfo : undefined,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
from: "Train",
|
||||
setTrainInfo,
|
||||
navigate,
|
||||
}}
|
||||
/>
|
||||
@ -168,7 +116,6 @@ export default function Apps() {
|
||||
setInjectJavaScript("");
|
||||
navigate("trainMenu", { webview });
|
||||
}}
|
||||
mapSwitch={mapSwitch == "true" ? "flex" : "none"}
|
||||
/>
|
||||
)}
|
||||
{isLandscape && trainInfo.trainNum && (
|
||||
@ -187,202 +134,10 @@ export default function Apps() {
|
||||
<ReloadButton
|
||||
onPress={() => Updates.reloadAsync()}
|
||||
right={isLandscape && trainInfo.trainNum ? (width / 100) * 40 : 0}
|
||||
LoadError={LoadError}
|
||||
/>
|
||||
) : (
|
||||
<NewMenu LoadError={LoadError} />
|
||||
<NewMenu />
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
const NewMenu = ({ LoadError }) => {
|
||||
const { webview } = useCurrentTrain();
|
||||
const { width } = useWindowDimensions();
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
position: "absolute",
|
||||
top,
|
||||
width,
|
||||
height: 54,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
flexDirection: "row",
|
||||
}}
|
||||
>
|
||||
<TouchableOpacity
|
||||
activeOpacity={1}
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 54,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRightWidth: 0,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
flexDirection: "row",
|
||||
}}
|
||||
onPress={() => {
|
||||
webview.current?.injectJavaScript(`AccordionClassEvent()`);
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<View
|
||||
style={{
|
||||
width: 54,
|
||||
height: 54,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="menu" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</View>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={{ color: "white", fontSize: 20 }}>メニュー</Text>
|
||||
<View style={{ flex: 1 }}></View>
|
||||
</>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
onPress={() => Updates.reloadAsync()}
|
||||
style={{
|
||||
width: 54,
|
||||
height: 54,
|
||||
backgroundColor: LoadError ? "red" : "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="reload" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
const MapsButton = ({ onPress, mapSwitch }) => {
|
||||
const styles = {
|
||||
touch: {
|
||||
position: "absolute",
|
||||
top,
|
||||
left: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
display: mapSwitch,
|
||||
},
|
||||
text: {
|
||||
textAlign: "center",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
textAlignVertical: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
fontSize: 20,
|
||||
},
|
||||
};
|
||||
return (
|
||||
<TouchableOpacity onPress={onPress} style={styles.touch}>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={styles.text}>≡</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
||||
const LandscapeBackButton = ({ onPress }) => {
|
||||
const styles = {
|
||||
touch: {
|
||||
position: "absolute",
|
||||
left: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
display: "flex",
|
||||
},
|
||||
text: {
|
||||
textAlign: "center",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
textAlignVertical: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
},
|
||||
};
|
||||
return (
|
||||
<TouchableOpacity onPress={onPress} style={styles.touch}>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="arrow-back" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
||||
const ReloadButton = ({ onPress, mapSwitch, LoadError = false, right }) => {
|
||||
const styles = {
|
||||
touch: {
|
||||
position: "absolute",
|
||||
top,
|
||||
right: 10 + right,
|
||||
width: 50,
|
||||
height: 50,
|
||||
backgroundColor: LoadError ? "red" : "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
display: mapSwitch,
|
||||
},
|
||||
text: {
|
||||
textAlign: "center",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
textAlignVertical: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
},
|
||||
};
|
||||
return (
|
||||
<TouchableOpacity onPress={onPress} style={styles.touch}>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="reload" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
48
components/Apps/LandscapeBackButton.tsx
Normal file
48
components/Apps/LandscapeBackButton.tsx
Normal file
@ -0,0 +1,48 @@
|
||||
import React, { FC } from "react";
|
||||
import {
|
||||
View,
|
||||
TouchableOpacity,
|
||||
TouchableOpacityProps,
|
||||
TextStyle,
|
||||
} from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
export const LandscapeBackButton: FC<{
|
||||
onPress: () => void;
|
||||
}> = ({ onPress }) => {
|
||||
type stylesType = {
|
||||
touch: TouchableOpacityProps["style"];
|
||||
text: TextStyle;
|
||||
};
|
||||
const styles: stylesType = {
|
||||
touch: {
|
||||
position: "absolute",
|
||||
left: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
display: "flex",
|
||||
},
|
||||
text: {
|
||||
textAlign: "center",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
textAlignVertical: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
},
|
||||
};
|
||||
return (
|
||||
<TouchableOpacity onPress={onPress} style={styles.touch}>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="arrow-back" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
58
components/Apps/MapsButton.tsx
Normal file
58
components/Apps/MapsButton.tsx
Normal file
@ -0,0 +1,58 @@
|
||||
import React, { FC } from "react";
|
||||
import {
|
||||
View,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
Platform,
|
||||
TouchableOpacityProps,
|
||||
TextStyle,
|
||||
} from "react-native";
|
||||
import Constants from "expo-constants";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
|
||||
const top = Platform.OS == "ios" ? Constants.statusBarHeight : 0;
|
||||
type MapsButtonProps = {
|
||||
onPress: () => void;
|
||||
};
|
||||
type stylesType = {
|
||||
touch: TouchableOpacityProps["style"];
|
||||
text: TextStyle;
|
||||
};
|
||||
|
||||
export const MapsButton: FC<MapsButtonProps> = ({ onPress }) => {
|
||||
const { mapSwitch } = useTrainMenu();
|
||||
const styles: stylesType = {
|
||||
touch: {
|
||||
position: "absolute",
|
||||
top,
|
||||
left: 10,
|
||||
width: 50,
|
||||
height: 50,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
display: mapSwitch == "true" ? "flex" : "none",
|
||||
},
|
||||
text: {
|
||||
textAlign: "center",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
textAlignVertical: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
fontSize: 20,
|
||||
},
|
||||
};
|
||||
return (
|
||||
<TouchableOpacity onPress={onPress} style={styles.touch}>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={styles.text}>≡</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
94
components/Apps/NewMenu.tsx
Normal file
94
components/Apps/NewMenu.tsx
Normal file
@ -0,0 +1,94 @@
|
||||
import React from "react";
|
||||
import { View, Text, TouchableOpacity, useWindowDimensions, Platform } from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import * as Updates from "expo-updates";
|
||||
import Constants from "expo-constants";
|
||||
import { useCurrentTrain } from "../../stateBox/useCurrentTrain";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
|
||||
const top = Platform.OS == "ios" ? Constants.statusBarHeight : 0;
|
||||
export const NewMenu = () => {
|
||||
const { webview } = useCurrentTrain();
|
||||
const { width } = useWindowDimensions();
|
||||
const { LoadError } = useTrainMenu();
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
position: "absolute",
|
||||
top,
|
||||
width,
|
||||
height: 54,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
flexDirection: "row",
|
||||
}}
|
||||
>
|
||||
<TouchableOpacity
|
||||
activeOpacity={1}
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 54,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRightWidth: 0,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
flexDirection: "row",
|
||||
}}
|
||||
onPress={() => {
|
||||
webview.current?.injectJavaScript(`AccordionClassEvent()`);
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<View
|
||||
style={{
|
||||
width: 54,
|
||||
height: 54,
|
||||
backgroundColor: "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="menu" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</View>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Text style={{ color: "white", fontSize: 20 }}>メニュー</Text>
|
||||
<View style={{ flex: 1 }}></View>
|
||||
</>
|
||||
</TouchableOpacity>
|
||||
|
||||
<TouchableOpacity
|
||||
onPress={() => Updates.reloadAsync()}
|
||||
style={{
|
||||
width: 54,
|
||||
height: 54,
|
||||
backgroundColor: LoadError ? "red" : "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="reload" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
};
|
58
components/Apps/ReloadButton.tsx
Normal file
58
components/Apps/ReloadButton.tsx
Normal file
@ -0,0 +1,58 @@
|
||||
import React, { FC } from "react";
|
||||
import {
|
||||
View,
|
||||
TouchableOpacity,
|
||||
Platform,
|
||||
TouchableOpacityProps,
|
||||
TextStyle,
|
||||
} from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import Constants from "expo-constants";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
const top = Platform.OS == "ios" ? Constants.statusBarHeight : 0;
|
||||
|
||||
type stylesType = {
|
||||
touch: TouchableOpacityProps["style"];
|
||||
text: TextStyle;
|
||||
};
|
||||
type ReloadButton = {
|
||||
onPress: () => void;
|
||||
right: number;
|
||||
|
||||
}
|
||||
export const ReloadButton:FC<ReloadButton> = ({ onPress, right }) => {
|
||||
const { mapSwitch, LoadError = false } = useTrainMenu();
|
||||
const styles: stylesType = {
|
||||
touch: {
|
||||
position: "absolute",
|
||||
top,
|
||||
right: 10 + right,
|
||||
width: 50,
|
||||
height: 50,
|
||||
backgroundColor: LoadError ? "red" : "#0099CC",
|
||||
borderColor: "white",
|
||||
borderStyle: "solid",
|
||||
borderWidth: 1,
|
||||
borderRadius: 50,
|
||||
alignContent: "center",
|
||||
alignSelf: "center",
|
||||
alignItems: "center",
|
||||
display: mapSwitch,
|
||||
},
|
||||
text: {
|
||||
textAlign: "center",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
textAlignVertical: "center",
|
||||
fontWeight: "bold",
|
||||
color: "white",
|
||||
},
|
||||
};
|
||||
return (
|
||||
<TouchableOpacity onPress={onPress} style={styles.touch}>
|
||||
<View style={{ flex: 1 }} />
|
||||
<Ionicons name="reload" color="white" size={30} />
|
||||
<View style={{ flex: 1 }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
@ -12,18 +12,19 @@ import { SheetManager } from "react-native-actions-sheet";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
import { stationNamePair } from "../../lib/getStationList2";
|
||||
export const AppsWebView = ({
|
||||
originalStationList,
|
||||
setLoadError,
|
||||
setTrainInfo,
|
||||
openStationACFromEachTrainInfo,
|
||||
injectJavascript,
|
||||
}) => {
|
||||
export const AppsWebView = ({ openStationACFromEachTrainInfo }) => {
|
||||
const { webview, currentTrain } = useCurrentTrain();
|
||||
const { navigate } = useNavigation();
|
||||
const { favoriteStation } = useFavoriteStation();
|
||||
const { isLandscape } = useDeviceOrientationChange();
|
||||
const { setSelectedLine, mapsStationData: stationData } = useTrainMenu();
|
||||
const {
|
||||
setSelectedLine,
|
||||
mapsStationData: stationData,
|
||||
setLoadError,
|
||||
setTrainInfo,
|
||||
originalStationList,
|
||||
injectJavascript,
|
||||
} = useTrainMenu();
|
||||
var urlcache = "";
|
||||
let once = false;
|
||||
|
||||
@ -76,7 +77,6 @@ export const AppsWebView = ({
|
||||
if (returnDataBase.length) {
|
||||
const payload = {
|
||||
currentStation: returnDataBase,
|
||||
originalStationList: originalStationList,
|
||||
navigate: navigate,
|
||||
goTo: "Apps",
|
||||
useShow: () =>
|
||||
@ -102,7 +102,6 @@ export const AppsWebView = ({
|
||||
const payload = {
|
||||
data: { trainNum, limited },
|
||||
navigate,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
};
|
||||
SheetManager.show("EachTrainInfo", { payload });
|
||||
|
@ -50,7 +50,6 @@ export default function LED_vision(props) {
|
||||
trainDiagram,
|
||||
getCurrentTrain,
|
||||
navigate,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
} = props;
|
||||
const { currentTrain } = useCurrentTrain();
|
||||
@ -207,7 +206,6 @@ export default function LED_vision(props) {
|
||||
trainDescriptionSwitch,
|
||||
customTrainDataDetector,
|
||||
navigate,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
}}
|
||||
station={station[0]}
|
||||
@ -235,8 +233,6 @@ export default function LED_vision(props) {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const EachData = (props) => {
|
||||
const {
|
||||
d,
|
||||
@ -245,7 +241,6 @@ const EachData = (props) => {
|
||||
station,
|
||||
customTrainDataDetector,
|
||||
navigate,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
} = props;
|
||||
const { currentTrain } = useCurrentTrain();
|
||||
@ -265,7 +260,6 @@ const EachData = (props) => {
|
||||
}${TrainNumber}`,
|
||||
},
|
||||
navigate,
|
||||
originalStationList,
|
||||
openStationACFromEachTrainInfo,
|
||||
from: "LED",
|
||||
};
|
||||
|
42
components/駅名表/AddressText.tsx
Normal file
42
components/駅名表/AddressText.tsx
Normal file
@ -0,0 +1,42 @@
|
||||
import React, { FC, useEffect } from "react";
|
||||
import { Platform, Text } from "react-native";
|
||||
import { useFavoriteStation } from "../../stateBox/useFavoriteStation";
|
||||
type Props = {
|
||||
currentStation: any[];
|
||||
isMatsuyama: boolean;
|
||||
};
|
||||
export const AddressText: FC<Props> = (props) => {
|
||||
const { currentStation, isMatsuyama } = props;
|
||||
const {lodAddMigration} = useFavoriteStation();
|
||||
const [stationAddress, setStationAddress] = React.useState("");
|
||||
useEffect(() => {
|
||||
if (!!currentStation[0].jslodApi) {
|
||||
fetch(`${currentStation[0].jslodApi}.json`)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const c =
|
||||
data[currentStation[0].jslodApi][
|
||||
"http://dbpedia.org/ontology/address"
|
||||
][0]["value"];
|
||||
setStationAddress(c);
|
||||
});
|
||||
}else{
|
||||
lodAddMigration();
|
||||
}
|
||||
}, [currentStation]);
|
||||
return (
|
||||
<Text
|
||||
style={{
|
||||
fontSize: parseInt("10%"),
|
||||
color: isMatsuyama ? "white" : "#005170",
|
||||
position: "absolute",
|
||||
bottom: isMatsuyama ? Platform.OS === "ios"?"25.5%":"26.5%" : "0%",
|
||||
textAlign: "center",
|
||||
width: "100%",
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
{stationAddress}
|
||||
</Text>
|
||||
);
|
||||
};
|
@ -88,7 +88,7 @@ const 下枠左右マーク: TextStyle = {
|
||||
fontWeight: "bold",
|
||||
fontSize: parseInt("20%"),
|
||||
color: "white",
|
||||
paddingHorizontal: 10,
|
||||
paddingHorizontal: 5,
|
||||
textAlignVertical: "center",
|
||||
};
|
||||
const 下枠駅ナンバー: ViewStyle = {
|
||||
|
@ -11,17 +11,14 @@ import { StationNameArea } from "./StationNameArea";
|
||||
import { StationNumberMaker } from "./StationNumberMaker";
|
||||
import { NextPreStationLine } from "./NextPreStationLine";
|
||||
import { LottieDelayView } from "./LottieDelayView";
|
||||
import { AddressText } from "./AddressText";
|
||||
import { useTrainMenu } from "../../stateBox/useTrainMenu";
|
||||
|
||||
export default function Sign(props) {
|
||||
const {
|
||||
currentStation,
|
||||
originalStationList,
|
||||
oP,
|
||||
oLP,
|
||||
isCurrentStation = false,
|
||||
} = props;
|
||||
const { currentStation, oP, oLP, isCurrentStation = false } = props;
|
||||
const { favoriteStation, setFavoriteStation } = useFavoriteStation();
|
||||
const [nexPrePosition, setNexPrePosition] = useState(0);
|
||||
const { originalStationList } = useTrainMenu();
|
||||
|
||||
const [preStation, setPreStation] = useState();
|
||||
const [nexStation, setNexStation] = useState();
|
||||
@ -166,6 +163,7 @@ export default function Sign(props) {
|
||||
<View style={styleSheet[isMatsuyama ? "下帯内容B" : "下帯内容"]}>
|
||||
<NextPreStationLine {...{ nexStation, preStation, isMatsuyama }} />
|
||||
</View>
|
||||
<AddressText {...{ currentStation, isMatsuyama }} />
|
||||
</TouchableOpacity>
|
||||
);
|
||||
}
|
||||
@ -185,10 +183,10 @@ const styleSheet = {
|
||||
},
|
||||
下帯: {
|
||||
position: "absolute",
|
||||
bottom: "0%",
|
||||
bottom: "8%",
|
||||
left: "0%",
|
||||
width: "100%",
|
||||
height: "30%",
|
||||
height: "27%",
|
||||
backgroundColor: "#0099CC",
|
||||
},
|
||||
下帯B: {
|
||||
@ -196,7 +194,7 @@ const styleSheet = {
|
||||
bottom: "0%",
|
||||
left: "0%",
|
||||
width: "100%",
|
||||
height: "25%",
|
||||
height: "26%",
|
||||
backgroundColor: "#454545",
|
||||
},
|
||||
JRStyle: {
|
||||
@ -209,8 +207,8 @@ const styleSheet = {
|
||||
},
|
||||
下帯内容: {
|
||||
position: "absolute",
|
||||
bottom: "0%",
|
||||
height: "30%",
|
||||
bottom: "8%",
|
||||
height: "27%",
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
flexDirection: "column",
|
||||
@ -218,7 +216,7 @@ const styleSheet = {
|
||||
下帯内容B: {
|
||||
position: "absolute",
|
||||
bottom: "0%",
|
||||
height: "25%",
|
||||
height: "26%",
|
||||
width: "100%",
|
||||
alignItems: "center",
|
||||
flexDirection: "column",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { FC } from "react";
|
||||
import { Text, TextStyle, View } from "react-native";
|
||||
import { Platform, Text, TextStyle, View } from "react-native";
|
||||
export const StationName: FC<{
|
||||
stringData: { Station_JP: string; Station_EN: string };
|
||||
ss: TextStyle;
|
||||
@ -15,7 +15,7 @@ export const StationName: FC<{
|
||||
|
||||
const styleSheet: TextStyle = {
|
||||
fontWeight: "bold",
|
||||
fontSize: parseInt("15%"),
|
||||
fontSize: Platform.OS === "ios" ? parseInt("14%") : parseInt("15%"),
|
||||
color: "white",
|
||||
flex: 1,
|
||||
textAlignVertical: "center",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { CSSProperties } from "react";
|
||||
import { Text, TextStyle, View, ViewStyle } from "react-native";
|
||||
import { Platform, Text, TextStyle, View, ViewStyle } from "react-native";
|
||||
|
||||
export const StationNameArea = (props) => {
|
||||
const { currentStation, isMatsuyama } = props;
|
||||
@ -14,6 +14,8 @@ export const StationNameArea = (props) => {
|
||||
};
|
||||
const Station_JP: TextStyle = {
|
||||
letterSpacing: currentStation[0].Station_JP.length < 4 ? 15 : 0,
|
||||
// iOSの場合、letterSPacingで末尾の文字の後ろにもpaddingが入るため、paddingLeftを設定
|
||||
paddingLeft: currentStation[0].Station_JP.length < 4 &&Platform.OS === "ios" ? 15 : 0,
|
||||
fontWeight: "bold",
|
||||
fontSize: parseInt(currentStation[0].Station_JP.length < 6 ? "40%" : "25%"),
|
||||
|
||||
|
@ -116,6 +116,7 @@ export const getStationList = async (props) => {
|
||||
if (element.properties.name == stationName) {
|
||||
data.lat = element.geometry.coordinates[1];
|
||||
data.lng = element.geometry.coordinates[0];
|
||||
data.jslodApi = element.properties.uri;
|
||||
}
|
||||
});
|
||||
return data;
|
||||
@ -182,6 +183,7 @@ export const getStationList = async (props) => {
|
||||
JrHpUrl: "http://www.jr-shikoku.co.jp/01_trainbus/kakueki/sakaide/",
|
||||
lat: 34.313222,
|
||||
lng: 133.856325,
|
||||
jslodApi: "https://uedayou.net/jrslod/四国旅客鉄道/予讃線/坂出",
|
||||
},
|
||||
|
||||
{
|
||||
@ -196,6 +198,7 @@ export const getStationList = async (props) => {
|
||||
JrHpUrl: "http://www.jr-odekake.net/eki/top.php?id=0651304",
|
||||
lat: 34.462562,
|
||||
lng: 133.807809,
|
||||
jslodApi: "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線/児島",
|
||||
},
|
||||
{
|
||||
Station_JP: "宇多津",
|
||||
@ -209,6 +212,7 @@ export const getStationList = async (props) => {
|
||||
JrHpUrl: "http://www.jr-shikoku.co.jp/01_trainbus/kakueki/utazu/",
|
||||
lat: 34.306379,
|
||||
lng: 133.813784,
|
||||
jslodApi: "https://uedayou.net/jrslod/四国旅客鉄道/本四備讃線/宇多津",
|
||||
},
|
||||
];
|
||||
status = stationList;
|
||||
|
10
menu.js
10
menu.js
@ -30,10 +30,12 @@ import { useFavoriteStation } from "./stateBox/useFavoriteStation";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { useTrainDelayData } from "./stateBox/useTrainDelayData";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { useTrainMenu } from "./stateBox/useTrainMenu";
|
||||
|
||||
export default function Menu({ getCurrentTrain }) {
|
||||
const { navigate } = useNavigation();
|
||||
const { favoriteStation } = useFavoriteStation();
|
||||
const { originalStationList } = useTrainMenu();
|
||||
|
||||
//位置情報
|
||||
const [locationStatus, setLocationStatus] = useState(null);
|
||||
@ -90,9 +92,6 @@ export default function Menu({ getCurrentTrain }) {
|
||||
|
||||
const [currentStation, setCurrentStation] = useState(undefined); //第三要素
|
||||
|
||||
const [originalStationList, setOriginalStationList] = useState([]); // 第一要素
|
||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
||||
|
||||
const carouselRef = useRef();
|
||||
const [selectedCurrentStation, setSelectedCurrentStation] = useState(0);
|
||||
|
||||
@ -171,7 +170,6 @@ export default function Menu({ getCurrentTrain }) {
|
||||
>
|
||||
<Sign
|
||||
currentStation={item}
|
||||
originalStationList={originalStationList}
|
||||
isCurrentStation={item == currentStation}
|
||||
oP={() => {
|
||||
const payload = {
|
||||
@ -179,7 +177,6 @@ export default function Menu({ getCurrentTrain }) {
|
||||
originalStationList &&
|
||||
allStationData.length != 0 &&
|
||||
allStationData[selectedCurrentStation],
|
||||
originalStationList: originalStationList,
|
||||
navigate: navigate,
|
||||
goTo: "menu",
|
||||
useShow: () =>
|
||||
@ -210,7 +207,6 @@ export default function Menu({ getCurrentTrain }) {
|
||||
trainDiagram={trainDiagram}
|
||||
getCurrentTrain={getCurrentTrain}
|
||||
navigate={navigate}
|
||||
originalStationList={originalStationList}
|
||||
openStationACFromEachTrainInfo={() => {}}
|
||||
/>
|
||||
)}
|
||||
@ -266,9 +262,7 @@ const TopMenuButton = () => {
|
||||
const JRSTraInfoBox = () => {
|
||||
const {
|
||||
getTime,
|
||||
setGetTime,
|
||||
delayData,
|
||||
setDelayData,
|
||||
loadingDelayData,
|
||||
setLoadingDelayData,
|
||||
} = useTrainDelayData();
|
||||
|
@ -6,9 +6,11 @@ import React, {
|
||||
useLayoutEffect,
|
||||
} from "react";
|
||||
import { AS } from "../storageControl";
|
||||
import { useStationList } from "./useStationList";
|
||||
const initialState = {
|
||||
favoriteStation: [],
|
||||
setFavoriteStation: () => {},
|
||||
lodAddMigration: () => {},
|
||||
};
|
||||
|
||||
const FavoriteStationContext = createContext(initialState);
|
||||
@ -19,6 +21,13 @@ export const useFavoriteStation = () => {
|
||||
|
||||
export const FavoriteStationProvider = ({ children }) => {
|
||||
const [favoriteStation, setFavoriteStation] = useState([]);
|
||||
const { getStationData } = useStationList();
|
||||
const lodAddMigration = () => {
|
||||
const migration = favoriteStation.map((d) => {
|
||||
return getStationData(d[0].Station_JP);
|
||||
});
|
||||
setFavoriteStation(migration);
|
||||
};
|
||||
useEffect(() => {
|
||||
AS.getItem("favoriteStation")
|
||||
.then((d) => {
|
||||
@ -29,7 +38,7 @@ export const FavoriteStationProvider = ({ children }) => {
|
||||
}, []);
|
||||
return (
|
||||
<FavoriteStationContext.Provider
|
||||
value={{ favoriteStation, setFavoriteStation }}
|
||||
value={{ favoriteStation, setFavoriteStation, lodAddMigration }}
|
||||
>
|
||||
{children}
|
||||
</FavoriteStationContext.Provider>
|
||||
|
56
stateBox/useStationList.tsx
Normal file
56
stateBox/useStationList.tsx
Normal file
@ -0,0 +1,56 @@
|
||||
import React, {
|
||||
createContext,
|
||||
useContext,
|
||||
useState,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
FC,
|
||||
} from "react";
|
||||
import { AS } from "../storageControl";
|
||||
import { getStationList } from "../lib/getStationList";
|
||||
|
||||
type initialStateType = {
|
||||
originalStationList: any[];
|
||||
setOriginalStationList: React.Dispatch<React.SetStateAction<any[]>>;
|
||||
getStationData: (id: string) => void;
|
||||
};
|
||||
const initialState = {
|
||||
originalStationList: [],
|
||||
setOriginalStationList: () => {},
|
||||
getStationData: () => {},
|
||||
};
|
||||
|
||||
const StationListContext = createContext<initialStateType>(initialState);
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
export const useStationList = () => {
|
||||
return useContext(StationListContext);
|
||||
};
|
||||
|
||||
export const StationListProvider: FC<Props> = ({ children }) => {
|
||||
const [originalStationList, setOriginalStationList] = useState<any[]>([]);
|
||||
useEffect(() => {
|
||||
getStationList().then(setOriginalStationList);
|
||||
}, []);
|
||||
const getStationData: (name: string) => void = (name) => {
|
||||
const returnArray = [];
|
||||
Object.keys(originalStationList).forEach((key) => {
|
||||
originalStationList[key].forEach((station) => {
|
||||
if (station.Station_JP === name) {
|
||||
if(!!station.jslodApi)returnArray.push(station);
|
||||
}
|
||||
});
|
||||
});
|
||||
return returnArray;
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
<StationListContext.Provider
|
||||
value={{ originalStationList, setOriginalStationList, getStationData }}
|
||||
>
|
||||
{children}
|
||||
</StationListContext.Provider>
|
||||
);
|
||||
};
|
@ -1,4 +1,11 @@
|
||||
import React, { createContext, useContext, useState } from "react";
|
||||
import React, { createContext, useContext, useState, useEffect } from "react";
|
||||
|
||||
import { AS, ASCore } from "../storageControl";
|
||||
|
||||
import { getStationList } from "../lib/getStationList";
|
||||
import { getStationList2 } from "../lib/getStationList2";
|
||||
import { injectJavascriptData } from "../lib/webViewInjectjavascript";
|
||||
|
||||
const initialState = {
|
||||
selectedLine: undefined,
|
||||
setSelectedLine: () => {},
|
||||
@ -6,6 +13,25 @@ const initialState = {
|
||||
setMapsStationData: () => {},
|
||||
injectJavaScript: "",
|
||||
setInjectJavaScript: () => {},
|
||||
iconSetting: undefined,
|
||||
setIconSetting: () => {},
|
||||
mapSwitch: undefined,
|
||||
setMapSwitch: () => {},
|
||||
stationMenu: undefined,
|
||||
setStationMenu: () => {},
|
||||
LoadError: false,
|
||||
setLoadError: () => {},
|
||||
trainInfo: {
|
||||
trainNum: undefined,
|
||||
limited: undefined,
|
||||
trainData: undefined,
|
||||
},
|
||||
setTrainInfo: () => {},
|
||||
originalStationList: [],
|
||||
setOriginalStationList: () => {},
|
||||
trainMenu: "true",
|
||||
setTrainMenu: () => {},
|
||||
injectJavascript: "",
|
||||
};
|
||||
|
||||
const TrainMenuContext = createContext(initialState);
|
||||
@ -18,6 +44,58 @@ export const TrainMenuProvider = ({ children }) => {
|
||||
const [selectedLine, setSelectedLine] = useState(undefined);
|
||||
const [mapsStationData, setMapsStationData] = useState(undefined);
|
||||
const [injectJavaScript, setInjectJavaScript] = useState();
|
||||
|
||||
useEffect(() => getStationList2().then(setMapsStationData), []);
|
||||
|
||||
//画面表示関連
|
||||
const [iconSetting, setIconSetting] = useState(undefined);
|
||||
const [mapSwitch, setMapSwitch] = useState(undefined);
|
||||
const [stationMenu, setStationMenu] = useState(undefined);
|
||||
const [LoadError, setLoadError] = useState(false);
|
||||
|
||||
//列車情報表示関連
|
||||
const [trainInfo, setTrainInfo] = useState({
|
||||
trainNum: undefined,
|
||||
limited: undefined,
|
||||
trainData: undefined,
|
||||
});
|
||||
|
||||
//駅情報画面用
|
||||
const [originalStationList, setOriginalStationList] = useState([]);
|
||||
const [trainMenu, setTrainMenu] = useState("true");
|
||||
useEffect(() => getStationList().then(setOriginalStationList), []);
|
||||
|
||||
//地図表示テキスト
|
||||
const injectJavascript = injectJavascriptData(
|
||||
mapSwitch,
|
||||
iconSetting,
|
||||
stationMenu,
|
||||
trainMenu
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
getStationList2().then(setMapsStationData);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
//ニュース表示
|
||||
AS.getItem("status")
|
||||
.then((d) => {
|
||||
if (d != news) navigate("news");
|
||||
})
|
||||
.catch(() => navigate("news"));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
//列車アイコンスイッチ
|
||||
ASCore({ k: "iconSwitch", s: setIconSetting, d: "true", u: true });
|
||||
//地図スイッチ
|
||||
ASCore({ k: "mapSwitch", s: setMapSwitch, d: "false", u: true });
|
||||
//駅メニュースイッチ
|
||||
ASCore({ k: "stationSwitch", s: setStationMenu, d: "true", u: true });
|
||||
//列車メニュースイッチ
|
||||
ASCore({ k: "trainSwitch", s: setTrainMenu, d: "true", u: true });
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<TrainMenuContext.Provider
|
||||
@ -28,6 +106,21 @@ export const TrainMenuProvider = ({ children }) => {
|
||||
setMapsStationData,
|
||||
injectJavaScript,
|
||||
setInjectJavaScript,
|
||||
iconSetting,
|
||||
setIconSetting,
|
||||
mapSwitch,
|
||||
setMapSwitch,
|
||||
stationMenu,
|
||||
setStationMenu,
|
||||
LoadError,
|
||||
setLoadError,
|
||||
trainInfo,
|
||||
setTrainInfo,
|
||||
originalStationList,
|
||||
setOriginalStationList,
|
||||
trainMenu,
|
||||
setTrainMenu,
|
||||
injectJavascript,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
Loading…
Reference in New Issue
Block a user