Merge commit 'd36195df697d4ba9f356c0c9840f1af494eda2e4' into develop
This commit is contained in:
1
Apps.js
1
Apps.js
@@ -28,6 +28,7 @@ export function AppContainer() {
|
|||||||
"JR-Nishi": require("./assets/fonts/jr-nishi.otf"),
|
"JR-Nishi": require("./assets/fonts/jr-nishi.otf"),
|
||||||
Zou: require("./assets/fonts/DelaGothicOne-Regular.ttf"),
|
Zou: require("./assets/fonts/DelaGothicOne-Regular.ttf"),
|
||||||
"JNR-font": require("./assets/fonts/JNRfont_pict.ttf"),
|
"JNR-font": require("./assets/fonts/JNRfont_pict.ttf"),
|
||||||
|
"DiaPro": require("./assets/fonts/DiaPro-Regular.otf"),
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<NavigationContainer ref={navigationRef}>
|
<NavigationContainer ref={navigationRef}>
|
||||||
|
BIN
assets/fonts/DiaPro-Regular.otf
Normal file
BIN
assets/fonts/DiaPro-Regular.otf
Normal file
Binary file not shown.
@@ -135,11 +135,11 @@ export const StationDeteilView = (props) => {
|
|||||||
onExit={onExit}
|
onExit={onExit}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{updatePermission &&<StationDiagramButton
|
<StationDiagramButton
|
||||||
navigate={navigate}
|
navigate={navigate}
|
||||||
onExit={onExit}
|
onExit={onExit}
|
||||||
currentStation={currentStation}
|
currentStation={currentStation}
|
||||||
/>}
|
/>
|
||||||
{!currentStation[0].StationTimeTable || (
|
{!currentStation[0].StationTimeTable || (
|
||||||
<StationTimeTableButton
|
<StationTimeTableButton
|
||||||
info={info}
|
info={info}
|
||||||
|
@@ -13,7 +13,7 @@ import {
|
|||||||
ScrollView,
|
ScrollView,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { getTrainType } from "@/lib/getTrainType";
|
import { getTrainType } from "@/lib/getTrainType";
|
||||||
import { trainPosition } from "@/lib/trainPositionTextArray";
|
import { trainDataType, trainPosition } from "@/lib/trainPositionTextArray";
|
||||||
import { StationNumberMaker } from "@/components/駅名表/StationNumberMaker";
|
import { StationNumberMaker } from "@/components/駅名表/StationNumberMaker";
|
||||||
import { lineListPair, stationIDPair } from "@/lib/getStationList";
|
import { lineListPair, stationIDPair } from "@/lib/getStationList";
|
||||||
import { findReversalPoints } from "@/lib/eachTrainInfoCoreLib/findReversalPoints";
|
import { findReversalPoints } from "@/lib/eachTrainInfoCoreLib/findReversalPoints";
|
||||||
@@ -42,16 +42,7 @@ export const FixedTrain: FC<props> = ({
|
|||||||
} = useCurrentTrain();
|
} = useCurrentTrain();
|
||||||
const { allCustomTrainData, allTrainDiagram } = useAllTrainDiagram();
|
const { allCustomTrainData, allTrainDiagram } = useAllTrainDiagram();
|
||||||
|
|
||||||
const [train, setTrain] = useState<{
|
const [train, setTrain] = useState<trainDataType>(null);
|
||||||
Pos?: string;
|
|
||||||
Direction?: number;
|
|
||||||
Index?: number;
|
|
||||||
Line?: string;
|
|
||||||
PosNum?: number;
|
|
||||||
Type?: string;
|
|
||||||
delay?: string | number;
|
|
||||||
num?: string;
|
|
||||||
}>(null);
|
|
||||||
const [customData, setCustomData] = useState<CustomTrainData>(
|
const [customData, setCustomData] = useState<CustomTrainData>(
|
||||||
getCurrentTrainData(trainID, currentTrain, allCustomTrainData)
|
getCurrentTrainData(trainID, currentTrain, allCustomTrainData)
|
||||||
);
|
);
|
||||||
|
@@ -1,17 +1,17 @@
|
|||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { ListViewItem } from "@/components/StationDiagram/ListViewItem";
|
import { ListViewItem } from "@/components/StationDiagram/ListViewItem";
|
||||||
import { View, Text, ScrollView } from "react-native";
|
import { View, Text, ScrollView } from "react-native";
|
||||||
|
type hoge = {
|
||||||
export const ListView: FC<{
|
|
||||||
data: {
|
|
||||||
trainNumber: string;
|
trainNumber: string;
|
||||||
array: string;
|
array: string;
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
timeType: string;
|
||||||
time: string;
|
time: string;
|
||||||
}[];
|
};
|
||||||
|
export const ListView: FC<{
|
||||||
|
data: hoge[];
|
||||||
}> = ({ data }) => {
|
}> = ({ data }) => {
|
||||||
const groupedData = {};
|
const groupedData: Record<string, hoge[]> = {};
|
||||||
const groupKeys = [];
|
const groupKeys = [];
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
const hour = item.time.split(":")[0];
|
const hour = item.time.split(":")[0];
|
||||||
|
@@ -11,13 +11,16 @@ import { useNavigation } from "@react-navigation/native";
|
|||||||
import { lineList } from "@/lib/getStationList";
|
import { lineList } from "@/lib/getStationList";
|
||||||
import { useStationList } from "@/stateBox/useStationList";
|
import { useStationList } from "@/stateBox/useStationList";
|
||||||
import { CustomTrainData, trainTypeID } from "@/lib/CommonTypes";
|
import { CustomTrainData, trainTypeID } from "@/lib/CommonTypes";
|
||||||
|
import { StationNumberMaker } from "../駅名表/StationNumberMaker";
|
||||||
|
import { getStationID } from "@/lib/eachTrainInfoCoreLib/getStationData";
|
||||||
|
import lineColorList from "@/assets/originData/lineColorList";
|
||||||
|
|
||||||
export const ListViewItem: FC<{
|
export const ListViewItem: FC<{
|
||||||
d: {
|
d: {
|
||||||
trainNumber: string;
|
trainNumber: string;
|
||||||
array: string;
|
array: string;
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
timeType: string;
|
||||||
time: string;
|
time: string;
|
||||||
};
|
};
|
||||||
}> = ({ d }) => {
|
}> = ({ d }) => {
|
||||||
@@ -33,9 +36,13 @@ export const ListViewItem: FC<{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
const { color, name, data } = getTrainType({ type: trainData?.type, whiteMode: true });
|
const { color, name, data } = getTrainType({
|
||||||
const { originalStationList } = useStationList();
|
type: trainData?.type,
|
||||||
|
whiteMode: true,
|
||||||
|
});
|
||||||
// 列車名、種別、フォントの取得
|
// 列車名、種別、フォントの取得
|
||||||
|
const { getStationDataFromName, stationList, originalStationList } =
|
||||||
|
useStationList();
|
||||||
const [
|
const [
|
||||||
typeString,
|
typeString,
|
||||||
trainName,
|
trainName,
|
||||||
@@ -45,7 +52,7 @@ export const ListViewItem: FC<{
|
|||||||
isEdit,
|
isEdit,
|
||||||
uwasa,
|
uwasa,
|
||||||
vehicleFormation,
|
vehicleFormation,
|
||||||
trainInfoUrl,
|
trainInfoUrl,lineColor
|
||||||
] = useMemo(() => {
|
] = useMemo(() => {
|
||||||
const {
|
const {
|
||||||
type,
|
type,
|
||||||
@@ -62,6 +69,11 @@ export const ListViewItem: FC<{
|
|||||||
d.trainNumber
|
d.trainNumber
|
||||||
);
|
);
|
||||||
const trainData = d.array.split("#").filter((d) => d !== "");
|
const trainData = d.array.split("#").filter((d) => d !== "");
|
||||||
|
const station = getStationDataFromName(trainData[trainData.length - 1].split(",")[0]);
|
||||||
|
const lineColor =
|
||||||
|
station.length > 0
|
||||||
|
? lineColorList[station[0]?.StationNumber.slice(0, 1)]
|
||||||
|
: "black";
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case trainData[trainData.length - 1] === undefined:
|
case trainData[trainData.length - 1] === undefined:
|
||||||
return [
|
return [
|
||||||
@@ -73,7 +85,7 @@ export const ListViewItem: FC<{
|
|||||||
isEdit,
|
isEdit,
|
||||||
uwasa,
|
uwasa,
|
||||||
vehicleFormation,
|
vehicleFormation,
|
||||||
trainInfoUrl,
|
trainInfoUrl,lineColor
|
||||||
];
|
];
|
||||||
default:
|
default:
|
||||||
// 行先がある場合は、行先を取得
|
// 行先がある場合は、行先を取得
|
||||||
@@ -88,7 +100,7 @@ export const ListViewItem: FC<{
|
|||||||
isEdit,
|
isEdit,
|
||||||
uwasa,
|
uwasa,
|
||||||
vehicleFormation,
|
vehicleFormation,
|
||||||
trainInfoUrl,
|
trainInfoUrl,lineColor
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}, [d.array]);
|
}, [d.array]);
|
||||||
@@ -118,7 +130,7 @@ export const ListViewItem: FC<{
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
useShow: () => SheetManager.show("StationDetailView", { payload }),
|
useShow: () => SheetManager.show("StationDetailView", { payload }),
|
||||||
onExit: () => SheetManager.hide("StationDetailView"),
|
onExit: () => SheetManager.hide("StationDetailView"),
|
||||||
};//@ts-ignore
|
}; //@ts-ignore
|
||||||
setTimeout(() => SheetManager.show("StationDetailView", { payload }), 50);
|
setTimeout(() => SheetManager.show("StationDetailView", { payload }), 50);
|
||||||
} else {
|
} else {
|
||||||
SheetManager.hide("StationDetailView");
|
SheetManager.hide("StationDetailView");
|
||||||
@@ -159,12 +171,14 @@ export const ListViewItem: FC<{
|
|||||||
borderStyle: "solid",
|
borderStyle: "solid",
|
||||||
borderColor: "darkgray",
|
borderColor: "darkgray",
|
||||||
padding: 10,
|
padding: 10,
|
||||||
opacity: d.type.includes("通") ? 0.5 : 1,
|
opacity: d.timeType?.includes("通") ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
onPress={() => openTrainInfo()}
|
onPress={() => openTrainInfo()}
|
||||||
>
|
>
|
||||||
<View style={{ position: "relative" }}>
|
<View style={{ position: "relative", flex: 3 }}>
|
||||||
<Text style={{ fontSize: 30 }}>{formattedTime}</Text>
|
<Text style={{ fontSize: 30, fontFamily: "DiaPro" }}>
|
||||||
|
{formattedTime}
|
||||||
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
@@ -174,10 +188,10 @@ export const ListViewItem: FC<{
|
|||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{d.type}
|
{d.timeType}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 1, flexDirection: "column" }}>
|
<View style={{ flex: 10, flexDirection: "column" }}>
|
||||||
<View style={{ flexDirection: "row" }}>
|
<View style={{ flexDirection: "row" }}>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
@@ -214,17 +228,20 @@ export const ListViewItem: FC<{
|
|||||||
{trainData?.TrainNumber}
|
{trainData?.TrainNumber}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
<View style={{ flexDirection: "row", alignItems: "center", flex: 1 }}>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
paddingHorizontal: 10,
|
paddingHorizontal: 10,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
|
color: lineColor
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{trainName}
|
{trainName}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
164
components/StationDiagram/SearchBox/SearchInputSuggestBox.tsx
Normal file
164
components/StationDiagram/SearchBox/SearchInputSuggestBox.tsx
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
import lineColorList from "@/assets/originData/lineColorList";
|
||||||
|
import { useStationList } from "@/stateBox/useStationList";
|
||||||
|
import { FC, useEffect, useState } from "react";
|
||||||
|
import {
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
ScrollView,
|
||||||
|
TouchableOpacity,
|
||||||
|
LayoutAnimation,
|
||||||
|
} from "react-native";
|
||||||
|
|
||||||
|
type hoge = {
|
||||||
|
trainNumber: string;
|
||||||
|
array: string;
|
||||||
|
name: string;
|
||||||
|
timeType: string;
|
||||||
|
time: string;
|
||||||
|
}[];
|
||||||
|
|
||||||
|
export const SearchInputSuggestBox: FC<{
|
||||||
|
input: string;
|
||||||
|
setInput: (f: string) => void;
|
||||||
|
currentStationDiagram: hoge;
|
||||||
|
}> = ({ input, setInput, currentStationDiagram }) => {
|
||||||
|
const { getStationDataFromName } = useStationList();
|
||||||
|
const [stationList, setStationList] = useState<
|
||||||
|
{
|
||||||
|
stationName: string;
|
||||||
|
number: string[];
|
||||||
|
}[]
|
||||||
|
>([]);
|
||||||
|
const [listFiltered, setListFiltered] = useState<string>("");
|
||||||
|
const [filteredStationLine, setFilteredStationLine] = useState<string[]>([]);
|
||||||
|
useEffect(() => {
|
||||||
|
const x: { stationName: string; number: string[] }[] = [];
|
||||||
|
currentStationDiagram.forEach((d) => {
|
||||||
|
d.array.split("#").forEach((s) => {
|
||||||
|
if (s == "") return;
|
||||||
|
const [stationName, type, time] = s.split(",");
|
||||||
|
if (!x.find((item) => item.stationName === stationName)) {
|
||||||
|
if (!type?.includes("通")) {
|
||||||
|
const stationData = getStationDataFromName(stationName);
|
||||||
|
if (listFiltered === "その他") {
|
||||||
|
if (stationData.length === 0) {
|
||||||
|
x.push({
|
||||||
|
stationName,
|
||||||
|
number: stationData.map((item) => item.StationNumber),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const filter = stationData.filter((s) => {
|
||||||
|
if (listFiltered === "") return true;
|
||||||
|
if (listFiltered === "その他") {
|
||||||
|
return !(
|
||||||
|
s.StationNumber ? s.StationNumber.slice(0, 1) : ""
|
||||||
|
).match(/[A-Z]/);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
s.StationNumber ? s.StationNumber.slice(0, 1) : ""
|
||||||
|
).includes(listFiltered);
|
||||||
|
});
|
||||||
|
if (filter.length === 0) return;
|
||||||
|
x.push({
|
||||||
|
stationName,
|
||||||
|
number: stationData.map((item) => item.StationNumber),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
setStationList(x);
|
||||||
|
}, [currentStationDiagram, listFiltered]);
|
||||||
|
useEffect(() => {
|
||||||
|
const filtered = stationList
|
||||||
|
.map((s) => s.number?.map((r) => (r ? r.slice(0, 1) : "")))
|
||||||
|
.flat();
|
||||||
|
const arrayB = Array.from(new Set(filtered));
|
||||||
|
setFilteredStationLine(arrayB.map((r) => (r !== "" ? r : "その他")));
|
||||||
|
}, [stationList]);
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
maxHeight: 200,
|
||||||
|
width: "100%",
|
||||||
|
backgroundColor: "#0099CC",
|
||||||
|
zIndex: 100,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>{input}</Text>
|
||||||
|
<ScrollView keyboardShouldPersistTaps="handled">
|
||||||
|
<View style={{ flexDirection: "row", flexWrap: "wrap" }}>
|
||||||
|
{stationList.map(({ stationName, number }) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{
|
||||||
|
margin: 5,
|
||||||
|
padding: 5,
|
||||||
|
backgroundColor: "#eee",
|
||||||
|
borderRadius: 20,
|
||||||
|
}}
|
||||||
|
key={stationName + number.join(",")}
|
||||||
|
onPress={() => setInput(stationName)}
|
||||||
|
>
|
||||||
|
<Text>{stationName}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
flexWrap: "wrap",
|
||||||
|
borderTopColor: "#ccc",
|
||||||
|
borderTopWidth: 0.5,
|
||||||
|
paddingTop: 0,
|
||||||
|
marginTop: 10,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{
|
||||||
|
margin: 5,
|
||||||
|
padding: 5,
|
||||||
|
backgroundColor: "#eee",
|
||||||
|
borderRadius: 5,
|
||||||
|
}}
|
||||||
|
key={"empty"}
|
||||||
|
onPress={() => {
|
||||||
|
LayoutAnimation.configureNext({
|
||||||
|
duration: 400,
|
||||||
|
update: { type: "easeInEaseOut", springDamping: 0.6 },
|
||||||
|
});
|
||||||
|
setListFiltered("");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>全て</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
{filteredStationLine.map((line) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{
|
||||||
|
margin: 5,
|
||||||
|
padding: 5,
|
||||||
|
backgroundColor: lineColorList[line]
|
||||||
|
? `${lineColorList[line]}`
|
||||||
|
: "#eee",
|
||||||
|
borderRadius: 5,
|
||||||
|
}}
|
||||||
|
key={line}
|
||||||
|
onPress={() => {
|
||||||
|
LayoutAnimation.configureNext({
|
||||||
|
duration: 400,
|
||||||
|
update: { type: "easeInEaseOut", springDamping: 0.6 },
|
||||||
|
});
|
||||||
|
setListFiltered(line);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text style={{ color: lineColorList[line] ? `white` : "black" }}>
|
||||||
|
{line}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
@@ -20,6 +20,7 @@ import { Switch } from "react-native-elements";
|
|||||||
import { customTrainDataDetector } from "../custom-train-data";
|
import { customTrainDataDetector } from "../custom-train-data";
|
||||||
import { getTrainType } from "@/lib/getTrainType";
|
import { getTrainType } from "@/lib/getTrainType";
|
||||||
import { trainTypeID } from "@/lib/CommonTypes";
|
import { trainTypeID } from "@/lib/CommonTypes";
|
||||||
|
import { SearchInputSuggestBox } from "./SearchBox/SearchInputSuggestBox";
|
||||||
|
|
||||||
type props = {
|
type props = {
|
||||||
route: {
|
route: {
|
||||||
@@ -55,6 +56,7 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
const { navigate, addListener, goBack, canGoBack } = useNavigation();
|
const { navigate, addListener, goBack, canGoBack } = useNavigation();
|
||||||
const [keyBoardVisible, setKeyBoardVisible] = useState(false);
|
const [keyBoardVisible, setKeyBoardVisible] = useState(false);
|
||||||
const [input, setInput] = useState("");
|
const [input, setInput] = useState("");
|
||||||
|
const [displayMode, setDisplayMode] = useState<"list" | "grid">("list");
|
||||||
const [selectedTypeList, setSelectedTypeList] = useState<trainTypeID[]>([
|
const [selectedTypeList, setSelectedTypeList] = useState<trainTypeID[]>([
|
||||||
"Normal",
|
"Normal",
|
||||||
"OneMan",
|
"OneMan",
|
||||||
@@ -82,16 +84,26 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
.filter((s) => {
|
.filter((s) => {
|
||||||
const boolData = allTrainDiagram[s];
|
const boolData = allTrainDiagram[s];
|
||||||
let isStop = false;
|
let isStop = false;
|
||||||
|
let isStopPos = -1;
|
||||||
let isInput = false;
|
let isInput = false;
|
||||||
|
let isInputPos = -1;
|
||||||
|
|
||||||
boolData.split("#").forEach((d) => {
|
boolData.split("#").forEach((d, index, array) => {
|
||||||
const [station, type, time] = d.split(",");
|
const [station, type, time] = d.split(",");
|
||||||
if (station === stationName) isStop = true;
|
if (station === stationName) {
|
||||||
if (station === input && type && !type.includes("通"))
|
isStop = true;
|
||||||
|
isStopPos = index;
|
||||||
|
}
|
||||||
|
if (station === input && type && !type.includes("通")) {
|
||||||
isInput = true;
|
isInput = true;
|
||||||
|
isInputPos = index;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (input && input.length > 0) {
|
if (input && input.length > 0) {
|
||||||
return isInput && isStop;
|
if (isInput && isStop) {
|
||||||
|
return isInputPos > isStopPos;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return isStop;
|
return isStop;
|
||||||
})
|
})
|
||||||
@@ -118,6 +130,11 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
// //条件によってフィルタリング
|
// //条件によってフィルタリング
|
||||||
if (!threw && timeType && timeType.includes("通")) return;
|
if (!threw && timeType && timeType.includes("通")) return;
|
||||||
if (!showLastStop && timeType && timeType.includes("着")) return;
|
if (!showLastStop && timeType && timeType.includes("着")) return;
|
||||||
|
if (
|
||||||
|
selectedTypeList.findIndex((item) => item === "SPCL") === -1
|
||||||
|
) {
|
||||||
|
if (d.match(/9\d\d\d[D,M,S]/)) return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
selectedTypeList.length > 0 &&
|
selectedTypeList.length > 0 &&
|
||||||
selectedTypeList.findIndex((item) => item === type) === -1
|
selectedTypeList.findIndex((item) => item === type) === -1
|
||||||
@@ -160,9 +177,17 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const showSubscription = Keyboard.addListener("keyboardDidShow", () => {
|
const showSubscription = Keyboard.addListener("keyboardDidShow", () => {
|
||||||
|
LayoutAnimation.configureNext({
|
||||||
|
duration: 600,
|
||||||
|
update: { type: "spring", springDamping: 0.6 },
|
||||||
|
});
|
||||||
setKeyBoardVisible(true);
|
setKeyBoardVisible(true);
|
||||||
});
|
});
|
||||||
const hideSubscription = Keyboard.addListener("keyboardDidHide", () => {
|
const hideSubscription = Keyboard.addListener("keyboardDidHide", () => {
|
||||||
|
LayoutAnimation.configureNext({
|
||||||
|
duration: 600,
|
||||||
|
update: { type: "spring", springDamping: 0.6 },
|
||||||
|
});
|
||||||
setKeyBoardVisible(false);
|
setKeyBoardVisible(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -184,8 +209,11 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
>
|
>
|
||||||
{currentStation[0].Station_JP}駅 時刻表
|
{currentStation[0].Station_JP}駅 時刻表
|
||||||
</Text>
|
</Text>
|
||||||
{/* <ListView data={currentStationDiagram} /> */}
|
{displayMode === "list" ? (
|
||||||
|
<ListView data={currentStationDiagram} />
|
||||||
|
) : (
|
||||||
<ExGridView data={currentStationDiagram} />
|
<ExGridView data={currentStationDiagram} />
|
||||||
|
)}
|
||||||
{/* <Text
|
{/* <Text
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "white",
|
backgroundColor: "white",
|
||||||
@@ -200,7 +228,15 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
keyboardVerticalOffset={80}
|
keyboardVerticalOffset={80}
|
||||||
enabled={Platform.OS === "ios"}
|
enabled={Platform.OS === "ios"}
|
||||||
>
|
>
|
||||||
<ScrollView horizontal style={{ height: 35, flexDirection: "row" }}>
|
{!keyBoardVisible ? (
|
||||||
|
<ScrollView
|
||||||
|
horizontal
|
||||||
|
style={{
|
||||||
|
height: 35,
|
||||||
|
flexDirection: "row",
|
||||||
|
display: "flex",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={{
|
style={{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -281,7 +317,12 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
selectedTypeList={selectedTypeList}
|
selectedTypeList={selectedTypeList}
|
||||||
setSelectedTypeList={setSelectedTypeList}
|
setSelectedTypeList={setSelectedTypeList}
|
||||||
typeID="SPCL"
|
typeID="SPCL"
|
||||||
relativeID={["SPCL_Normal", "SPCL_Rapid", "SPCL_EXP", "Party"]}
|
relativeID={[
|
||||||
|
"SPCL_Normal",
|
||||||
|
"SPCL_Rapid",
|
||||||
|
"SPCL_EXP",
|
||||||
|
"Party",
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
<TypeSelectorBox
|
<TypeSelectorBox
|
||||||
selectedTypeList={selectedTypeList}
|
selectedTypeList={selectedTypeList}
|
||||||
@@ -351,7 +392,41 @@ export const StationDiagramView: FC<props> = ({ route }) => {
|
|||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<TouchableOpacity
|
||||||
|
style={{
|
||||||
|
alignItems: "center",
|
||||||
|
marginHorizontal: 5,
|
||||||
|
backgroundColor: "#ffffff00",
|
||||||
|
alignSelf: "center",
|
||||||
|
borderColor: "white",
|
||||||
|
borderWidth: 1,
|
||||||
|
borderRadius: 100,
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
setDisplayMode(displayMode === "list" ? "grid" : "list");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color: "white",
|
||||||
|
fontSize: 14,
|
||||||
|
margin: 5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{displayMode === "list" ? "横並びモード" : "リストモード"}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
) : (
|
||||||
|
<View style={{ position: "relative", display: "flex" }}>
|
||||||
|
<SearchInputSuggestBox
|
||||||
|
input={input}
|
||||||
|
setInput={setInput}
|
||||||
|
currentStationDiagram={currentStationDiagram}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
height: 35,
|
height: 35,
|
||||||
|
Reference in New Issue
Block a user