android - How to disable swipe of only the right navigation drawer? -
i have 2 navigation drawers on either side in activity. don't need right navigation drawer opened swipe gesture.
if use:
mdrawerlayout.setdrawerlockmode(drawerlayout.lock_mode_locked_closed)
to lock swipe both left , right drawers locked. want left drawer detect swipe gesture. how do this?
<android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <listview android:id="@+id/left_drawer" android:layout_width="@dimen/nav_drawer_width" android:layout_height="match_parent" android:layout_gravity="left" /> <listview android:id="@+id/right_drawer" android:layout_width="@dimen/nav_drawer_width" android:layout_height="match_parent" android:layout_gravity="right" /> </android.support.v4.widget.drawerlayout>
achieved using same function setdrawerlockmode additional parameter
mdrawerlayout.setdrawerlockmode(drawerlayout.lock_mode_locked_closed, findviewbyid(r.id.right_drawer));
Comments
Post a Comment