From 282ba848325490bfb3523c804ab5a9475bff1fe3 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Wed, 9 Jul 2025 16:37:40 +0000 Subject: [PATCH 01/13] =?UTF-8?q?=E8=A9=A6=E9=A8=93=E7=9A=84=E3=81=AB?= =?UTF-8?q?=E9=81=85=E5=BB=B6=E6=99=82=E5=88=86=E3=82=92=E7=AB=AF=E3=81=A3?= =?UTF-8?q?=E3=81=93=E3=81=AB=E8=A8=AD=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index c0484d7..a7f920e 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -1485,6 +1485,27 @@ const setStrings = () =>{ element.setAttribute('offclick',element.getAttribute('onclick')) var 行き先情報 = element.getElementsByTagName("p")[0]; + ${uiSetting === "tokyo" ? ` + element.style.position = 'relative'; + if(element.getElementsByTagName("p")[1] != undefined){ + element.getElementsByTagName("p")[1].innerText = element.getElementsByTagName("p")[1].innerText.replace("(","").replace(")",""); + element.getElementsByTagName("p")[1].style.position = 'absolute'; + element.getElementsByTagName("p")[1].style.backgroundColor = 'red'; + element.getElementsByTagName("p")[1].style.color = 'white'; + element.getElementsByTagName("p")[1].style.fontSize = '10px'; + element.getElementsByTagName("p")[1].style.fontWeight = 'bold'; + element.getElementsByTagName("p")[1].style.padding = '2px'; + element.getElementsByTagName("p")[1].style.textAlign = 'center'; + element.getElementsByTagName("p")[1].style.borderRadius = '10px'; + if(element.getAttribute("style").includes("left")){ + element.getElementsByTagName("p")[1].style.bottom = '0px'; + element.getElementsByTagName("p")[1].style.left = '0px'; + } + else if(element.getAttribute("style").includes("right")){ + element.getElementsByTagName("p")[1].style.right = '0px'; + element.getElementsByTagName("p")[1].style.top = '0px'; + } + }`: ``} var 列番データ = element.getAttribute('offclick').split('"')[1]; var 列車名データ = element.getAttribute('offclick').split('"')[3]; const trainData = trainPositionDatas.filter(e=>!(e.Pos && e.Pos.includes("予告窓"))).find(e => e.TrainNum == 列番データ); From 3dc5f52333004b3165ea5a224823b677cc2aaffd Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Sun, 13 Jul 2025 15:39:43 +0000 Subject: [PATCH 02/13] =?UTF-8?q?iOS=E3=81=A7=E3=82=AD=E3=83=BC=E3=83=9C?= =?UTF-8?q?=E3=83=BC=E3=83=89=E9=96=A2=E4=BF=82=E3=81=A7=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=83=83=E3=82=B7=E3=83=A5=E3=81=99=E3=82=8B=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Menu/Carousel/CarouselTypeChanger.tsx | 5 +- components/Menu/RailScope/SearchUnitBox.tsx | 69 ++++++++++--------- menu.js | 9 ++- 3 files changed, 45 insertions(+), 38 deletions(-) diff --git a/components/Menu/Carousel/CarouselTypeChanger.tsx b/components/Menu/Carousel/CarouselTypeChanger.tsx index 57266ae..8517190 100644 --- a/components/Menu/Carousel/CarouselTypeChanger.tsx +++ b/components/Menu/Carousel/CarouselTypeChanger.tsx @@ -44,8 +44,9 @@ export const CarouselTypeChanger = ({ }; return ( { +export const SearchUnitBox = ({ isSearchMode, setisSearchMode, }) => { const { height, width } = useWindowDimensions(); + const [input, setInput] = React.useState(""); return ( <> { > {!isSearchMode && } {!!isSearchMode && ( - - + + + {}} + onChange={(ret) => setInput(ret.nativeEvent.text)} + value={input} + style={{ flex: 1 }} + /> + - { - LayoutAnimation.configureNext({ - duration: 100, - update: { type: "easeInEaseOut", springDamping: 0.6 }, - }); - setisSearchMode(false); - }}> + { + LayoutAnimation.configureNext({ + duration: 100, + update: { type: "easeInEaseOut", springDamping: 0.6 }, + }); + setisSearchMode(false); + }} + > { { borderWidth: 1, borderStyle: "solid", alignItems: "center", - opacity: isSearchMode == stationIDPair[lineList_LineWebID[d]] ? 1 : !isSearchMode ? 1 : 0.5, + opacity: + isSearchMode == stationIDPair[lineList_LineWebID[d]] + ? 1 + : !isSearchMode + ? 1 + : 0.5, zIndex: 10, }} onPress={() => { @@ -86,25 +112,6 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => { ))} - {/* - setKeyBoardVisible(true)} - onEndEditing={() => {}} - //onChange={(ret) => setInput(ret.nativeEvent.text)} - //value={input} - style={{ flex: 1 }} - /> - */} )} diff --git a/menu.js b/menu.js index bc51c70..f8e7843 100644 --- a/menu.js +++ b/menu.js @@ -34,7 +34,6 @@ import { useUserPosition } from "./stateBox/useUserPosition"; import { AS } from "./storageControl"; import { lineList_LineWebID } from "./lib/getStationList"; import { Ionicons } from "@expo/vector-icons"; -import { SearchUnitBox } from "./components/Menu/RailScope/SearchUnitBox"; configureReanimatedLogger({ level: ReanimatedLogLevel.error, // Set the log level to error strict: true, // Reanimated runs in strict mode by default @@ -275,9 +274,9 @@ export default function Menu(props) { snapToEnd={false} decelerationRate={"normal"} snapToOffsets={[mapHeight - 80]} - contentContainerStyle={{ - position: "relative", - }} + // contentContainerStyle={{ + // position: "relative", + // }} onScrollBeginDrag={onScrollBeginDrag} onScrollEndDrag={(e) => { if (e.nativeEvent.contentOffset.y < mapHeight - 80) { @@ -291,7 +290,7 @@ export default function Menu(props) { > Date: Tue, 15 Jul 2025 02:56:29 +0000 Subject: [PATCH 03/13] =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E3=83=A2=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Menu/Carousel/CarouselBox.tsx | 2 +- .../Menu/Carousel/CarouselTypeChanger.tsx | 6 +++ components/Menu/RailScope/SearchUnitBox.tsx | 53 +++++++++++-------- menu.js | 50 ++++++++++------- stateBox/useStationList.tsx | 20 +++++++ 5 files changed, 91 insertions(+), 40 deletions(-) diff --git a/components/Menu/Carousel/CarouselBox.tsx b/components/Menu/Carousel/CarouselBox.tsx index 0b048fc..240c215 100644 --- a/components/Menu/Carousel/CarouselBox.tsx +++ b/components/Menu/Carousel/CarouselBox.tsx @@ -104,7 +104,7 @@ export const CarouselBox = ({ }} > - {!!isSearchMode ? "路線検索モードです。上に並んでいる路線を選んでみましょう!" :stationListMode == "position" + {!!isSearchMode ? "路線検索モードです。入力欄に駅名やナンバリングを入力したり、上に並んでいる路線を選んでみましょう!" :stationListMode == "position" ? "現在地の近くに駅がありません。" : "お気に入りリストがありません。お気に入りの駅を追加しよう!"} diff --git a/components/Menu/Carousel/CarouselTypeChanger.tsx b/components/Menu/Carousel/CarouselTypeChanger.tsx index 8517190..5b28d3f 100644 --- a/components/Menu/Carousel/CarouselTypeChanger.tsx +++ b/components/Menu/Carousel/CarouselTypeChanger.tsx @@ -25,6 +25,10 @@ export const CarouselTypeChanger = ({ setMapMode, isSearchMode, setisSearchMode, + listUpStation, + setListUpStation, + input, + setInput }) => { const tabBarHeight = useBottomTabBarHeight(); const { height, width } = useWindowDimensions(); @@ -62,6 +66,8 @@ export const CarouselTypeChanger = ({ { +export const SearchUnitBox = ({ + isSearchMode, + setisSearchMode, + input, + setInput, +}) => { const { height, width } = useWindowDimensions(); - const [input, setInput] = React.useState(""); return ( <> { > {!isSearchMode && } {!!isSearchMode && ( - - - {}} - onChange={(ret) => setInput(ret.nativeEvent.text)} - value={input} - style={{ flex: 1 }} - /> - + + + {}} + onChange={(ret) => setInput(ret.nativeEvent.text)} + value={input} + style={{ flex: 1 }} + /> + { diff --git a/menu.js b/menu.js index f8e7843..1c4b9d8 100644 --- a/menu.js +++ b/menu.js @@ -42,7 +42,7 @@ export default function Menu(props) { const { scrollRef, mapHeight, MapFullHeight, mapMode, setMapMode } = props; const { navigate, addListener, isFocused } = useNavigation(); const { favoriteStation } = useFavoriteStation(); - const { originalStationList } = useStationList(); + const { originalStationList,getStationDataFromNameBase } = useStationList(); const { height, width } = useWindowDimensions(); const { bottom, left, right, top } = useSafeAreaInsets(); const tabBarHeight = useBottomTabBarHeight(); @@ -172,25 +172,31 @@ export default function Menu(props) { const [listUpStation, setListUpStation] = useState([]); const [isSearchMode, setisSearchMode] = useState(false); + const [input, setInput] = React.useState(""); useLayoutEffect(() => { if (!!isSearchMode) { const returnData = []; - Object.keys(lineList_LineWebID).forEach((d, indexBase) => { - originalStationList[d].forEach((D, index) => { - if ( - isSearchMode && - isSearchMode != stationIDPair[lineList_LineWebID[d]] - ) - return; - const latlng = [D.lat, D.lng]; - if (latlng.length == 0) return null; - if (D.StationNumber == undefined) { - return null; - } - returnData.push([D]); + if (!input || input == "") { + Object.keys(lineList_LineWebID).forEach((d, indexBase) => { + originalStationList[d].forEach((D, index) => { + if ( + isSearchMode && + isSearchMode != stationIDPair[lineList_LineWebID[d]] + ) + return; + const latlng = [D.lat, D.lng]; + if (latlng.length == 0) return null; + if (D.StationNumber == undefined) { + return null; + } + returnData.push([D]); + }); }); - }); - if (JSON.stringify(returnData) == JSON.stringify(listUpStation)) return; + if (JSON.stringify(returnData) == JSON.stringify(listUpStation)) return; + }else{ + const hoge = getStationDataFromNameBase(input); + hoge.forEach(d=>returnData.push([d])); + } setListUpStation(returnData); } else if (stationListMode == "position") { const returnData = nearPositionStation.filter((d) => d != undefined); @@ -290,7 +296,7 @@ export default function Menu(props) { > )} @@ -386,7 +396,7 @@ export default function Menu(props) { listIndex, navigate, stationListMode, - isSearchMode + isSearchMode, }} /> {listUpStation[listIndex] && ( @@ -416,6 +426,10 @@ export default function Menu(props) { setMapMode, isSearchMode, setisSearchMode, + listUpStation, + setListUpStation, + input, + setInput, }} /> )} diff --git a/stateBox/useStationList.tsx b/stateBox/useStationList.tsx index 7073735..73219b2 100644 --- a/stateBox/useStationList.tsx +++ b/stateBox/useStationList.tsx @@ -16,6 +16,7 @@ type initialStateType = { setOriginalStationList: React.Dispatch>; getStationDataFromName: (id: string) => any[]; getStationDataFromId: (id: string) => any[]; + getStationDataFromNameBase: (name: string) => any[]; stationList: any[]; getInjectJavascriptAddress: (StationNumber: string) => string; }; @@ -24,6 +25,7 @@ const initialState = { setOriginalStationList: () => {}, getStationDataFromName: () => [], getStationDataFromId: () => [], + getStationDataFromNameBase: () => [], stationList: [], getInjectJavascriptAddress: (StationNumber: string) => "", }; @@ -66,6 +68,23 @@ export const StationListProvider: FC = ({ children }) => { }); return returnArray; }; + + const getStationDataFromNameBase: (name: string) => any[] = (name) => { + const returnArray = []; + Object.keys(originalStationList).forEach((key) => { + originalStationList[key].forEach((station) => { + if (!station.StationNumber) return; + if (typeof station.StationNumber === "string" && station.StationNumber.includes(name)) { + if (!!station.jslodApi) returnArray.push(station); + } + else if (typeof station.Station_JP === "string" && station.Station_JP.includes(name)) { + if (!!station.jslodApi) returnArray.push(station); + } + }); + }); + return returnArray; + }; + const [stationList, setStationList] = useState([[]]); useEffect(() => { if (originalStationList.length === 0) return; @@ -113,6 +132,7 @@ export const StationListProvider: FC = ({ children }) => { setOriginalStationList, getStationDataFromName, getStationDataFromId, + getStationDataFromNameBase, stationList, getInjectJavascriptAddress, }} From fbd76a0cf66b2314cfebbb48c6f7ca4d0aa626fd Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 15 Jul 2025 02:58:57 +0000 Subject: [PATCH 04/13] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Menu/Carousel/CarouselTypeChanger.tsx | 15 +++------------ menu.js | 7 ------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/components/Menu/Carousel/CarouselTypeChanger.tsx b/components/Menu/Carousel/CarouselTypeChanger.tsx index 5b28d3f..7ae5b7e 100644 --- a/components/Menu/Carousel/CarouselTypeChanger.tsx +++ b/components/Menu/Carousel/CarouselTypeChanger.tsx @@ -1,9 +1,6 @@ import { AS } from "@/storageControl"; -import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs"; -import React, { useEffect, useRef } from "react"; -import { useWindowDimensions } from "react-native"; +import React from "react"; import { - View, TouchableOpacity, Text, LayoutAnimation, @@ -16,8 +13,6 @@ import { SearchUnitBox } from "@/components/Menu/RailScope/SearchUnitBox"; export const CarouselTypeChanger = ({ locationStatus, position, - mapsRef, - scrollRef, stationListMode, setStationListMode, setSelectedCurrentStation, @@ -25,13 +20,9 @@ export const CarouselTypeChanger = ({ setMapMode, isSearchMode, setisSearchMode, - listUpStation, - setListUpStation, - input, - setInput + input, + setInput, }) => { - const tabBarHeight = useBottomTabBarHeight(); - const { height, width } = useWindowDimensions(); const returnToDefaultMode = () => { LayoutAnimation.configureNext({ duration: 300, diff --git a/menu.js b/menu.js index 1c4b9d8..d30a6b3 100644 --- a/menu.js +++ b/menu.js @@ -368,8 +368,6 @@ export default function Menu(props) { {...{ locationStatus, position, - mapsRef, - scrollRef, stationListMode, setStationListMode, setSelectedCurrentStation: setListIndex, @@ -377,8 +375,6 @@ export default function Menu(props) { setMapMode, isSearchMode, setisSearchMode, - listUpStation, - setListUpStation, input, setInput, }} @@ -418,7 +414,6 @@ export default function Menu(props) { {...{ locationStatus, position, - mapsRef, stationListMode, setStationListMode, setSelectedCurrentStation: setListIndex, @@ -426,8 +421,6 @@ export default function Menu(props) { setMapMode, isSearchMode, setisSearchMode, - listUpStation, - setListUpStation, input, setInput, }} From fdd0c78adcb3871916d9d0601158fd0e48ac2f34 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 15 Jul 2025 03:25:20 +0000 Subject: [PATCH 05/13] =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=81=AE=E9=87=8D=E8=A4=87=E7=AE=A1=E7=90=86=E3=82=92=E5=AE=9F?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- menu.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/menu.js b/menu.js index d30a6b3..d8deea1 100644 --- a/menu.js +++ b/menu.js @@ -42,7 +42,7 @@ export default function Menu(props) { const { scrollRef, mapHeight, MapFullHeight, mapMode, setMapMode } = props; const { navigate, addListener, isFocused } = useNavigation(); const { favoriteStation } = useFavoriteStation(); - const { originalStationList,getStationDataFromNameBase } = useStationList(); + const { originalStationList, getStationDataFromNameBase } = useStationList(); const { height, width } = useWindowDimensions(); const { bottom, left, right, top } = useSafeAreaInsets(); const tabBarHeight = useBottomTabBarHeight(); @@ -192,11 +192,16 @@ export default function Menu(props) { returnData.push([D]); }); }); - if (JSON.stringify(returnData) == JSON.stringify(listUpStation)) return; - }else{ + } else { const hoge = getStationDataFromNameBase(input); - hoge.forEach(d=>returnData.push([d])); + hoge.forEach((d, index, array) => { + const stationName = d.Station_JP; + if (returnData.findIndex((d1) => d1[0].Station_JP == stationName) != -1) + return; + returnData.push(array.filter((d2) => d2.Station_JP == stationName)); + }); } + if (JSON.stringify(returnData) == JSON.stringify(listUpStation)) return; setListUpStation(returnData); } else if (stationListMode == "position") { const returnData = nearPositionStation.filter((d) => d != undefined); From 3ac0edd3ad4f6c09e7d010d2048d236e04d3367b Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 15 Jul 2025 04:23:14 +0000 Subject: [PATCH 06/13] =?UTF-8?q?GithubCopilot=E3=81=AB=E3=82=88=E3=82=8B?= =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MenuPage.js | 8 ++++++-- .../ActionSheetComponents/EachTrainInfo/LongHeader.js | 6 ------ .../ActionSheetComponents/EachTrainInfo/ShortHeader.js | 6 ------ index.js | 1 - lib/eachTrainInfoCoreLib/findReversalPoints.js | 2 +- package.json | 2 +- stateBox/useCurrentTrain.js | 2 +- stateBox/useFavoriteStation.tsx | 7 ++++++- stateBox/useNotifications.tsx | 2 +- tsconfig.json | 4 ++-- 10 files changed, 18 insertions(+), 22 deletions(-) diff --git a/MenuPage.js b/MenuPage.js index 6f00ec3..5102368 100644 --- a/MenuPage.js +++ b/MenuPage.js @@ -84,11 +84,15 @@ export function MenuPage() { setFavoriteStation(returnData); } }) - .catch((d) => console.log(d)); + .catch((error) => { + if (__DEV__) { + console.warn('お気に入り駅の読み込みに失敗しました:', error); + } + }); }); return unsubscribe; - }, [navigation, mapHeight]); + }, [navigation, mapHeight, favoriteStation, setFavoriteStation]); return ( { return ( setActionSheetHorizonalScroll(true)} - //onScrollEndDrag={() => setActionSheetHorizonalScroll(false)} - //onScrollBeginDrag={() => console.log("onScrollBeginDrag")} style={{ flexDirection: "row", - //width: widthPercentageToDP("200%"), - // minHeight: 200, - //height: heightPercentageToDP("20%"), }} horizontal pagingEnabled diff --git a/components/ActionSheetComponents/EachTrainInfo/ShortHeader.js b/components/ActionSheetComponents/EachTrainInfo/ShortHeader.js index 1f68b85..3c474ab 100644 --- a/components/ActionSheetComponents/EachTrainInfo/ShortHeader.js +++ b/components/ActionSheetComponents/EachTrainInfo/ShortHeader.js @@ -11,15 +11,9 @@ export const ShortHeader = ({ }) => { return ( setActionSheetHorizonalScroll(true)} - //onScrollEndDrag={() => setActionSheetHorizonalScroll(false)} - //onScrollBeginDrag={() => console.log("onScrollBeginDrag")} style={{ flexDirection: "row", flex: 1, - //width: widthPercentageToDP("200%"), - // minHeight: 200, - //height: heightPercentageToDP("20%"), }} horizontal pagingEnabled diff --git a/index.js b/index.js index 00631d6..dc98efe 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,3 @@ -import 'babel-polyfill'; import { registerRootComponent } from "expo"; import { registerWidgetTaskHandler } from "react-native-android-widget"; import { Platform } from "react-native"; diff --git a/lib/eachTrainInfoCoreLib/findReversalPoints.js b/lib/eachTrainInfoCoreLib/findReversalPoints.js index 5981d75..7e4b7f6 100644 --- a/lib/eachTrainInfoCoreLib/findReversalPoints.js +++ b/lib/eachTrainInfoCoreLib/findReversalPoints.js @@ -46,6 +46,6 @@ export const findReversalPoints = (array, stopStationIDList) => { return allThroughStation; } } catch (e) { - console.log(e); + // エラーが発生した場合は空の配列を返す } }; diff --git a/package.json b/package.json index a5f8cbb..a1145ee 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "android": "expo start --android", "ios": "expo start --ios", "eject": "expo eject", - "pushWeb":"npx expo export -p web && netlify deploy --dir dist --prod", + "pushWeb": "npx expo export -p web && netlify deploy --dir dist --prod", "checkDiagram": "bash ./check.sh" }, "dependencies": { diff --git a/stateBox/useCurrentTrain.js b/stateBox/useCurrentTrain.js index 15f6b44..fed4dc3 100644 --- a/stateBox/useCurrentTrain.js +++ b/stateBox/useCurrentTrain.js @@ -62,7 +62,7 @@ export const CurrentTrainProvider = ({ children }) => { setCurrentTrainLoading("success"); }) .catch(() => { - console.log("えらー"); + // エラー時の処理 setCurrentTrainLoading("error"); }); }); diff --git a/stateBox/useFavoriteStation.tsx b/stateBox/useFavoriteStation.tsx index d4f5893..9ec7668 100644 --- a/stateBox/useFavoriteStation.tsx +++ b/stateBox/useFavoriteStation.tsx @@ -42,7 +42,12 @@ export const FavoriteStationProvider:FC = ({ children }) => { const returnData = JSON.parse(d); setFavoriteStation(returnData); }) - .catch((d) => console.log(d)); + .catch((error) => { + // エラーログを記録(開発時のみ) + if (__DEV__) { + console.warn('お気に入り駅の読み込みに失敗しました:', error); + } + }); }, []); return ( Date: Tue, 15 Jul 2025 04:51:50 +0000 Subject: [PATCH 07/13] =?UTF-8?q?GithubCopilot=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=83=AA=E3=83=B3=E3=82=B02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EachTrainInfo/LandscapeTrainInfo.js | 1 - components/ActionSheetComponents/StationDeteilView.js | 2 +- components/Settings/settings.js | 2 -- components/trainbaseview.js | 4 +++- ndView.tsx | 6 ++++-- stateBox/useNotifications.tsx | 10 ++++------ 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo/LandscapeTrainInfo.js b/components/ActionSheetComponents/EachTrainInfo/LandscapeTrainInfo.js index 96b8152..f6cadc9 100644 --- a/components/ActionSheetComponents/EachTrainInfo/LandscapeTrainInfo.js +++ b/components/ActionSheetComponents/EachTrainInfo/LandscapeTrainInfo.js @@ -21,7 +21,6 @@ export const LandscapeTrainInfo = (props) => { width: width / 2, }} > - {width / 2} {leftContent} { setTrainBus(); } setTrainBus(data[0]); - }, [currentStation]); + }, [currentStation, busAndTrainData]); const [usePDFView, setUsePDFView] = useState(undefined); useEffect(() => { diff --git a/components/Settings/settings.js b/components/Settings/settings.js index 7c8680e..e4c2b58 100644 --- a/components/Settings/settings.js +++ b/components/Settings/settings.js @@ -14,9 +14,7 @@ import { createStackNavigator } from "@react-navigation/stack"; import { TransitionPresets } from "@react-navigation/stack"; //import * as ExpoFelicaReader from "../../modules/expo-felica-reader/src"; import * as Updates from "expo-updates"; -import StatusbarDetect from "../../StatusbarDetect"; import { AS } from "../../storageControl"; -var Status = StatusbarDetect(); import { Switch } from "react-native-elements"; import AutoHeightImage from "react-native-auto-height-image"; import { SettingTopPage } from "./SettingTopPage"; diff --git a/components/trainbaseview.js b/components/trainbaseview.js index ca62447..39f7631 100644 --- a/components/trainbaseview.js +++ b/components/trainbaseview.js @@ -29,7 +29,9 @@ export default function TrainBase({ route }) { "https://train.jr-shikoku.co.jp", "https://train.jr-shikoku.co.jp/sp.html", ]} - onMessage={(event) => {}} + onMessage={() => { + // 必要に応じてメッセージ処理を実装 + }} mixedContentMode={"compatibility"} javaScriptEnabled injectedJavaScript={jss} diff --git a/ndView.tsx b/ndView.tsx index ef2d1ad..fa2ac7e 100644 --- a/ndView.tsx +++ b/ndView.tsx @@ -119,8 +119,10 @@ setInterval(() => { javaScriptEnabled={true} injectedJavaScript={jsa} pullToRefreshEnabled - onError={() => this.webView?.reload()} - onMessage={()=>{}} + onError={() => webview.current?.reload()} + onMessage={() => { + // 必要に応じてメッセージ処理を実装 + }} /> webview.current.reload()} diff --git a/stateBox/useNotifications.tsx b/stateBox/useNotifications.tsx index 3de055e..c8c8afc 100644 --- a/stateBox/useNotifications.tsx +++ b/stateBox/useNotifications.tsx @@ -117,12 +117,10 @@ export const NotificationProvider: FC = ({ children }) => { notificationListener.current = Notifications.addNotificationReceivedListener((notification) => { setNotification(notification); - }); - - responseListener.current = - Notifications.addNotificationResponseReceivedListener((response) => { - console.log(response); - }); + }); responseListener.current = + Notifications.addNotificationResponseReceivedListener((response) => { + // 通知レスポンスの処理 + }); return () => { notificationListener.current && From 8d10fbf998b7b1e477693368d880a25dbdc04f30 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 15 Jul 2025 15:15:04 +0000 Subject: [PATCH 08/13] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index a7f920e..502efd8 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -73,7 +73,8 @@ export const injectJavascriptData: InjectJavascriptData = ( const trainIcon = ` const setStationIcon = (setIconElem,img,hasProblem) =>{ const position = setIconElem.getAttribute("style").includes("left"); - setIconElem.insertAdjacentHTML('beforebegin', ""); + const marginData = ${uiSetting === "tokyo" ? `"5px"`: `"2px"`} + setIconElem.insertAdjacentHTML('beforebegin', ""); setIconElem.remove(); } @@ -1052,7 +1053,7 @@ export const injectJavascriptData: InjectJavascriptData = ( return undefined; } } - const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem) =>{ + const nameReplace = (列車名データ,列番データ,行き先情報,hasProblem,isLeft) =>{ let isWanman = false; let trainName = ""; let trainType = ""; @@ -1344,14 +1345,9 @@ export const injectJavascriptData: InjectJavascriptData = ( } const gradient = getColors.length > 1 ? "linear-gradient(130deg, " + getColors[0] + " 0%, "+ getColors[0]+"50%, "+ getColors[1]+"50%, " + getColors[1] + " 100%)" : getColors[0]; - 行き先情報.insertAdjacentHTML('beforebegin', "

" + TrainNumber + (JRF ? "":"レ") + "

"); - 行き先情報.insertAdjacentHTML('beforebegin', "

" + (isWanman ? "ワンマン " : "") + "

"); - 行き先情報.insertAdjacentHTML('beforebegin', "

" + viaData + "

"); - 行き先情報.insertAdjacentHTML('beforebegin', "

" + trainName + "

"); - 行き先情報.insertAdjacentHTML('beforebegin', "

" + (ToData ? ToData + "行" : ToData) + "

"); - 行き先情報.insertAdjacentHTML('beforebegin', "

" + trainType + "

"); - 行き先情報.insertAdjacentHTML('beforebegin', "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); - `: ` + + 行き先情報.insertAdjacentHTML('beforebegin', "

" + TrainNumber + (JRF ? "":"レ") + "

" + (isWanman ? "ワンマン " : "") + "

" + viaData + "

" + trainName + "

" + (ToData ? ToData + "行" : ToData) + "

" + trainType + "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); +`: ` 行き先情報.insertAdjacentHTML('beforebegin', "

" + returnText1 + "

"); 行き先情報.insertAdjacentHTML('beforebegin', "

" + (ToData ? ToData + "行 " : ToData) + "

" + TrainNumber + (JRF ? "":"レ") + "

"); 行き先情報.insertAdjacentHTML('beforebegin', "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); @@ -1373,7 +1369,7 @@ const setNewTrainItem = (element,hasProblem)=>{ }else if(JRFTemp){ element.style.borderColor = 'rgba(0, 134, 158, 0.8)'; }else{ - element.style.borderColor = 'white'; + element.style.borderColor = 'black'; } element.style.borderWidth = '2px'; element.style.borderStyle = 'solid'; @@ -1486,6 +1482,9 @@ const setStrings = () =>{ var 行き先情報 = element.getElementsByTagName("p")[0]; ${uiSetting === "tokyo" ? ` + element.querySelector("img").insertAdjacentHTML('beforebegin',"
"); + element.querySelector("img").insertAdjacentHTML('afterend',"
"); + element.querySelector("img").style.padding = '5px'; element.style.position = 'relative'; if(element.getElementsByTagName("p")[1] != undefined){ element.getElementsByTagName("p")[1].innerText = element.getElementsByTagName("p")[1].innerText.replace("(","").replace(")",""); @@ -1506,6 +1505,7 @@ const setStrings = () =>{ element.getElementsByTagName("p")[1].style.top = '0px'; } }`: ``} + const isLeft = element.getAttribute("style").includes("left"); var 列番データ = element.getAttribute('offclick').split('"')[1]; var 列車名データ = element.getAttribute('offclick').split('"')[3]; const trainData = trainPositionDatas.filter(e=>!(e.Pos && e.Pos.includes("予告窓"))).find(e => e.TrainNum == 列番データ); @@ -1530,7 +1530,7 @@ const setStrings = () =>{ } } ` : ""} - nameReplace(列車名データ,列番データ,行き先情報,hasProblem); + nameReplace(列車名データ,列番データ,行き先情報,hasProblem,isLeft); ${uiSetting === "tokyo" ? `setNewTrainItem(element,hasProblem);`: ``} } try{ From f75582ee53df0e63b5c8c87f7fb7b77b46523d69 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Wed, 16 Jul 2025 23:46:26 +0000 Subject: [PATCH 09/13] =?UTF-8?q?menu=E3=81=AE=E3=83=AC=E3=82=A4=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Menu/RailScope/SearchUnitBox.tsx | 42 +++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/components/Menu/RailScope/SearchUnitBox.tsx b/components/Menu/RailScope/SearchUnitBox.tsx index 1a7af13..2e7741c 100644 --- a/components/Menu/RailScope/SearchUnitBox.tsx +++ b/components/Menu/RailScope/SearchUnitBox.tsx @@ -50,26 +50,10 @@ export const SearchUnitBox = ({ flexDirection: "column", display: "flex", flex: 1, + alignContent: "center", + justifyContent: "flex-end", }} > - - {}} - onChange={(ret) => setInput(ret.nativeEvent.text)} - value={input} - style={{ flex: 1 }} - /> - { @@ -87,6 +71,26 @@ export const SearchUnitBox = ({ style={{ marginRight: 10 }} /> + + {}} + onChange={(ret) => setInput(ret.nativeEvent.text)} + value={input} + style={{ flex: 1 }} + /> + + + {!input && {Object.keys(lineList_LineWebID).map((d) => ( ))} - +
}
)}
From 326cd60733885d8a30f8d96ca5f068b4367c0327 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Thu, 17 Jul 2025 10:27:43 +0000 Subject: [PATCH 10/13] =?UTF-8?q?css=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index 502efd8..9ac40b7 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -1346,7 +1346,7 @@ export const injectJavascriptData: InjectJavascriptData = ( const gradient = getColors.length > 1 ? "linear-gradient(130deg, " + getColors[0] + " 0%, "+ getColors[0]+"50%, "+ getColors[1]+"50%, " + getColors[1] + " 100%)" : getColors[0]; - 行き先情報.insertAdjacentHTML('beforebegin', "

" + TrainNumber + (JRF ? "":"レ") + "

" + (isWanman ? "ワンマン " : "") + "

" + viaData + "

" + trainName + "

" + (ToData ? ToData + "行" : ToData) + "

" + trainType + "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); + 行き先情報.insertAdjacentHTML('beforebegin', "

" + TrainNumber + (JRF ? "":"レ") + "

" + (isWanman ? "ワンマン " : "") + "

" + viaData + "

" + trainName + "

" + (ToData ? ToData + "行" : ToData) + "

" + trainType + "

" + (hasProblem ? "‼️停止中‼️" : "") + "

"); `: ` 行き先情報.insertAdjacentHTML('beforebegin', "

" + returnText1 + "

"); 行き先情報.insertAdjacentHTML('beforebegin', "

" + (ToData ? ToData + "行 " : ToData) + "

" + TrainNumber + (JRF ? "":"レ") + "

"); @@ -1406,12 +1406,12 @@ const setNewTrainItem = (element,hasProblem)=>{ element.addEventListener('touchend', () => element.style.transform = 'scale(1)'); if(element.getAttribute("style").includes("left")){ // borderを使って五角形を生成 下り - element.style.borderRadius = '10% 10% 40% 40%'; + element.style.borderRadius = '30px 30px 120px 120px'; element.style.flexDirection = 'column-reverse'; } else if(element.getAttribute("style").includes("right")){ // borderを使って五角形を生成 上り - element.style.borderRadius = '40% 40% 10% 10%'; + element.style.borderRadius = '120px 120px 30px 30px'; element.style.flexDirection = 'column'; } From 0c10bcc339ac69e5d7c993a3a3d072b57dcf5a51 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Fri, 18 Jul 2025 15:18:33 +0000 Subject: [PATCH 11/13] =?UTF-8?q?=E6=96=B0=E5=9E=8BCSS=E3=81=AE=E5=BD=A2?= =?UTF-8?q?=E6=85=8B=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/webViewInjectjavascript.ts | 101 +++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/lib/webViewInjectjavascript.ts b/lib/webViewInjectjavascript.ts index 9ac40b7..088bd84 100644 --- a/lib/webViewInjectjavascript.ts +++ b/lib/webViewInjectjavascript.ts @@ -1421,57 +1421,70 @@ const setStrings = () =>{ try { const elements = document.querySelectorAll('#disp > div > div > div[onclick]'); const setNewTrainItemUI = ()=>{ - const elementBaseBase = document.querySelectorAll('[id^="stationBlock"]'); - elementBaseBase.forEach(e=>{ //それぞれの駅ブロック横一列 + const aaa = (x2,pos) => { + x2.style.display = 'flex'; + x2.style.flexDirection = 'row'; + if(pos == "right"){ + x2.style.alignItems = 'flex-start'; + x2.style.justifyContent = 'flex-start'; + }else if(pos == "left"){ + x2.style.alignItems = 'flex-end'; + x2.style.justifyContent = 'flex-end'; + } + x2.style.flexWrap = 'wrap'; + x2.style.width = '100%'; + x2.style.height = "100%"; + + } + const aaa2 = (x2) => { + x2.style.display = 'flex'; + x2.style.flexDirection = 'row'; + x2.style.alignItems = 'center'; + x2.style.justifyContent = 'center'; + x2.style.flexWrap = 'wrap'; + x2.style.width = '100%'; + x2.style.height = "unset"; + const x3 = x2.querySelectorAll(":scope > div"); + x3.forEach(i=>{ + i.style.position = "unset"; + i.style.display = "flex"; + i.style.flexDirection = "column"; + i.style.flex = "1"; + i.style.backgroundColor = "#00000000"; + i.querySelectorAll(":scope > *").forEach(j=>{ + j.style.width = "100%"; + j.style.textAlign = "center"; + j.style.margin = "5px"; + j.style.padding = "5px"; + }); + }); + } + const layoutBase = (e)=>{ e.style.display = 'flex'; e.style.height = "unset"; e.style.flexDirection = 'row'; - //e.style.alignItems = "left"; e.style.justifyContent = 'center'; - const x = e.querySelectorAll(':scope > div');//配下のdiv要素を選択 - //x[0] 登りブロック x[2] 下りブロック x[1] 駅ブロック - const aaa = (x2,pos) => { - x2.style.display = 'flex'; - x2.style.flexDirection = 'row'; - if(pos == "right"){ - x2.style.alignItems = 'flex-start'; - x2.style.justifyContent = 'flex-start'; - }else if(pos == "left"){ - x2.style.alignItems = 'flex-end'; - x2.style.justifyContent = 'flex-end'; - } - x2.style.flexWrap = 'wrap'; - x2.style.width = '100%'; - x2.style.height = "100%"; - - } - const aaa2 = (x2) => { - x2.style.display = 'flex'; - x2.style.flexDirection = 'row'; - x2.style.alignItems = 'center'; - x2.style.justifyContent = 'center'; - x2.style.flexWrap = 'wrap'; - x2.style.width = '100%'; - x2.style.height = "unset"; - const x3 = x2.querySelectorAll(":scope > div"); - x3.forEach(i=>{ - i.style.position = "unset"; - i.style.display = "flex"; - i.style.flexDirection = "column"; - i.style.flex = "1"; - i.style.backgroundColor = "#00000000"; - i.querySelectorAll(":scope > *").forEach(j=>{ - j.style.width = "100%"; - j.style.textAlign = "center"; - j.style.margin = "5px"; - j.style.padding = "5px"; - }); - }); - } + } + const elementBaseBase = document.querySelectorAll('[id^="stationBlock"]'); + const elementNotBase = document.querySelectorAll('#disp > [id*="~"]'); + elementNotBase.forEach(e=>{ + layoutBase(e); + const x = e.querySelectorAll(':scope > [id^="Up"], :scope > [id^="Id"], :scope > [id^="Down"]');//配下のdiv要素を選択 + aaa(x[0],"left"); + aaa2(x[1]); + aaa(x[2],"right"); + const upTrainCrossBarElement = e.querySelector(':scope > [id="upTrainCrossBar"]'); + if (upTrainCrossBarElement) { + upTrainCrossBarElement.style.left = '0px'; + } + }); + elementBaseBase.forEach(e=>{ //それぞれの駅ブロック横一列 + layoutBase(e); + const x = e.querySelectorAll(':scope > div');//配下のdiv要素を選択 + //x[0] 登りブロック x[2] 下りブロック x[1] 駅ブロック aaa(x[0],"left"); aaa2(x[1]); aaa(x[2],"right"); - }); } From acd5d0bb882139379fe5e409f3b7f291a7a14dcf Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Fri, 18 Jul 2025 15:34:00 +0000 Subject: [PATCH 12/13] =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Menu/RailScope/SearchUnitBox.tsx | 99 +++++++++++++-------- 1 file changed, 62 insertions(+), 37 deletions(-) diff --git a/components/Menu/RailScope/SearchUnitBox.tsx b/components/Menu/RailScope/SearchUnitBox.tsx index 2e7741c..01cf4be 100644 --- a/components/Menu/RailScope/SearchUnitBox.tsx +++ b/components/Menu/RailScope/SearchUnitBox.tsx @@ -79,6 +79,9 @@ export const SearchUnitBox = ({ paddingRight: 10, paddingLeft: 10, flex: 1, + flexDirection: "row", + alignItems: "center", + justifyContent: "center", }} > + {input && ( + setInput("") } + style={{ + padding: 3, + borderRadius: 15, + backgroundColor: "lightgray", + }} + > + + + )}
- {!input && - {Object.keys(lineList_LineWebID).map((d) => ( - { - const id = stationIDPair[lineList_LineWebID[d]]; - const s = isSearchMode == id ? undefined : id; - if (!s) return; - setisSearchMode(s); - }} - key={stationIDPair[lineList_LineWebID[d]]} - > - + {Object.keys(lineList_LineWebID).map((d) => ( + { + const id = stationIDPair[lineList_LineWebID[d]]; + const s = isSearchMode == id ? undefined : id; + if (!s) return; + setisSearchMode(s); + }} + key={stationIDPair[lineList_LineWebID[d]]} > - {stationIDPair[lineList_LineWebID[d]]} - - - ))} - } + + {stationIDPair[lineList_LineWebID[d]]} + +
+ ))} + + )} )} From 33435c004b8cbb78d29b199b7021e4551e819944 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Fri, 18 Jul 2025 15:41:48 +0000 Subject: [PATCH 13/13] 6.1.1 release --- components/Settings/SettingTopPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Settings/SettingTopPage.js b/components/Settings/SettingTopPage.js index 52e40f7..dc9616d 100644 --- a/components/Settings/SettingTopPage.js +++ b/components/Settings/SettingTopPage.js @@ -17,7 +17,7 @@ import { SwitchArea } from "../atom/SwitchArea"; import { useNotification } from "../../stateBox/useNotifications"; import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem"; -const versionCode = "6.1.0"; // Update this version code as needed +const versionCode = "6.1.1"; // Update this version code as needed export const SettingTopPage = ({ testNFC,