0

Can anyone give a simple example on how to make a slidedrawer in android from left to right I searched the internet very much but couldn't get a proper solution. waiting for your replies. thank you :)

Barak
  • 16,318
  • 9
  • 52
  • 84
hari
  • 43
  • 1
  • 1
  • 6

1 Answers1

0

Please Use Below Code for horizontal sliding drawer.

main.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ImageView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:src="@drawable/icon"/>

    <SlidingDrawer
        android:id="@+id/drawer"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal"
        android:handle="@+id/handle"
        android:content="@+id/content">
        <ImageView 
            android:id="@id/handle"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent" 
            android:src="@drawable/icon"/>
        <LinearLayout
            android:id="@id/content"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical"
            android:padding="10dp"
            android:background="#55000000">
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
            <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text=" - Button - "/>
        </LinearLayout>
    </SlidingDrawer>
</FrameLayout>

Use below example link for Reference.

SlidingDrawer in horizontal - 1

SlidingDrawer in horizontal - 2

Dipak Keshariya
  • 22,193
  • 18
  • 76
  • 128