Gmail like – Flip animated Multi selection list view with action mode

Gmail like – Flip animated Multi selection list view with action mode

Android Gmail App has a very beautiful and smooth multi selection list, where you can select multiple items and perform an action over the selected items.

Here in this tutorial we are going to create a similar effect on custom list where we have a image and a title and on-click of the image it gets checked with a flip animation.

Also if you are new for creating a custom list please go through my previous tutorials:

http://techiedreams.com/android-simple-custom-list-views-with-examples/

Note : In this tutorial i used ABS(Actionbar Sherlock) for the Actionbar and Actionmode to support older versions also. Please find the library in the download package import it and add it to the project.

Here’s how the final result looks like:

td_an_p13_1              td_an_p13_2

First thing prior jumping in to this tutorial you should know how this works.

1. We flip the image half way (to middle).

2. End of the animation we now have image view rotated 90° we can imagine it as a thin line.

3. Now its time to change the image to inverse of the previous (Ex: if unchecked image is showing we replace it with checked image).

4. Now we run the second animation to rotate it from middle to normal. Done!

Hope you gone thorough my custom listview tutorial and have the custom list running, now

1. Create two anim files in the ‘anim’ folder of resources.

a) to_middle.xml :

b) from_middle.xml :

 

Now Lets jump in to the Main list activity where we initialize the Adapter and set our list view. Here is how the MainActivity looks like:

 

Now, Lets jump in to the meat of the Application, The Adapter class:

 

MyListItem is an Entity where it holds the list items Name and Checked state. Here how it looks:

 

More like this: android

Comments are closed.