Android Guides | Samples

Android.Widget.SlidingDrawer Class

SlidingDrawer hides content out of the screen and allows the user to drag a handle to bring the content on screen.

See Also: SlidingDrawer

Syntax

[Android.Runtime.Register("android/widget/SlidingDrawer", DoNotGenerateAcw=true)]
[System.Obsolete("This class is obsoleted in this android platform")]
public class SlidingDrawer : ViewGroup

Remarks

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. A special widget composed of two children views: the handle, that the users drags, and the content, attached to the handle and dragged with it. SlidingDrawer should be used as an overlay inside layouts. This means SlidingDrawer should only be used inside of a FrameLayout or a RelativeLayout for instance. 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:

xml Example

 <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>

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3Deprecated since API level 17

The members of Android.Widget.SlidingDrawer are listed below.

See Also: ViewGroup

Public Constructors

Creates a new SlidingDrawer from a specified set of attributes defined in XML.
Creates a new SlidingDrawer from a specified set of attributes defined in XML.
Creates a new SlidingDrawer from a specified set of attributes defined in XML.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Fields

Public Properties

[read-only]
ContentView. Returns the content of the drawer.
[read-only]
IsMovingBoolean. Indicates whether the drawer is scrolling or flinging.
[read-only]
IsOpenedBoolean. Indicates whether the drawer is currently fully opened.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AnimateClose()
Closes the drawer with an animation.
AnimateOpen()
Opens the drawer with an animation.
AnimateToggle()
Toggles the drawer open and close with an animation.
Close()
Closes the drawer immediately.
GetHandle() : View
Returns the handle of the drawer.
Lock()
Locks the SlidingDrawer so that touch events are ignores.
Open()
Opens the drawer immediately.
SetOnDrawerCloseListener(SlidingDrawer+IOnDrawerCloseListener)
Sets the listener that receives a notification when the drawer becomes close.
SetOnDrawerOpenListener(SlidingDrawer+IOnDrawerOpenListener)
Sets the listener that receives a notification when the drawer becomes open.
SetOnDrawerScrollListener(SlidingDrawer+IOnDrawerScrollListener)
Sets the listener that receives a notification when the drawer starts or ends a scroll.
Toggle()
Toggles the drawer open and close.
Unlock()
Unlocks the SlidingDrawer so that touch events are processed.

Protected Methods

override
OnLayout(Boolean, Int32, Int32, Int32, Int32)
Called from layout when this view should assign a size and position to each of its children.

Public Events