belongs to Maven artifact com.android.support:wear:28.0.0-alpha1
WearableDrawerView
public
class
WearableDrawerView
extends FrameLayout
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.FrameLayout | |||
↳ | android.support.wear.widget.drawer.WearableDrawerView |
![]() |
View that contains drawer content and a peeking view for use with WearableDrawerLayout
.
This view provides the ability to set its main content as well as a view shown while peeking. Specifying the peek view is entirely optional; a default is used if none are set. However, the content must be provided.
There are two ways to specify the content and peek views: by invoking setter
methods
on the WearableDrawerView
, or by specifying the app:drawerContent
and app:peekView
attributes. Examples:
// From Java: drawerView.setDrawerContent(drawerContentView); drawerView.setPeekContent(peekContentView); <!-- From XML: --> <android.support.wear.widget.drawer.WearableDrawerView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom" android:background="@color/red" app:drawerContent="@+id/drawer_content" app:peekView="@+id/peek_view"> <FrameLayout android:id="@id/drawer_content" android:layout_width="match_parent" android:layout_height="match_parent" /> <LinearLayout android:id="@id/peek_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:orientation="horizontal"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_play" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_pause" /> </LinearLayout> </android.support.wear.widget.drawer.WearableDrawerView>
Summary
Constants | |
---|---|
int |
STATE_DRAGGING
Indicates that the drawer is currently being dragged by the user. |
int |
STATE_IDLE
Indicates that the drawer is in an idle, settled state. |
int |
STATE_SETTLING
Indicates that the drawer is in the process of settling to a final position. |
Inherited constants |
---|
![]()
android.view.ViewGroup
|
![]()
android.view.View
|
Inherited fields |
---|
![]()
android.view.View
|