Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a flip animation available to use when transitioning between activities?

When transitioning between activities, such as calling startActivity(); or when using the back button, the screen slides in from the sides.

Is there any way to alter this? I have a flash-card like application, so when I move from activity A to activity B I would like the screen to flip over like turning a real flash card.

Is there any way to do this out of the box? Or does this require some custom animations?

like image 428
Jimmy Avatar asked Apr 15 '11 11:04

Jimmy


2 Answers

Since Android 2.0 (API Level 5), you can use Activity.overridePendingTransition specify an explicit transition animation .

see http://developer.android.com/reference/android/app/Activity.html#overridePendingTransition(int, int)

like image 195
ftao Avatar answered Nov 16 '22 14:11

ftao


As far as I know, the applications have no control over the transitions between their activities.

What you could do is merge the two activities using a custom ViewGroup that changes between the two Views using any animation you like. It's not trivial but should certainly be doable.

like image 1
Delyan Avatar answered Nov 16 '22 14:11

Delyan