I have a CardView
with a supporting text on the bottom that is GONE
by default. I want to make this section of the
Right before you change the visibility, add this line of code:
TransitionManager.beginDelayedTransition(the rootView containing the cardView, new AutoTransition());
You should get a smooth animation. Also remove "animateLayoutChanges=true" from your xml before this.
As for why this works, calling TransitionManager.beginDelayedTransition() makes the TransitionManger capture current values in the parent ViewGroup and render the animations in the next animation frame. The Transition passed in this case is an AutoTransition, which takes care of all the fading, moving, and resizing in the parent ViewGroup.
See Transitions and TransitionManager
Also take care to use Transitions from the support library where appropriate, or perform the neccessary API level checks.