From 1c67d1d48648a7d6a36ac521914a0249302677cb Mon Sep 17 00:00:00 2001 From: harukin-OneMix4 Date: Wed, 22 Feb 2023 20:03:39 +0900 Subject: [PATCH] =?UTF-8?q?ios=E3=81=A7=E3=82=82lottie=E3=82=A2=E3=83=8B?= =?UTF-8?q?=E3=83=A1=E3=81=8C=E5=8B=95=E4=BD=9C=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/駅名表/Sign.js | 37 ++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js index af44437..c415cc1 100644 --- a/components/駅名表/Sign.js +++ b/components/駅名表/Sign.js @@ -99,7 +99,6 @@ export default function Sign(props) { style={{ position: "absolute", right: -15, top: -20 }} onPress={() => { if (testButtonStatus) { - lottieRef.current.play(35, 7); const otherData = favoriteStation.filter((d) => { const compare = JSON.stringify(d); const current = JSON.stringify(currentStation); @@ -112,7 +111,6 @@ export default function Sign(props) { AS.setItem("favoriteStation", JSON.stringify(otherData)); setFavoriteStation(otherData); } else { - lottieRef.current.play(7, 35); let ret = favoriteStation; console.log(currentStation); ret.push(currentStation); @@ -122,12 +120,12 @@ export default function Sign(props) { setTestButtonStatus(!testButtonStatus); }} > - @@ -141,6 +139,37 @@ export default function Sign(props) { ); } +const LottieDelayView = ({ + progress, + speed, + style, + source, + lottieRef, + loop, +}) => { + const [progressState, setProgressState] = useState(undefined); + useEffect(() => { + if (progress == 0) { + lottieRef.current.play(progressState !== undefined ? 35 : 7, 7); + } else { + lottieRef.current.play(progressState !== undefined ? 7 : 35, 35); + } + }, [progress]); + return ( + { + console.log("finish"); + setProgressState(progress); + }} + /> + ); +}; const NexPreStationLine = ({ nexStation, preStation }) => { return (