Because my animation blinks after I finish

0

I have a method that animates a view down and leaves it with the visibility "GONE" however, I'm getting this strange behavior that is this blink that the view of after the animation is finished. My method:

        layoutaserretirado.animate()
            .translationY(layoutaserretirado.getHeight())
            .alpha(0.0f)
            .setDuration(500)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    layoutaserretirado.setVisibility(View.GONE);

                }
            });
    ConstraintSet set = new ConstraintSet();
    ConstraintLayout constraintlayoutaudio = findViewById(R.id.constraintlayoutaudio);
    set.clone(constraintlayoutaudio);
    set.connect(R.id.layoutbaixandoaudio,ConstraintSet.BOTTOM,R.id.imageViewaudio,ConstraintSet.TOP,16);
    TransitionManager.beginDelayedTransition(constraintlayoutaudio);
    set.applyTo(constraintlayoutaudio);

    
asked by anonymous 09.02.2018 / 02:23

0 answers