code: public void setMax(int max) {
          mMax = max;
          if (mMax <= mMin) {
              setMin(mMax - 1);
          }
          updateKeyboardRange();
          mSeekBarDrawable.setNumSegments(mMax - mMin);
  
          if (mValue < mMin || mValue > mMax) {
              setProgress(mValue);
          } else {
              updateThumbPosForScale(-1);
          }
      }
docs: Sets the maximum value for this AbsSeekBar
  if the supplied argument is smaller than the Current MIN value,
  the MIN value will be set to MAX-1
  <p/>
  <p>
  Also if the current progress is out of the new range, it will be set to MIN
  </p>
  
  @param max Progress max value
  @see #setMin(int)
  @see #setProgress(int)