code: @Override
      protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
          if (mOrientation == HORIZONTAL) {
              setMeasuredDimension(measureLong(widthMeasureSpec), measureShort(heightMeasureSpec));
          } else {
              setMeasuredDimension(measureShort(widthMeasureSpec), measureLong(heightMeasureSpec));
          }
      }
docs: /*
  (non-Javadoc)
  
  @see android.view.View#onMeasure(int, int)