Listener for ViewFlipper widget flipping events

前端 未结 5 1531
情话喂你
情话喂你 2020-12-09 09:12

I have a ViewFlipper implementation that needs to be improved. This ViewFlipper has three child views. Basically, I want an indicator on which child view is currently active

5条回答
  •  伪装坚强ぢ
    2020-12-09 09:32

    If you apply animation (out or in animation) on view switching, you can set listener to an animation and, for example, act on animation end.

       viewFlipper.getInAnimation().setAnimationListener(new Animation.AnimationListener() {
          public void onAnimationStart(Animation animation) {}
          public void onAnimationRepeat(Animation animation) {}
          public void onAnimationEnd(Animation animation) {}
       });
    

提交回复
热议问题