How to disable the search bar for an audio controller

I am currently using the following search bar to show my sound improvement, I want to disable the user's finger movement.

<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 does not work.

+3
source share
4 answers

Try adding android: enabled = "false"

+1
source

You can use android:enabled="false"as suggested by @yuku, but it will show the disconnect effect [darken your search].

So, if you want to display the inclusion search bar without responding to thumb activity, implement a touch event handler that returns true, as shown below.

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

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

0
source

Source: https://habr.com/ru/post/1771424/


All Articles