1

I'm making use of the following code to flip my ViewFlipper

viewFlipper.setOnClickListener(new OnClickListener() { 
                        @Override
                        public void onClick(View v) { 
                                // This is all you need to do to 3D flip
                                AnimationFactory.flipTransition(viewFlipper, FlipDirection.LEFT_RIGHT);
                        }

        });

How do I attach a listener once flipTransition is completed? Any pointers??

4

2 回答 2

3

您可以像这样从 FlipperView 获取动画。

imageViewFlipper.getAnimation().setAnimationListener(new Animation.AnimationListener() {
                  public void onAnimationStart(Animation animation) {}
                  public void onAnimationRepeat(Animation animation) {}
                  public void onAnimationEnd(Animation animation) {
                      //your code after animation end
                  }
               });

经过测试并为我工作

于 2013-10-01T11:17:39.893 回答
0

使用setAnimationListener() 这将帮助您获得 3 种方法,即

              public void onAnimationStart(Animation animation) 
              public void onAnimationRepeat(Animation animation) 
              public void onAnimationEnd(Animation animation) 

相应地制作您的代码。

in onAnimationStart()- 编写动画开始时要执行的代码

 onAnimationRepeat() - Write you want to be performed when the animation repeats.

onAnimationEnd(){

写下动画结束时要执行的操作

}
于 2013-10-01T11:28:22.493 回答