Added in API level 3
Deprecated in API level 17

SlidingDrawer


open class SlidingDrawer : ViewGroup
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.SlidingDrawer

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:

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

Summary

Nested classes
abstract

Callback invoked when the drawer is closed.

abstract

Callback invoked when the drawer is opened.

abstract

Callback invoked when the drawer is scrolled.

XML attributes
android:allowSingleTap Indicates whether the drawer can be opened/closed by a single tap on the handle.
android:animateOnClick Indicates whether the drawer should be opened/closed with an animation when the user clicks the handle.
android:bottomOffset Extra offset for the handle at the bottom of the SlidingDrawer.
android:content Identifier for the child that represents the drawer's content.
android:handle Identifier for the child that represents the drawer's handle.
android:orientation Orientation of the SlidingDrawer.
android:topOffset Extra offset for the handle at the top of the SlidingDrawer.
Inherited XML attributes
Constants
static Int

static Int

Inherited constants
Public constructors
SlidingDrawer(context: Context!, attrs: AttributeSet!)

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

SlidingDrawer(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

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

SlidingDrawer(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

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

Public methods
open Unit

Closes the drawer with an animation.

open Unit

Opens the drawer with an animation.

open Unit

Toggles the drawer open and close with an animation.

open Unit

Closes the drawer immediately.

open CharSequence!

open View!

Returns the content of the drawer.

open View!

Returns the handle of the drawer.

open Boolean

Indicates whether the drawer is scrolling or flinging.

open Boolean

Indicates whether the drawer is currently fully opened.

open Unit

Locks the SlidingDrawer so that touch events are ignores.

open Boolean

open Boolean

open Unit

Opens the drawer immediately.

open Unit

Sets the listener that receives a notification when the drawer becomes close.

open Unit

Sets the listener that receives a notification when the drawer becomes open.

open Unit

Sets the listener that receives a notification when the drawer starts or ends a scroll.

open Unit

Toggles the drawer open and close.

open Unit

Unlocks the SlidingDrawer so that touch events are processed.

Protected methods
open Unit

open Unit

open Unit
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

Inherited functions