code: private int measureLong(int measureSpec) {
          int result;
          int specMode = MeasureSpec.getMode(measureSpec);
          int specSize = MeasureSpec.getSize(measureSpec);
  
          if ((specMode == MeasureSpec.EXACTLY) || (mViewPager == null)) {
              //We were told how big to be
              result = specSize;
          } else {
              //Calculate the width according the views count
              final int count = mViewPager.getAdapter().getCount();
              result = (int) (getPaddingLeft() + getPaddingRight()
                      + (count * 2 * mRadius) + (count - 1) * mRadius + 1);
              //Respect AT_MOST value if that was what is called for by measureSpec
              if (specMode == MeasureSpec.AT_MOST) {
                  result = Math.min(result, specSize);
              }
          }
          return result;
      }
docs: Determines the width of this view
  
  @param measureSpec
  A measureSpec packed into an int
  @return The width of the view, honoring constraints from measureSpec