microsoftarchive / android-sliding-layer-lib

Highly customizable SlidingLayer as you have seen in Wunderlist
http://wunderlist.com
Apache License 2.0
932 stars 277 forks source link

Sliding Layer doesn't overlay main content #83

Closed billykeyss closed 9 years ago

billykeyss commented 9 years ago

I am trying to use wunderlist's sliding-layer-lib, however I am having an issue where the layer that slides in doesn't overlay the main content layer. Am I missing something to fix this?

screen shot 2015-08-12 at 2 54 16 pm

The following is my code:

<RelativeLayout 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"
    tools:context="com.nanopay.loyalty_app_android.Activities.TempActivity">

    <com.wunderlist.slidinglayer.SlidingLayer
        xmlns:slidingLayer="http://schemas.android.com/apk/res-auto"
        android:id="@+id/slidingLayer1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        slidingLayer:stickTo="left"
        slidingLayer:changeStateOnTap="true"
        slidingLayer:shadowSize="8dp"
        >

        <RelativeLayout
           android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#14ad8f">

          .......

        </RelativeLayout>

    </com.wunderlist.slidinglayer.SlidingLayer>

    <Button
        android:id="@+id/buttonOpen"
        android:text="Open"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="88dp" />

     <TabHost
         android:id="@+id/tabHost"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_width="wrap_content">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:textSize="25sp">

    </TabWidget>

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/OFFERS"
            android:layout_width="match_parent"
            android:layout_height="201dp"
            android:orientation="vertical">
            <android.support.v4.view.ViewPager
                android:id="@+id/awesomepager"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

            </android.support.v4.view.ViewPager>

        </LinearLayout>

        <LinearLayout
            android:id="@+id/PAYMENT"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <android.support.v4.view.ViewPager
                android:id="@+id/awesomepager1"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

            </android.support.v4.view.ViewPager>

            </LinearLayout>

        </FrameLayout>
    </LinearLayout>
</TabHost>

       </RelativeLayout>
JlUgia commented 9 years ago

Hi @billykeyss, on Android, the views are drawn following a descending order according to the XML structure you define, that is, elements at the bottom are drawn on top. If you want the layer to cover the rest of the contents, it has to be at the bottom, below other elements.

billykeyss commented 9 years ago

Thank you!