consp1racy / android-support-preference

Android Preferences according to Material design specs
Apache License 2.0
331 stars 49 forks source link

SeekBarPreference #45

Closed waterdaan closed 8 years ago

waterdaan commented 8 years ago

Thanks so much for this library!!!! I´m using the SeekBarPreference in my app I had to change onStopTrackingTouch if mPreferredMin isn´t 0, but maybe i was using it wrong

@Override
public void onStopTrackingTouch(SeekBar seekBar)
{
    mTrackingTouch = false;
    if (seekBar.getProgress() + **mPreferredMin**  != mProgress)
    {
        syncProgress(seekBar);
    }
    if (mOnSeekBarChangeListener != null)
    {
        mOnSeekBarChangeListener.onStopTrackingTouch(seekBar);
    }
}
consp1racy commented 8 years ago

Thank you,

Yes, I believe you did it correctly. The thing is ProgressBar itself does not support setting minimum value. It goes from 0 to android:max. So you have to offset the output value by your minimum value.