I got struggle with SlidingPaneLayout
. I'm trying to create activity with 3 panels like is shown on image:
The case is that I want to panel 2 was visible by default, and when user swipe from left to right should open panel 1 and when swipe from right to left panel 3.
When I add views to SlidingPaneLayout
the last added is visible by default. Is any way to set which view should be starting view?
Here's my layout xml:
<android.support.v4.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/side_menu_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="@color/gray"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/oliveGreen">
</LinearLayout>
<ListView android:id="@+id/right_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_marginRight="0dp"
android:layout_marginEnd="0dp"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="@color/gray"/>
</android.support.v4.widget.SlidingPaneLayout>
At this configuration rightDrawer
is show as starting view. I want to show LinearLayout
and set rightDrawr
on the right side of it.
I hope I made that clear and I would appreciate for any help. Thank you in advance.