3

I need to Sliding Panel in the closed state is not fully closed.

(example https://i.stack.imgur.com/S2Hj1.png )

how to do it?

xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.regulus.client.android.controls.SlidingPaneLayoutTouchOff
        android:id="@+id/work_area"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" >

        <!-- sliding panel -->

        <LinearLayout
            android:id="@+id/slide_panel"
            android:layout_width="280dp"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:orientation="vertical" >

            <ListView
             android:id="@+id/list"
             android:layout_width="match_parent"
             android:layout_height="wrap_content">
            </ListView>             
        </LinearLayout>       

        <fragment
            android:id="@+id/map"
            android:name="com.google.android.gms.maps.SupportMapFragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


    </com.regulus.client.android.controls.SlidingPaneLayoutTouchOff>

</LinearLayout>

SlidingPaneLayoutTouchOff custom class. extends SlidingPaneLayout

Konstantin Pl
  • 141
  • 1
  • 4

1 Answers1

0

It is quite late for this to help you, but it may help others.

If you want the top panel to not close completely, you need to add some margin to it with this android:layout_marginStart="50dp"

So the full xml would look like this:

 <android.support.v4.widget.SlidingPaneLayout
        android:id="@+id/sliding_pane"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    <TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="#fff"
          android:text="bottom panel"/> 
    <TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginLeft="50dp"
          android:background="#f00"
          android:text="top panel"/>
</android.support.v4.widget.SlidingPaneLayout>
Kaizie
  • 3,748
  • 4
  • 20
  • 19