Question

I'm currently using the following seekbar for showing my audio palying progress, i want to disable thumb movement by user.

<Seekbar
    android:padding="7dp"
    android:id="@+id/SeekBar01"
    android:layout_width="245dip"
    android:thumb="@drawable/seekthumb2"
    android:progressDrawable="@drawable/seekbar1"
    android:layout_height="fill_parent"
    android:clickable="false"
    android:focusable="false"
    android:longClickable="false" />

But it's not working.

Was it helpful?

Solution

Try adding

android:enabled="false"

OTHER TIPS

You can use android:enabled="false" as suggested by @yuku, but it will display disable effect [darken your seekbar].

So if you want to display enable seekbar with no response to thumb activity, implement touch event handler with return true as shown below.

seekBar.setOnTouchListener(new OnTouchListener(){
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        return true;
    }
});

You can also use a transparent png as a thumb. If none of the suggested solutions work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top