Reputation: 18846
I want to apply animation effects (for example, such as translate) to object after animation is finished. Ive used fillAfter="true" property, it's worked but there is another problem. When animation finished with this property, its look like object gets new positions. But then I use second animation to this object and object's positions are restore and animation goes from old position... I hope you understand me... (I think the problem is that animations apply to the View matrix, not to the object matrix) SDK 2.2 (not 3((()
so, Can you say me what should I do?
After the first animation I've stored animated positions (xTo and yTo) and then when I've used second animation I started from this xTo and yTo positions to the new xTo and yTo positions. That's all. Thanks
Upvotes: 0
Views: 623
Reputation: 18846
my answer:
After the first animation I've stored animated positions (xTo and yTo) and then when I've used second animation I started from this xTo and yTo positions to the new xTo and yTo positions. That's all. Thanks
Upvotes: 0
Reputation: 1007265
android:fillAfter="true"
is probably not what you want. That only affects the pixels, not the widget itself (e.g., where it responds to touch events).
Instead, you need to add an AnimationListener
to your Animation
, and in onAnimationEnd()
, do something to more permanently implement the change. For example, if you are translating a widget off-screen, in onAnimationEnd()
you could call setVisibility(View.GONE)
to make it disappear.
Upvotes: 1