https://kairo96.gitbooks.io/android/content/ch3.21.html
http://stackoverflow.com/questions/18400910/seekbar-in-a-navigationdrawer
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" >
<HorizontalScrollView
android:id="@+id/hv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:alpha="0.5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="200dip"
android:layout_height="match_parent"
android:background="#ff0000"
android:gravity="center"
android:text="#ff0000" />
<TextView
android:layout_width="200dip"
android:layout_height="match_parent"
android:background="#00ff00"
android:gravity="center"
android:text="#00ff00" />
<TextView
android:layout_width="200dip"
android:layout_height="match_parent"
android:background="#0000ff"
android:gravity="center"
android:text="#0000ff" />
</LinearLayout>
</HorizontalScrollView>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
HorizontalScrollView hv = (HorizontalScrollView) findViewById(R.id.hv);
hv.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
switch (action)
{
case MotionEvent.ACTION_DOWN:
// Disallow Drawer to intercept touch events.
view.getParent().requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
// Allow Drawer to intercept touch events.
view.getParent().requestDisallowInterceptTouchEvent(false);
break;
}
// Handle seekbar touch events.
view.onTouchEvent(motionEvent);
return true;
}
});