Search code examples
androidanimationcloneviewflipper

ViewFlipper 3D-Card-Flip


I started a new Android-App and I have one problem.

I want to code a ViewFlipper within some ImageViews. (Not really difficult)

The elements should turn (with this 3D-Flip anim.: http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html) when the user is clicking on them. (I have already implemented this, too).

My idea only works for the first element in the ViewFlipper. I started to inflate this first view, but the new element doesn`t flip.

Is it possible to "clone/copy" the first view with its onclick events, so that the second view is flipping, too?

Thanks for help.


Solution

  • The best and simplest solution is here: https://github.com/genzeb/flip

    Use the flip transition in any of your ViewAnimator (such as ViewFipper) by doing:

    AnimationFactory.flipTransition(viewFlipper, FlipDirection.LEFT_RIGHT);