content: package com.geek.banner.transformer.complex;
  
  import android.annotation.TargetApi;
  import android.os.Build;
  import android.support.v4.view.ViewPager;
  import android.view.View;
  
  public class RotateDownPageTransformer extends BasePageTransformer {
      private static final float DEFAULT_MAX_ROTATE = 15.0f;
      private float mMaxRotate = DEFAULT_MAX_ROTATE;
  
      public RotateDownPageTransformer() {
      }
  
      public RotateDownPageTransformer(float maxRotate) {
          this(maxRotate, NonPageTransformer.INSTANCE);
      }
  
      public RotateDownPageTransformer(ViewPager.PageTransformer pageTransformer) {
          this(DEFAULT_MAX_ROTATE, pageTransformer);
      }
  
      public RotateDownPageTransformer(float maxRotate, ViewPager.PageTransformer pageTransformer) {
          mPageTransformer = pageTransformer;
          mMaxRotate = maxRotate;
      }
  
  
      @TargetApi(Build.VERSION_CODES.HONEYCOMB)
      public void pageTransform(View view, float position) {
          if (position < -1) {
              // This page is way off-screen to the left.  
              view.setRotation(mMaxRotate * -1);
              view.setPivotX(view.getWidth());
              view.setPivotY(view.getHeight());
  
          } else if (position <= 1) {
  
              if (position < 0) {
                  view.setPivotX(view.getWidth() * (DEFAULT_CENTER + DEFAULT_CENTER * (-position)));
                  view.setPivotY(view.getHeight());
                  view.setRotation(mMaxRotate * position);
              } else {
                  view.setPivotX(view.getWidth() * DEFAULT_CENTER * (1 - position));
                  view.setPivotY(view.getHeight());
                  view.setRotation(mMaxRotate * position);
              }
          } else {
              // This page is way off-screen to the right.  
              view.setRotation(mMaxRotate);
              view.setPivotX(view.getWidth() * 0);
              view.setPivotY(view.getHeight());
          }
      }
  }  