I have some views in the constraint layout. I used animation to reveal and hide the view. When the view is GONE, it blinks for a second and become visible and then gone.
view.animate()
.alpha(0.0f)
.setDuration(300)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
view.setVisibility(View.GONE);
}
});
I tried your posted code and it seems to work just fine, except when animateLayoutChanges is turned on for the parent of the view you are trying to animate. If you have that enabled in the layout xml, turn it off and try again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With