How to create sliding drawer in both sides opposite to one another?
Posted
by
janmejoy
on Stack Overflow
See other posts from Stack Overflow
or by janmejoy
Published on 2012-12-19T11:01:46Z
Indexed on
2012/12/19
11:02 UTC
Read the original article
Hit count: 417
I have added the code that working for right to left sliding perfectly but i want sliding from left to right also so check the layout and help me out.Here i have mentioned the layout properly for right to left ,Is it possible to get the Slider window in both sides i mean left and right horizontally...
<?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">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
android:orientation="vertical" >
<Button
android:id="@+id/ship"
android:layout_width="186dp"
android:layout_height="23dp"
android:layout_marginTop="49dp"
android:background="@drawable/signup"
android:text="Shipping Calculator"
android:textColor="#ffffffff"
android:layout_gravity="center"
android:textStyle="bold" />
</LinearLayout>
<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_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/tag"/>
<LinearLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@drawable/slidimage"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:layout_marginLeft="51dp"
android:text="SIGN-UP"
android:textColor="#000000"
android:textSize="28dp"
android:textStyle="bold" />
</LinearLayout>
</SlidingDrawer>
<SlidingDrawer
android:id="@+id/drawers"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:handle="@+id/handles"
android:layout_gravity="left"
android:scrollX="100dp"
android:orientation="horizontal"
android:content="@+id/contents">
<ImageView
android:id="@+id/handles"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="left"
android:src="@drawable/tag"/>
<LinearLayout
android:id="@+id/contents"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="left"
android:background="@drawable/slidimage"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:layout_marginLeft="51dp"
android:text="SIGN-UP"
android:textColor="#000000"
android:textSize="28dp"
android:textStyle="bold" />
</LinearLayout>
</SlidingDrawer>
</FrameLayout>
© Stack Overflow or respective owner