I want to use a seekbar in a Navigation Drawer
Basically I need to slide left and right to set the seekbar and, well, you guessed it, it slides the navigation drawer...<
Just add an onTouchListener
. When you touch the screen on the seekbar (action_down) disallow parent to intercept the event.
seekbar.setOnTouchListener(new ListView.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
int action = event.getAction();
switch (action)
{
case MotionEvent.ACTION_DOWN:
// Disallow Drawer to intercept touch events.
v.getParent().requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
// Allow Drawer to intercept touch events.
v.getParent().requestDisallowInterceptTouchEvent(false);
break;
}
// Handle seekbar touch events.
v.onTouchEvent(event);
return true;
}
});