分岐のある駅でのアニメーション実行

This commit is contained in:
harukin-DeskMini 2022-04-22 06:21:11 +09:00
parent db218609a8
commit 3ee1d1f5ca

View File

@ -17,6 +17,24 @@ export default function Sign(props){
})
return returnData;
}
const [nexPrePosition, setNexPrePosition] = useState(0);
useEffect(()=>{
if(currentStation){
if(currentStation.length > 1){
let stationCount = setInterval(()=>{
LayoutAnimation.easeInEaseOut();
if(nexPrePosition+1 == currentStation.length){
setNexPrePosition(0)
}
else{
setNexPrePosition(nexPrePosition+1);
}
},1000)
return ()=>clearInterval(stationCount);
}
}
},[currentStation])
return(
<TouchableOpacity style={{ width: wp("80%"), height: wp("80%")/20*9,borderColor:"#2E94BB",borderWidth:1,margin:10,marginHorizontal:wp("10%")}} /* onPress={()=> !stationName.今.JrHpUrl || Linking.openURL(stationName.今.JrHpUrl)} */onPress={oP}>
<View style={{position:"absolute",bottom:"0%",left:"0%",width:"100%",height:'30%',backgroundColor:"#2E94BB"}} />
@ -77,7 +95,7 @@ export default function Sign(props){
</View>
</View>
)
})[0]
})[nexPrePosition]
})()}