Skip to content Skip to sidebar Skip to footer

3d Flip Animation On Android.support.v4.fragment

I am currently reading this tutorial: http://developer.android.com/training/animation/cardflip.html on flip Animations of Fragments. Unfortunately, the object-animator is only av

Solution 1:

You can use NineOldAndroids. It backports the Honeycomb (Android 3.0) animation API all the way back to Android 1.0. You'll get ObjectAnimator, ValueAnimator and all the other good stuff.

Solution 2:

Thank you all for your help.

I managed to solve my problem. The solution has to do with NineOldAndroids and another Library with support-v4 support for NineOldAndroids.

What I did:

  • I downloaded this library: https://github.com/kedzie/Support_v4_NineOldAndroids (This is a support library for NineOldAndroids)
  • Imported it into my workspace
  • Downloaded the NineOldAndroids Library and imported it into my workspace
  • Imported the NineOldAndroids library into the support-v4 Library
  • Imported the support-v4-nineoldandroids library into my project
  • Did the Filp-Animation

Solution 3:

In case if you are not supporting below api<3

use the same code as given in: https://stuff.mit.edu/afs/sipb/project/android/docs/training/animation/cardflip.html

just tweaked the flipCard method to:

privatevoidflipCard() {
if (mShowingBack) {
    mShowingBack = false;
    FragmentTransactiontrans= getActivity().getFragmentManager().beginTransaction();
    trans.setCustomAnimations(R.animator.card_flip_right_in,
            R.animator.card_flip_right_out,
            R.animator.card_flip_left_in,
            R.animator.card_flip_left_out)
         .replace(R.id.memberCardContainer, newCardFrontFragment())
         .commit();
    return;
}

// Flip to the back.
mShowingBack = true;
FragmentTransactiontrans= getActivity().getFragmentManager().beginTransaction();
trans.setCustomAnimations(R.animator.card_flip_right_in,
        R.animator.card_flip_right_out,
        R.animator.card_flip_left_in,
        R.animator.card_flip_left_out)
     .replace(R.id.memberCardContainer, newCardBackFragment())
     .commit();
}

Post a Comment for "3d Flip Animation On Android.support.v4.fragment"