0

I want to implement ImageView RotationXBy(180f) when my dropDown is being shown. So the problem is when user clicks on view very fast, my arrow view dissapears/rotates into a very small. How to handle multiple animation start with cancelling the previous animation?

I call the animation when user clicks the view:

spinner_petType.setOnShowListener(object : EditSpinner.OnShowListener {
    override fun onShow() {
        arrow_down_type.animate()
            .rotationXBy(180f)
            .duration = 200
        hideSoftInputPanel()
    }
})

And when user dismiss the dropDown:

spinner_petType.setOnDismissListener {
    arrow_down_type.animate()
        .rotationXBy(180f).duration = 200
}

So the animation don't wait until the other animation end. I tried to add Listener and disable view, but this method breaks my logic. Help!

  • Does this answer your question? [Android Animation: Wait until finished?](https://stackoverflow.com/questions/5321344/android-animation-wait-until-finished) – user3738870 Nov 08 '22 at 12:04

0 Answers0