質問

I am using RotateAnimation to animate pointing arrow that updates its position when of user updates destination point or current device position changes. I'm using interpolator.accelerate_decelerate to make animation look more smooth and "physical".

Everything goes fine until another update arrives when current animation is still processing, for example, when user changes destination while pointing arrow is still rotating. When such happens, the arrow makes a sharp bounce which looks ugly, and I'm trying to avoid this. I tried to implement a queue to make every next animation wait until previous ends and it looks nice, but behavior became quite illogical.

So my questions are following:

1) is there some way to make animated transitions more smooth in the cases when animations start one by one and overlap each other?

2) is there a way to stop animation that is currently processing and get intermediate position of an object?--if I decide to stop animation before its end and use current position as starting point for next animation.

役に立ちましたか?

解決

ok so the easiest is to create a custom Animation similar to RotateAnimation and saving the current rotation angle in applyTransformation, this angle can be then used as a start angle for next Animation thus avoiding the "jumps"

他のヒント

A custom class extending ImageView that performs animation based on angular movement of dipole in magnetic field:

https://stackoverflow.com/a/22738030/3459206

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top