Merge commit '8a1b8c94f31dc1d359ecc1f380ca0c2393649fd8' into develop

This commit is contained in:
harukin-expo-dev-env 2025-07-15 04:52:04 +00:00
commit ca4b9e7c2d
21 changed files with 163 additions and 100 deletions

View File

@ -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 (
<Stack.Navigator>
<Stack.Screen

View File

@ -21,7 +21,6 @@ export const LandscapeTrainInfo = (props) => {
width: width / 2,
}}
>
<Text>{width / 2}</Text>
{leftContent}
</View>
<ScrollView

View File

@ -11,14 +11,8 @@ export const LongHeader = ({
}) => {
return (
<ScrollView
//onTouchStart={() => setActionSheetHorizonalScroll(true)}
//onScrollEndDrag={() => setActionSheetHorizonalScroll(false)}
//onScrollBeginDrag={() => console.log("onScrollBeginDrag")}
style={{
flexDirection: "row",
//width: widthPercentageToDP("200%"),
// minHeight: 200,
//height: heightPercentageToDP("20%"),
}}
horizontal
pagingEnabled

View File

@ -11,15 +11,9 @@ export const ShortHeader = ({
}) => {
return (
<ScrollView
//onTouchStart={() => setActionSheetHorizonalScroll(true)}
//onScrollEndDrag={() => setActionSheetHorizonalScroll(false)}
//onScrollBeginDrag={() => console.log("onScrollBeginDrag")}
style={{
flexDirection: "row",
flex: 1,
//width: widthPercentageToDP("200%"),
// minHeight: 200,
//height: heightPercentageToDP("20%"),
}}
horizontal
pagingEnabled

View File

@ -36,7 +36,7 @@ export const StationDeteilView = (props) => {
setTrainBus();
}
setTrainBus(data[0]);
}, [currentStation]);
}, [currentStation, busAndTrainData]);
const [usePDFView, setUsePDFView] = useState(undefined);
useEffect(() => {

View File

@ -104,7 +104,7 @@ export const CarouselBox = ({
}}
>
<Text style={{ color: "#0099CC", fontSize: 20 }}>
{!!isSearchMode ? "路線検索モードです。上に並んでいる路線を選んでみましょう!" :stationListMode == "position"
{!!isSearchMode ? "路線検索モードです。入力欄に駅名やナンバリングを入力したり、上に並んでいる路線を選んでみましょう!" :stationListMode == "position"
? "現在地の近くに駅がありません。"
: "お気に入りリストがありません。お気に入りの駅を追加しよう!"}
</Text>

View File

@ -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,9 +20,9 @@ export const CarouselTypeChanger = ({
setMapMode,
isSearchMode,
setisSearchMode,
input,
setInput,
}) => {
const tabBarHeight = useBottomTabBarHeight();
const { height, width } = useWindowDimensions();
const returnToDefaultMode = () => {
LayoutAnimation.configureNext({
duration: 300,
@ -44,8 +39,9 @@ export const CarouselTypeChanger = ({
};
return (
<KeyboardAvoidingView
behavior="padding"
keyboardVerticalOffset={80}
behavior="position"
contentContainerStyle={{ flex: 1, flexDirection: "row" }}
keyboardVerticalOffset={mapMode ? 0 : 45}
enabled={Platform.OS === "ios"}
style={{
width: "100%",
@ -61,6 +57,8 @@ export const CarouselTypeChanger = ({
<SearchUnitBox
isSearchMode={isSearchMode}
setisSearchMode={setisSearchMode}
input={input}
setInput={setInput}
/>
<TouchableOpacity
style={{

View File

@ -12,7 +12,12 @@ import Ionicons from "react-native-vector-icons/Ionicons";
import { useWindowDimensions } from "react-native";
import lineColorList from "@/assets/originData/lineColorList";
import { lineList_LineWebID, stationIDPair } from "@/lib/getStationList";
export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
export const SearchUnitBox = ({
isSearchMode,
setisSearchMode,
input,
setInput,
}) => {
const { height, width } = useWindowDimensions();
return (
<>
@ -39,16 +44,42 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
>
{!isSearchMode && <Ionicons name="search" size={30} color="white" />}
{!!isSearchMode && (
<View style={{ backgroundColor: "#0099CC" }}>
<View
style={{
backgroundColor: "#0099CC",
flexDirection: "column",
display: "flex",
flex: 1,
}}
>
<View
style={{
backgroundColor: "white",
borderRadius: 25,
height: 30,
paddingRight: 10,
paddingLeft: 10,
flex: 1,
}}
>
<TextInput
placeholder="駅名や駅ナンバリングを入力してフィルタリングします。"
onEndEditing={() => {}}
onChange={(ret) => setInput(ret.nativeEvent.text)}
value={input}
style={{ flex: 1 }}
/>
</View>
<View style={{ flexDirection: "row", alignItems: "center" }}>
<TouchableOpacity onPress={() => {
LayoutAnimation.configureNext({
duration: 100,
update: { type: "easeInEaseOut", springDamping: 0.6 },
});
setisSearchMode(false);
}}>
<TouchableOpacity
onPress={() => {
LayoutAnimation.configureNext({
duration: 100,
update: { type: "easeInEaseOut", springDamping: 0.6 },
});
setisSearchMode(false);
}}
>
<Ionicons
name="arrow-back"
size={20}
@ -60,7 +91,8 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
<TouchableOpacity
style={{
flex: 1,
backgroundColor: lineColorList[stationIDPair[lineList_LineWebID[d]]],
backgroundColor:
lineColorList[stationIDPair[lineList_LineWebID[d]]],
padding: 5,
marginHorizontal: 2,
borderRadius: 10,
@ -68,7 +100,12 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
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 +123,6 @@ export const SearchUnitBox = ({ isSearchMode, setisSearchMode }) => {
</Text>
</TouchableOpacity>
))}
{/* <View
style={{
backgroundColor: "white",
borderRadius: 25,
height: 30,
paddingRight: 10,
paddingLeft: 10,
flex: 1,
}}
>
<TextInput
placeholder="駅名を入力してフィルタリングします。"
//onFocus={() => setKeyBoardVisible(true)}
onEndEditing={() => {}}
//onChange={(ret) => setInput(ret.nativeEvent.text)}
//value={input}
style={{ flex: 1 }}
/>
</View> */}
</View>
</View>
)}

View File

@ -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";

View File

@ -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}

View File

@ -1,4 +1,3 @@
import 'babel-polyfill';
import { registerRootComponent } from "expo";
import { registerWidgetTaskHandler } from "react-native-android-widget";
import { Platform } from "react-native";

View File

@ -46,6 +46,6 @@ export const findReversalPoints = (array, stopStationIDList) => {
return allThroughStation;
}
} catch (e) {
console.log(e);
// エラーが発生した場合は空の配列を返す
}
};

View File

@ -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 == );

57
menu.js
View File

@ -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
@ -43,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();
@ -173,24 +172,35 @@ 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]);
});
});
});
} else {
const hoge = getStationDataFromNameBase(input);
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") {
@ -275,9 +285,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) {
@ -363,8 +373,6 @@ export default function Menu(props) {
{...{
locationStatus,
position,
mapsRef,
scrollRef,
stationListMode,
setStationListMode,
setSelectedCurrentStation: setListIndex,
@ -372,6 +380,8 @@ export default function Menu(props) {
setMapMode,
isSearchMode,
setisSearchMode,
input,
setInput,
}}
/>
)}
@ -387,7 +397,7 @@ export default function Menu(props) {
listIndex,
navigate,
stationListMode,
isSearchMode
isSearchMode,
}}
/>
{listUpStation[listIndex] && (
@ -409,7 +419,6 @@ export default function Menu(props) {
{...{
locationStatus,
position,
mapsRef,
stationListMode,
setStationListMode,
setSelectedCurrentStation: setListIndex,
@ -417,6 +426,8 @@ export default function Menu(props) {
setMapMode,
isSearchMode,
setisSearchMode,
input,
setInput,
}}
/>
)}

View File

@ -119,8 +119,10 @@ setInterval(() => {
javaScriptEnabled={true}
injectedJavaScript={jsa}
pullToRefreshEnabled
onError={() => this.webView?.reload()}
onMessage={()=>{}}
onError={() => webview.current?.reload()}
onMessage={() => {
// 必要に応じてメッセージ処理を実装
}}
/>
<ReloadButton
onPress={() => webview.current.reload()}

View File

@ -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": {

View File

@ -62,7 +62,7 @@ export const CurrentTrainProvider = ({ children }) => {
setCurrentTrainLoading("success");
})
.catch(() => {
console.log("えらー");
// エラー時の処理
setCurrentTrainLoading("error");
});
});

View File

@ -42,7 +42,12 @@ export const FavoriteStationProvider:FC<Props> = ({ children }) => {
const returnData = JSON.parse(d);
setFavoriteStation(returnData);
})
.catch((d) => console.log(d));
.catch((error) => {
// エラーログを記録(開発時のみ)
if (__DEV__) {
console.warn('お気に入り駅の読み込みに失敗しました:', error);
}
});
}, []);
return (
<FavoriteStationContext.Provider

View File

@ -26,7 +26,7 @@ Notifications.setNotificationHandler({
});
function handleRegistrationError(errorMessage: string) {
console.log(errorMessage);
// エラーを適切に処理(必要に応じてユーザーに通知)
//throw new Error(errorMessage);
}
@ -117,12 +117,10 @@ export const NotificationProvider: FC<Props> = ({ children }) => {
notificationListener.current =
Notifications.addNotificationReceivedListener((notification) => {
setNotification(notification);
});
responseListener.current =
Notifications.addNotificationResponseReceivedListener((response) => {
console.log(response);
});
}); responseListener.current =
Notifications.addNotificationResponseReceivedListener((response) => {
// 通知レスポンスの処理
});
return () => {
notificationListener.current &&

View File

@ -16,6 +16,7 @@ type initialStateType = {
setOriginalStationList: React.Dispatch<React.SetStateAction<any[]>>;
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<Props> = ({ 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<any[][]>([[]]);
useEffect(() => {
if (originalStationList.length === 0) return;
@ -113,6 +132,7 @@ export const StationListProvider: FC<Props> = ({ children }) => {
setOriginalStationList,
getStationDataFromName,
getStationDataFromId,
getStationDataFromNameBase,
stationList,
getInjectJavascriptAddress,
}}

View File

@ -2,11 +2,11 @@
"compilerOptions": {
"plugins": [
{
"@/*": ["./*"] //
"@/*": ["./*"]
}
],
"paths": {
"@/*": ["./*"] //
"@/*": ["./*"]
}
},
"extends": "expo/tsconfig.base"