开发者

How to trigger an animation when a layout animation ends

I have a custom 3d flip that needs to get the root view to access the two views that are flipped, like this: v.startAnimation(new Flip3D(v));

Then, I have a grid layout with a GridLayoutAnimationController that loads a simple scale animation.

What i'm trying, is to 开发者_如何学JAVAtrigger the 3d flip on each child when the layout animation ends.

Is it possible? How can I get the view that has ended the animation to start the 3d animation?

What I tried is to attach an animation listener to the scale animation and count how many times onAnimationEnd gets called. Each time a view of the grid finish the animation I access the grid child at that position to start the 3d flip animation but, it has no effect.

Any idea?


I think you can use onAnimationEnd() see here the doc : http://developer.android.com/reference/android/view/View.html#onAnimationEnd%28%29

Here is an example how to use it: android animation is not finished in onAnimationEnd

Something like:

mAnimation.setAnimationListener(new AnimationListener() {
    @Override
    public void onAnimationEnd(Animation arg0) {
                       //Functionality here
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜