Android Animation Flicker

前端 未结 6 1377
天命终不由人
天命终不由人 2020-11-30 11:17

I\'ve been trawling through as many threads on this topic that I can find on the flicker that arises in Android 2.2 when dealing with AnimationListeners, but I can\'t quite

6条回答
  •  一个人的身影
    2020-11-30 11:52

    I had the same problem and after few days I found the solution ... thanx to:

    http://www.mail-archive.com/android-developers@googlegroups.com/msg67535.html

    I figured out a solution to this problem. The clue came from the fact that when showing the view, everything worked fine. Apparently, when the animation is running, the update that would be forced by the show happens in the background and doesn't cause the flicker. Adding a short animation to the back end of the onAnimationEnd() when we are hiding the view makes the flicker go away.

    Here is the new onAndimationEnd() in the working code

      public void onAnimationEnd(Animation animation) {
                animation = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
                animation.setDuration(1);
                mPlayer0Panel.startAnimation(animation);
       } 
    

提交回复
热议问题