Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Activity Transition in a ListView

I'm trying to accomplish the following Activity transition in Android:

enter image description here

In 1 we see an usual ListView. Now (2), when I place my finger on a ListView element and slide my finger to the left, all the other ListView elements move away, except the one which has my finger on it. If the transition if completed, the "selected" ListView element expands over the screen and shows some content.

Question: Is this transition possible with stock API functions?

like image 387
Kiril Avatar asked Jan 29 '13 09:01

Kiril


1 Answers

If you are targeting JellyBean or above, you may use ActivityOptions class to customize the activity launch animation.

Following is pseudo code for achieving this:

Intent i = //the intent for the new activity
View v = //the selected list item
Bundle bundle = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()).toBundle();
startActivity(i, bundle);
like image 150
Jiyong Park Avatar answered Sep 29 '22 20:09

Jiyong Park