I have a DrawerLayout with two drawers, one on the left and one on the right side.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
xmlns:app="http://schemas.android.com/apk/res-auto">
<fragment
android:id="@+id/mainFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<fragment
android:id="@+id/leftFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left|start"/>
<fragment
android:id="@+id/rightFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right|end"/>
</android.support.v4.widget.DrawerLayout>
The problem is that sometimes when I swipe left to close the left drawer, it also opens the right one.
Is there any way to prevent this from happening? I'm thinking maybe I could block the opposite side from opening until both sides have been closed for at least X milliseconds or something, but I have no clue how to go about it.