From 789af1aa37550568fdc3b242ebb51e5743d7c84b Mon Sep 17 00:00:00 2001 From: harukin-OneMix4 Date: Fri, 29 Dec 2023 01:36:37 +0900 Subject: [PATCH] =?UTF-8?q?ActionSheet=E3=81=AEScrollView=E3=81=AE?= =?UTF-8?q?=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=81?= =?UTF-8?q?=E5=90=8C=E6=99=82=E3=81=AB=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActionSheetComponents/EachTrainInfo.js | 34 +++++++++++-------- .../ActionSheetComponents/JRSTraInfo.js | 18 ++++++---- .../StationDeteilView.js | 2 +- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/components/ActionSheetComponents/EachTrainInfo.js b/components/ActionSheetComponents/EachTrainInfo.js index 71599d4..ecaa412 100644 --- a/components/ActionSheetComponents/EachTrainInfo.js +++ b/components/ActionSheetComponents/EachTrainInfo.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import React, { useEffect, useState, useRef } from "react"; import { View, LayoutAnimation, @@ -11,7 +11,10 @@ import { Platform, } from "react-native"; import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"; -import ActionSheet, { SheetManager } from "react-native-actions-sheet"; +import ActionSheet, { + SheetManager, + useScrollHandlers, +} from "react-native-actions-sheet"; import { AS } from "../../storageControl"; import LottieView from "lottie-react-native"; import trainList from "../../assets/originData/trainList"; @@ -239,13 +242,18 @@ export const EachTrainInfo = (props) => { .replace("マリン", "マリンライナー") .replace("ライナーライナー", "ライナー"); }; - + const actionSheetRef = useRef(null); + const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef); return ( - }> + } + ref={actionSheetRef} + > { )} { if (!Platform.OS !== "android") return; setIsTop(e.nativeEvent.contentOffset.y < 0); }} > - + {/* { const { getTime, delayData, loadingDelayData, setLoadingDelayData } = useTrainDelayData(); + const actionSheetRef = useRef(null); + const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef); return ( - }> + } + ref={actionSheetRef} + > { }} /> - + {loadingDelayData ? ( diff --git a/components/ActionSheetComponents/StationDeteilView.js b/components/ActionSheetComponents/StationDeteilView.js index 9d33582..5d45976 100644 --- a/components/ActionSheetComponents/StationDeteilView.js +++ b/components/ActionSheetComponents/StationDeteilView.js @@ -50,7 +50,7 @@ export const StationDeteilView = (props) => { key={currentStation} style={{ backgroundColor: "white", - borderRadius: 5, + borderTopRadius: 5, borderColor: "dark", borderWidth: 1, }}