user2426316
user2426316

Reputation: 7331

How can I animate a Fragment inside a viewpager?

I have got a viewpager that hosts two Fragments. Now I would like to replace one of the Fragments on a button click. How can I animate this replacement? (e.g. using the flip-card effect)

Since it is difficult two put all my code in here, this is what I basically use http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html

Upvotes: 3

Views: 3333

Answers (1)

Ben Pearson
Ben Pearson

Reputation: 7752

You can animate it using a PageTransformer

Or, if you want the animation on replacing a fragment, you can set a custom animation on the FragmentTransaction

Upvotes: 4

Related Questions