kerutf
kerutf

Reputation: 51

How does recyclerView.scheduleLayoutAnimation() work?

Could someone explain me how recyclerView.scheduleLayoutAnimation() method works, and how to use it?

Upvotes: 1

Views: 1200

Answers (1)

Yida Lin
Yida Lin

Reputation: 187

Per the documentation: https://developer.android.com/reference/android/view/ViewGroup#scheduleLayoutAnimation()

public void scheduleLayoutAnimation ()

Schedules the layout animation to be played after the next layout pass of this view group. This can be used to restart the layout animation when the content of the view group changes or when the activity is paused and resumed.

A typical use is to re-introduce the animation when you refresh the items in your recycler view.

Usage:

myAdapter.notifyDataSetChanged();
recyclerView.scheduleLayoutAnimation();

Upvotes: 0

Related Questions