user1854307
user1854307

Reputation: 630

Android recyclerview defauilitemanimator change duration

I use recyclerview for dynamic list. After insert and removed items recyclerview performs a sharp update. I use DefaultItemAnimator for more beautiful update I list.

optionList2.itemAnimator = DefaultItemAnimator()

I would like to try to increase the delay for the animation. Can you tell me how to do this?

Upvotes: 0

Views: 1182

Answers (1)

Akaki Kapanadze
Akaki Kapanadze

Reputation: 2672

Use set(Change/Add/Move/Remove)Duration method:

optionList2.itemAnimator = DefaultItemAnimator().apply {
                changeDuration = 250
                addDuration  = 250
                moveDuration = 250
                removeDuration = 250
            }

Upvotes: 5

Related Questions