分岐のある駅でのアニメーション実行
This commit is contained in:
parent
db218609a8
commit
3ee1d1f5ca
@ -17,6 +17,24 @@ export default function Sign(props){
|
|||||||
})
|
})
|
||||||
return returnData;
|
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(
|
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}>
|
<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"}} />
|
<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>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
})[0]
|
})[nexPrePosition]
|
||||||
|
|
||||||
})()}
|
})()}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user