Sachidananda naik
Sachidananda naik

Reputation: 411

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

Upvotes: 5

Views: 16805

Answers (3)

user1831682
user1831682

Reputation:

The Sliding Drawer class is deprecated for API level 17 and above. Use Navigation Drawer instead; see the Android design help page as follows:

However, you can still use Sliding Drawer below API level 17. See the following Sliding Drawer example; it's a step by step implementation process, and I bet it will help you:

Upvotes: 1

Murali Ganesan
Murali Ganesan

Reputation: 2955

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

Upvotes: 3

Todd Jefferson
Todd Jefferson

Reputation: 184

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:

Upvotes: 1

Related Questions