Search in sources :

Example 1 with Flip3dAnimation

use of com.aviary.android.feather.library.graphics.animation.Flip3dAnimation in project mobile-android by photo.

the class FeatherActivity method createInfoScreenAnimations.

/**
	 * Creates the info screen animations.
	 * 
	 * @param isOpening
	 *           the is opening
	 */
private void createInfoScreenAnimations(final boolean isOpening) {
    final float centerX = mViewFlipper.getWidth() / 2.0f;
    final float centerY = mViewFlipper.getHeight() / 2.0f;
    Animation mMainViewAnimationIn, mMainViewAnimationOut;
    final int duration = getResources().getInteger(R.integer.feather_config_infoscreen_animTime);
    // we allow the flip3d animation only if the OS is > android 2.2
    if (android.os.Build.VERSION.SDK_INT > 8) {
        mMainViewAnimationIn = new Flip3dAnimation(isOpening ? -180 : 180, 0, centerX, centerY);
        mMainViewAnimationOut = new Flip3dAnimation(0, isOpening ? 180 : -180, centerX, centerY);
        mMainViewAnimationIn.setDuration(duration);
        mMainViewAnimationOut.setDuration(duration);
    } else {
        // otherwise let's just use a regular alpha animation
        mMainViewAnimationIn = new AlphaAnimation(0.0f, 1.0f);
        mMainViewAnimationOut = new AlphaAnimation(1.0f, 0.0f);
        mMainViewAnimationIn.setDuration(duration / 2);
        mMainViewAnimationOut.setDuration(duration / 2);
    }
    mViewFlipper.setInAnimation(mMainViewAnimationIn);
    mViewFlipper.setOutAnimation(mMainViewAnimationOut);
}
Also used : Flip3dAnimation(com.aviary.android.feather.library.graphics.animation.Flip3dAnimation) Flip3dAnimation(com.aviary.android.feather.library.graphics.animation.Flip3dAnimation) Animation(android.view.animation.Animation) AlphaAnimation(android.view.animation.AlphaAnimation) AlphaAnimation(android.view.animation.AlphaAnimation)

Aggregations

AlphaAnimation (android.view.animation.AlphaAnimation)1 Animation (android.view.animation.Animation)1 Flip3dAnimation (com.aviary.android.feather.library.graphics.animation.Flip3dAnimation)1