Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does animateLayoutChanges work on ListView?

a listView is a ViewGroup and seems like a good candidate for having animated layout changes. However, it seems to disregard the flag or constructing a LayoutTransition manually and setting it up that way. What gives? It's not documented anywhere that this very important ViewGroup doesn't support this very import animation feature.

like image 349
John Wheeler Avatar asked Sep 27 '12 18:09

John Wheeler


2 Answers

Unfortunately, no, the ListView doesn't support android:animateLayoutChanges, at least not in the way you expect it to. It'll just animate the children the ListView has to create when it can't reuse an existing view.

like image 119
goncalossilva Avatar answered Sep 29 '22 04:09

goncalossilva


I add that using the option android:animateLayoutChanges="true" in the layout of the ListView prevents you from selecting any item of the ListView; you can do that, only after doing something like adding a new item and returning to the ListView. I have experienced this bug using the SimpleCursorAdapter up-to-date and the one that comes with v4 support library

Regards FD

like image 22
user2270629 Avatar answered Sep 29 '22 05:09

user2270629