content: package com.allure.lbanners.transformer;
  
  import android.view.View;
  
  import com.nineoldandroids.view.ViewHelper;
  
  /**
   * Created by lm on 2016/7/8.
   */
  public class ZoomFadePageTransformer extends LMPageTransformer {
  
      @Override
      public void scrollInvisible(View view, float position) {
      }
  
      @Override
      public void scrollLeft(View view, float position) {
          ViewHelper.setTranslationX(view, -view.getWidth() * position);
  
          ViewHelper.setPivotX(view,view.getWidth() * 0.5f);
          ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
          ViewHelper.setScaleX(view, 1 + position);
          ViewHelper.setScaleY(view, 1 + position);
  
          ViewHelper.setAlpha(view, 1 + position);
      }
  
      @Override
      public void scrollRight(View view, float position) {
          ViewHelper.setTranslationX(view, -view.getWidth() * position);
  
          ViewHelper.setPivotX(view,view.getWidth() * 0.5f);
          ViewHelper.setPivotY(view, view.getHeight() * 0.5f);
          ViewHelper.setScaleX(view, 1 - position);
          ViewHelper.setScaleY(view, 1 - position);
          ViewHelper.setAlpha(view, 1 - position);
      }
  
  
  }