how to use android sliding up panel

You are missing namespace for android

Also this

xmlns:sothree="http://schemas.android.com/apk/res-auto"

Should be

xmlns:sothree="http://schemas.android.com/apk/res/yourpackagename"

So it should be

<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res/yourpackagename"

considering you have custom attributes

Edit:

Looks like you are using

https://github.com/umano/AndroidSlidingUpPanel

Its a library project and you must reference it in your andorid project. Scodnly missing android namespace as mentioned. The below should fix it

<?xml version="1.0" encoding="utf-8"?>
<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=".MainActivity" >
<com.sothree.slidinguppanel.SlidingUpPanelLayout
    xmlns:sothree="http://schemas.android.com/apk/res-auto"
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    sothree:panelHeight="68dp"
    sothree:shadowHeight="4dp">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="Main Content"
        android:textSize="16sp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center|top"
        android:text="The Awesome Sliding Up Panel"
        android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</RelativeLayout>

You can use BottomSheetBehavior from android support library from google as alternative. compile 'com.android.support:design:25.0.0' You can checkout my sample https://github.com/andrisasuke/Android-SlidingUp-Panel


If you want to slide your main body along with sliding part then only then add umanoParallaxOffset attribute otherwise remove it

<com.sothree.slidinguppanel.SlidingUpPanelLayout

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/hidden_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:gravity="bottom"
sothree:umanoClipPanel="false"
sothree:umanoDragView="@+id/dragView"
sothree:umanoFadeColor="@android:color/transparent"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="@dimen/_69sdp"
sothree:umanoShadowHeight="@dimen/_4sdp">

//Main body content

<FrameLayout
    android:id="@+id/main_panel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

        Body...........

</FrameLayout>

//Sliding content

<FrameLayout
    android:id="@+id/main_panel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

        Body...........

</FrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>  

Don't forget it! sothree:umanoOverlay="true"

<style name="AppTheme">
<item name="android:windowActionBarOverlay">true</item>
</style>

I also implemented a SlidingUpPaneLayout, based on the SlidingPaneLayout, but the slide direction is vertical you can slide up and down for the top view, it's more simple,just two views and no more attribute need to set.see at github,https://github.com/chenjishi/SlidingUpPaneLayout

<?xml version="1.0" encoding="utf-8"?>
<com.chenjishi.slideupdemo.SlidingUpPaneLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/sliding_up_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<LinearLayout
        android:id="@+id/bottom_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:background="#FFF"
        android:orientation="vertical">
    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="BOTTOM"
            android:textSize="18sp"
            android:textColor="#333"/>
</LinearLayout>
<LinearLayout
        android:id="@+id/top_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:background="#009588"
        android:orientation="vertical">
    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="TOP"
            android:textSize="18sp"
            android:textColor="#333"/>
</LinearLayout>

enter image description here

Tags:

Android