Pavlo Viazovskyy Pavlo Viazovskyy - 1 year ago 122
Android Question

How to avoid blink of View when using animation?

I use translate and rotate animations to position

event. I want animations to perform instantly so I set duration for both of them to 0. But when application starts there is a short blink of my
in top left corner of screen and then it becomes positioned according to animation parameters. How can I avoid this blink?

Answer Source

I spent whole day with that problem. fillAfter and fillBefore has nothing to do with that. Try this before animation start:

view.setVisibility(View.GONE); // view is our View we trying to animate

Then set animation listener for your animation:

    animation.setAnimationListener(new AnimationListener(){
        public void onAnimationEnd(Animation animation) {

        public void onAnimationRepeat(Animation animation) {

        public void onAnimationStart(Animation animation) {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download