public void setMax ( int max ) { if ( ! ( max <= 0 ) ) { // Check to make sure it's greater than zero if ( max <= mProgress ) { mProgress = 0 ; // If the new max is less than current progress, set progress to zero if ( mOnCircularSeekBarChangeListener != null ) { mOnCircularSeekBarChangeListener . onProgressChanged ( this , mProgress , false ) ; } } mMax = max ; recalculateAll ( ) ; invalidate ( ) ; } }
Set the max of the CircularSeekBar . If the new max is less than the current progress then the progress will be set to zero . If the progress is changed as a result then any listener will receive a onProgressChanged event .