android - animate adding item and item movement in listview -
How do I add another item from one item or move from one location to another in the list? I want to make animation effects, such as in this app: (YouTube) I'm using Extended Adapter from ResourceCursorAdapter. How do I use the new View and Bindview function to achieve this effect? Or is there another way to do this, like expanding the ListView class? I suspect that there is a ScrollView instead of a list view in any .do app but I think this is a wrong way, if you have a lot of things in the list. Any ideas?
To do this you have: 1. Slots used to be "off" items 2. List Open a "slot" in, where the item will be "land" 3. Move the item between slots.
To get the first animation, you have to make yourself invisible to see the list item, to make it disappear, you can enlarge the value of the margin below it. I wrote a blog post about the other animation I did in any ado, where I animated this value - You can use the same animation to animate the view of the list object.
"Open" animation is similar to the shutdown, but in the opposite direction, you take list items, are positioned before their "landing point", and new items are coming out to get the margin out Create spaces for.
Transferring items between items is quite easy. You must enlarge a view with the same layout as the list item, to populate it with the data of the current item, in the window manager:
WindowManager winManager = (WindowManager) Context.getSystemService (Context .WINDOW_SERVICE); WinManager.addView (..) and sync using it:
winManager.updateViewLayout (..); After the animation ends you can delete this view and refresh the list. The add item animation is done using the same concept.
P> Sorry I'm not the complete source to provide here. On my blog post you can find the code for the extension / close animation. Hope it helps!
Comments
Post a Comment