Code example for SeekBar

Methods: getProgressgetSecondaryProgress, setEnabled

0
                    mMinVolumeSeekBar.getProgress());
        } 
    } 
 
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        updateVolumeNoticeVisibility(mMinVolumeSeekBar.getProgress());
        updateEnabledStates(); 
    } 
 
    @Override 
    public boolean onVolumeChange(SeekBarVolumizer volumizer, int value) {
        boolean result = super.onVolumeChange(volumizer, value);
        if (result) {
            updateVolumeNoticeVisibility(value);
        } 
        return result;
    } 
 
    private void updateVolumeNoticeVisibility(int value) {
        boolean visible = value > mMinVolumeSeekBar.getSecondaryProgress();
        if (!mEnabledCheckbox.isChecked()) {
            visible = false;
        } 
        mRingVolumeNotice.setVisibility(visible ? View.VISIBLE : View.GONE);
    } 
 
    private void updateEnabledStates() { 
        boolean enable = mEnabledCheckbox.isChecked();
        mMinVolumeTitle.setEnabled(enable);
        mMinVolumeSeekBar.setEnabled(enable);
        mRingVolumeNotice.setEnabled(enable);
        mIntervalTitle.setEnabled(enable);
        mInterval.setEnabled(enable);
    }