I am using a seekbar. and I want to control it only by moving the thumb.
How can I disable the click on the progressdrawable?
I tried android:clickable="false"
but it didn't work.
my seek Bar code in XML
<SeekBar
android:id="@+id/myseek"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:maxHeight="500dp"
android:minHeight="50dp"
android:paddingBottom="30dp"
android:progressDrawable="@drawable/progress_left"
android:thumb="@drawable/left_unlocker_bkg" >
</SeekBar>
My Seekbar code for onSeekChangedListner
unlockSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
toastText.setVisibility(View.GONE);
seekBar.setProgress(0);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
if (seekBar.getProgress() < 10) {
seekBar.setProgress(0);
}
toastText.setVisibility(View.VISIBLE);
toastText.setText("Slide to Unclock");
}
@Override
public void onProgressChanged(SeekBar seekBar,
int progress, boolean fromUser) {
if (progress == 100) {
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(100);
finish();
}
}
});
Currently, the user can click on the progress and the thumb moves I want to DISABLE it . Please help