Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SeekBar inside DrawerLayout

I have a SeekBar inside the end panel of a DrawerLayout

The problem is that we can't swipe the Seekbar without closing the Right Panel.

If tryed to play by overriding the methods onTouchEvent and closeDrawer of DrawerLayout without success

like image 516
Benoit Avatar asked Sep 18 '13 14:09

Benoit


People also ask

How to SeekBar in Android studio?

A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys. Placing focusable widgets to the left or right of a SeekBar is discouraged.

How to get current value of SeekBar in Android?

The SeekBar class is a subclass of ProgressBar , which contains a getProgress() method. Calling PRICEbar. getProgress() will return the value you are looking for.


1 Answers

Found it :)

mSeekBar.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            mProgressBar.getParent().requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });
like image 78
Benoit Avatar answered Sep 29 '22 03:09

Benoit