content: package com.cjj.mousepaint.customview;
  
  import android.content.Context;
  import android.support.v4.view.ViewPager;
  import android.util.AttributeSet;
  import android.view.MotionEvent;
  import android.view.View;
  
  /**
   * Created by cjj on 2015/10/30.
   */
  public class NormalViewPager extends ViewPager {
  
      public NormalViewPager(Context context) {
          super(context);
          init();
      }
  
      private void init() {
      }
  
      public NormalViewPager(Context context, AttributeSet attrs) {
          super(context, attrs);
          init();
      }
  
      @Override
      protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
          int height = 0;
          for (int i = 0; i < getChildCount(); i++) {
              View child = getChildAt(i);
              child.measure(widthMeasureSpec,
                      MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
              int h = child.getMeasuredHeight();
              if (h > height)
                  height = h;
          }
          heightMeasureSpec = MeasureSpec.makeMeasureSpec(height,
                  MeasureSpec.EXACTLY);
  
          super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  
      }
  
  //    @Override
  //    public boolean onTouchEvent(MotionEvent ev) {
  //        switch (ev.getAction())
  //        {
  //            case MotionEvent.ACTION_MOVE:
  //                getParent().requestDisallowInterceptTouchEvent(true);
  //                break;
  //        }
  //        return super.onTouchEvent(ev);
  //    }
  
  
      @Override
      protected void onLayout(boolean changed, int l, int t, int r, int b) {
          super.onLayout(changed, l, t, r, b);
      }
  
  }
  