From 080505758f6b64bd42222533c2236a903189033e Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 12 Mar 2024 13:29:23 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=97=E3=81=A6?= =?UTF-8?q?=E5=86=8D=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=AB=E3=82=AF=E3=83=A9=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E3=81=99=E3=82=8B=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- menu.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/menu.js b/menu.js index 65a700f..b5305e2 100644 --- a/menu.js +++ b/menu.js @@ -100,8 +100,8 @@ export default function Menu(props) { const [currentStation, setCurrentStation] = useState(undefined); //第三要素 - const [originalStationList, setOriginalStationList] = useState(); // 第一要素 - useLayoutEffect(() => getStationList().then(setOriginalStationList), []); + const [originalStationList, setOriginalStationList] = useState([]); // 第一要素 + useEffect(() => getStationList().then(setOriginalStationList), []); const carouselRef = useRef(); const [selectedCurrentStation, setSelectedCurrentStation] = useState(0); @@ -184,7 +184,7 @@ export default function Menu(props) { - {originalStationList && allStationData.length != 0 && ( + {originalStationList.length != 0 && allStationData.length != 0 && ( )} {allStationData.length != 0 && - originalStationList && + originalStationList.length != 0 && allStationData[selectedCurrentStation] && ( Date: Tue, 12 Mar 2024 14:24:43 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A6=99=E3=81=AA=E6=8C=99=E5=8B=95?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/DynamicHeaderScrollView.js | 88 ++++++++++++++------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/components/DynamicHeaderScrollView.js b/components/DynamicHeaderScrollView.js index 106e95a..a381887 100644 --- a/components/DynamicHeaderScrollView.js +++ b/components/DynamicHeaderScrollView.js @@ -1,5 +1,5 @@ -import { ScrollView, View, Animated, Platform } from "react-native"; -import React, { useRef } from "react"; +import { ScrollView, View, Animated, LayoutAnimation } from "react-native"; +import React, { useState } from "react"; export const DynamicHeaderScrollView = (props) => { const { @@ -13,43 +13,51 @@ export const DynamicHeaderScrollView = (props) => { topStickyContent, styles, } = props; - const scrollOffsetY = useRef(new Animated.Value(0)).current; const Scroll_Distance = Max_Header_Height - Min_Header_Height; - const animatedHeaderHeight = scrollOffsetY.interpolate({ - inputRange: [Scroll_Distance, Scroll_Distance + 30], - outputRange: [Max_Header_Height, 0], - extrapolate: "clamp", - }); - const animatedHeaderHeight2 = scrollOffsetY.interpolate({ - inputRange: [Scroll_Distance, Scroll_Distance + 30], - outputRange: [Max_Header_Height, Min_Header_Height], - extrapolate: "clamp", - }); - const animatedHeaderVisible = scrollOffsetY.interpolate({ - inputRange: [Scroll_Distance - 30, Scroll_Distance], - outputRange: [1, 0], - extrapolate: "clamp", - }); - const animatedHeaderVisible2 = scrollOffsetY.interpolate({ - inputRange: [Scroll_Distance - 30, Scroll_Distance + 30], - outputRange: [0, 1], - extrapolate: "clamp", - }); + const [headerVisible, setHeaderVisible] = useState(false); + const shotHeaderStyle = { + on: { + height: Min_Header_Height, + backgroundColor: "#0099CC", + margin: 0, + top: 0, + opacity: 1, + }, + off: { + height: Max_Header_Height, + backgroundColor: "#0099CC", + margin: 0, + top: 0, + opacity: 0, + }, + }; + + const longHeaderStyle = { + on: { + height: Max_Header_Height, + backgroundColor: "#0099CC", + margin: 0, + top: 0, + opacity: 1, + }, + off: { + height: 0, + backgroundColor: "#0099CC", + margin: 0, + top: 0, + opacity: 1, + }, + }; + return ( {shortHeader} @@ -57,13 +65,7 @@ export const DynamicHeaderScrollView = (props) => { {longHeader} @@ -77,10 +79,14 @@ export const DynamicHeaderScrollView = (props) => { }} stickyHeaderIndices={[1]} scrollEventThrottle={16} - onScroll={Animated.event( - [{ nativeEvent: { contentOffset: { y: scrollOffsetY } } }], - { useNativeDriver: false } - )} + onScroll={(event) => { + const scrollY = event.nativeEvent.contentOffset.y; + LayoutAnimation.configureNext({ + duration: 100, + update: { type: "easeOut" }, + }); + setHeaderVisible(Scroll_Distance < scrollY); + }} > Date: Tue, 12 Mar 2024 14:36:37 +0000 Subject: [PATCH 3/3] 5.0.1 --- components/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/settings.js b/components/settings.js index 6061d5d..c60c6a9 100644 --- a/components/settings.js +++ b/components/settings.js @@ -174,7 +174,7 @@ export default function Setting(props) { textAlignVertical: "center", }} > - 内部バージョン: 5.0 + 内部バージョン: 5.0.1