Android Flipboard animation

I want to animate a Flipboard while changing views in Android.

Is it possible to animate a Flipboard on whole layout? Something similar to those letters on the picture but the whole layout.

  • How to set webview client?
  • Sugar ORM just won't create tables
  • Facebook messenger accessibility
  • Trouble building the GCM Demo Server application
  • How to determine a long touch on android?
  • can not setInterval in onLocationChanged
  • For example:

    // whole layout design

    I would like to make an animation when changing this Layout and/or inflating another to do the Flipboard animation.

    Flipboard animation

    The animation should look exactly like this one

    Related posts:

    Loading a resource to a mutable bitmap
    Android resource notlong / long identifiers not working
    Making N sequential api calls using RxJava and Retrofit
    Trouble connecting to LG phone with adb (Mac OS X 10.7.5)
    How to programmatically add view in ViewFlipper
    Android Firebase - &ldquo;onDataChange&rdquo; And &ldquo;onCancelled&rdquo; Not Bein...
  • Escape “ ” in Text in TextView
  • Android Camera onPreviewFrame frame rate not consistent
  • How do I stop the monkey madness?
  • Where can I find stats on Android distribution (number of devices) by cpu?
  • Android: there is an error when i click on my editText
  • Android Gradle Read App Name from strings.xml
  • 2 Solutions collect form web for “Android Flipboard animation”

    The answer of this Question is on GitHub. Very nice example provided by OpenAphid. Visit this link.

    Use following Codes They are exactly for your requirement:

    Class 1:

    import android.view.Display;
    import android.view.View;
    import android.view.WindowManager;
    import android.view.animation.AccelerateInterpolator;
    import android.view.animation.Animation;
         * A class that is responsible switching the mode with the flip animation 
        public class ViewSwitcher {
            private final static int DURATION = 500;
            private final static float DEPTH = 400.0f;
            public interface AnimationFinishedListener {
                 * Called when the animation is finished.
                public void onAnimationFinished();
            public static void animationIn(View container, WindowManager windowManager) {
                animationIn(container, windowManager, null);
            public static void animationIn(View container, WindowManager windowManager, AnimationFinishedListener listener) {
                apply3DRotation(90, 0, false, container, windowManager, listener);
            public static void animationOut(View container, WindowManager windowManager) {
                animationOut(container, windowManager, null);
            public static void animationOut(View container, WindowManager windowManager, AnimationFinishedListener listener) {
                apply3DRotation(0, -90, true, container, windowManager, listener);
            private static void apply3DRotation(float fromDegree, float toDegree, boolean reverse, View container, WindowManager windowManager, final AnimationFinishedListener listener) {
                Display display = windowManager.getDefaultDisplay();
                final float centerX = display.getWidth() / 2.0f;
                final float centerY = display.getHeight() / 2.0f;
                final Rotate3dAnimation a = new Rotate3dAnimation(fromDegree, toDegree, centerX, centerY, DEPTH, reverse);
                a.setInterpolator(new AccelerateInterpolator());
                if (listener != null) {
                    a.setAnimationListener(new Animation.AnimationListener() {
                        public void onAnimationStart(Animation animation) {
                        public void onAnimationRepeat(Animation animation) {
                        public void onAnimationEnd(Animation animation) {
                if(container != null){
                else if (listener != null)

    class 2:

    import android.view.animation.Animation;
    import android.view.animation.Transformation;
     * An animation that rotates the view on the Y axis between two specified angles.
     * This animation also adds a translation on the Z axis (depth) to improve the effect.
    public class Rotate3dAnimation extends Animation {
        private final float mFromDegrees;
        private final float mToDegrees;
        private final float mCenterX;
        private final float mCenterY;
        private final float mDepthZ;
        private final boolean mReverse;
        private Camera mCamera;
         * Creates a new 3D rotation on the Y axis. The rotation is defined by its
         * start angle and its end angle. Both angles are in degrees. The rotation
         * is performed around a center point on the 2D space, definied by a pair
         * of X and Y coordinates, called centerX and centerY. When the animation
         * starts, a translation on the Z axis (depth) is performed. The length
         * of the translation can be specified, as well as whether the translation
         * should be reversed in time.
         * @param fromDegrees the start angle of the 3D rotation
         * @param toDegrees the end angle of the 3D rotation
         * @param centerX the X center of the 3D rotation
         * @param centerY the Y center of the 3D rotation
         * @param reverse true if the translation should be reversed, false otherwise
        public Rotate3dAnimation(float fromDegrees, float toDegrees,
                float centerX, float centerY, float depthZ, boolean reverse) {
            mFromDegrees = fromDegrees;
            mToDegrees = toDegrees;
            mCenterX = centerX;
            mCenterY = centerY;
            mDepthZ = depthZ;
            mReverse = reverse;
        public void initialize(int width, int height, int parentWidth, int parentHeight) {
            super.initialize(width, height, parentWidth, parentHeight);
            mCamera = new Camera();
        protected void applyTransformation(float interpolatedTime, Transformation t) {
            final float fromDegrees = mFromDegrees;
            float degrees = fromDegrees + ((mToDegrees - fromDegrees) * interpolatedTime);
            final float centerX = mCenterX;
            final float centerY = mCenterY;
            final Camera camera = mCamera;
            final Matrix matrix = t.getMatrix();
            if (mReverse) {
                camera.translate(0.0f, 0.0f, mDepthZ * interpolatedTime);
            } else {
                camera.translate(0.0f, 0.0f, mDepthZ * (1.0f - interpolatedTime));
            matrix.preTranslate(-centerX, -centerY);
            matrix.postTranslate(centerX, centerY);

    Class 3:

    This Will be Your Actual activity where you should call following two calls to AnimationOut and AnimationIn with passing old view, new view respectively whenever you require to make your disered animation.

    Now Call the animationOut with first argument as the Old view to be removed like below:

    ViewSwitcher.animationOut(this.findViewById(, getWindowManager(), new ViewSwitcher.AnimationFinishedListener() {
                public void onAnimationFinished() {
                //Do Something here before removing this view from screen if required.

    Now Call the animationIn with first argument as the new view to be shown like below:

    ViewSwitcher.animationIn(this.findViewById(, this.getWindowManager());
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.