My application has a DrawerLayout with two drawers in it, one on the left for navigation and one on the right for notifications. When the application goes through a cold start and I open the left drawer, the right drawer jumps from the left edge of the screen to the right.
It looks like this: http://i.imgur.com/mhoJ7MZ.gifv
As shown in the video, I tried to use the DrawerLayout isDrawerOpen and isDrawerVisible methods to try to figure out if he really believes that the right box is open when it is not (because it seems to βcloseβ the box when the left is open), but I donβt received from this.
What causes a weird jump?
My XML activity is below, full code is here .
<?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" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> ... </LinearLayout> <LinearLayout android:id="@+id/left_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#ACFF0000" android:gravity="center" android:visibility="gone"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="LEFT DRAWER" android:textSize="24sp" /> </LinearLayout> <LinearLayout android:id="@+id/right_drawer" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="end" android:background="#AC00FF00" android:gravity="center" android:visibility="gone"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="RIGHT DRAWER" android:textSize="24sp" /> </LinearLayout> </android.support.v4.widget.DrawerLayout>
source share