onAnimationEnd is not getting called, onAnimationStart works fine

后端 未结 14 1719
情书的邮戳
情书的邮戳 2020-12-23 19:51

I\'ve a ScrollView in the PopupWindow. I\'m animating ScrollView contents using TranslateAnimation.

When animation starts, the onAnimationStart listener is called bu

14条回答
  •  难免孤独
    2020-12-23 20:22

    I tried your code it's working fine at OnAnimation start and inAmimationEnd also , after duration time means after finish animation onAnimationEnd is called , so your code working fine

    TranslateAnimation anim =new TranslateAnimation(0, 0, -60, 0);
            anim.setDuration(1000);     
            anim.setAnimationListener(new Animation.AnimationListener() {
                    public void onAnimationStart(Animation a) {
                        Log.w("Start", "---- animation start listener called"  );
                    }
                    public void onAnimationRepeat(Animation a) {}
                    public void onAnimationEnd(Animation a) {
                        Log.d(" end  ","---- animation end listener called"  );
                    }
                });
                mIv.setAnimation(anim);
                mIv.startAnimation(anim);
    

提交回复
热议问题