Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way of implementing SlidingDrawer in Android

What is the correct way of implementing Sliding functionality in android?? because android.widget.SlidingDrawer class in android has been deprecated what is the alternative for this?? please help.. Thanks

like image 469
Sachidananda naik Avatar asked Sep 26 '13 04:09

Sachidananda naik


2 Answers

SlidingDrawer class was deprecated in API level 17.This class is not supported anymore. Instead of use Navigation Drawer More info

like image 51
Murali Ganesan Avatar answered Sep 22 '22 13:09

Murali Ganesan


SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen. SlidingDrawer can be used vertically or horizontally. Xml file

 <SlidingDrawer
     android:id="@+id/drawer"
     android:layout_width="match_parent"
     android:layout_height="match_parent"

     android:handle="@+id/handle"
     android:content="@+id/content">

     <ImageView
         android:id="@id/handle"
         android:layout_width="88dip"
         android:layout_height="44dip" />

     <GridView
         android:id="@id/content"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />

 </SlidingDrawer>

The size of the SlidingDrawer defines how much space the content will occupy once slid out so SlidingDrawer should usually use match_parent for both its dimensions. Inside an XML layout, SlidingDrawer must define the id of the handle and of the content:

like image 25
Todd Jefferson Avatar answered Sep 21 '22 13:09

Todd Jefferson