Android: animateLayoutChanges = "true" with setVisibility (View.GONE) function

In my root location I have

android:animateLayoutChanges="true" 

which makes a great animation when I make a View that was previously in View.GONE state. The layout extends perfectly. But when I try to delete the view with

 setVisibility(View.GONE) 

he looks cool. The view disappears instantly, but the layoutchanges animation starts from where the view was, so it looks like the view disappears twice. Please help the guys! :)

+8
android xml layout animation
source share
1 answer
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { faqLayoutBinding.faqListLayout.getLayoutTransition() .enableTransitionType(LayoutTransition.CHANGING); } 

Add this code. this will solve the problem

0
source share

All Articles