Any way to animate new elements in a GridView being added?
My app polls a server every 15 seconds to see if there are any new items to display, then downloads the new items and disposes of the old items so that there are always exactly 100 items in the GridView. Unfortunately, this process can be confusing to the user if they see a page of images change without knowing where the items went.
My idea is that there could be some kind of animation (such as the new items being inserted at the top and pushing the older ones down the list) to show what action is happening. Unfortunately, I have no clue how to make this animation happen.
Is my idea even possible? How would I accomplish 开发者_如何学Cthis?
Ben,
I know it's been almost a year since you posted this question. But I thought this might help you out.
http://developer.android.com/reference/android/view/animation/GridLayoutAnimationController.html
I think you will have to extend this layout and somehow pass in the position of the changes.
There are like 10 animations examples in the sdk (you will have to download them using the updates manager); the example is called "API demos". First, you can take a look of the Views -> animations examples... though, in your case the more interesting ones can be found in Views -> LayoutAnimatons.
精彩评论