belongs to Maven artifact com.android.support:wear:28.0.0-alpha1
WearableActionDrawerView
public
class
WearableActionDrawerView
extends WearableDrawerView
java.lang.Object | |||||
↳ | android.view.View | ||||
↳ | android.view.ViewGroup | ||||
↳ | android.widget.FrameLayout | ||||
↳ | android.support.wear.widget.drawer.WearableDrawerView | ||||
↳ | android.support.wear.widget.drawer.WearableActionDrawerView |
Ease of use class for creating a Wearable action drawer. This can be used with WearableDrawerLayout
to create a drawer for users to easily pull up contextual actions. These
contextual actions may be specified by using a Menu
, which may be populated by either:
- Specifying the
app:actionMenu
attribute in the XML layout file. Example:<android.support.wear.widget.drawer.WearableActionDrawerView xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width=”match_parent” android:layout_height=”match_parent” app:actionMenu="@menu/action_drawer" />
- Getting the menu with
getMenu()
, and then inflating it withinflate(int, Menu)
. Example:Menu menu = actionDrawer.getMenu(); getMenuInflater().inflate(R.menu.action_drawer, menu);
The full Menu
and MenuItem
APIs are not implemented. The following
methods are guaranteed to work:
For Menu
, the add methods, clear()
, removeItem(int)
, findItem(int)
, size()
, and getItem(int)
are implemented.
For MenuItem
, setting and getting the title and icon, getItemId()
, and
setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener)
are implemented.
Summary
Inherited constants |
---|
![]()
android.support.wear.widget.drawer.WearableDrawerView
|
![]()
android.view.ViewGroup
|
![]()
android.view.View
|
Inherited fields |
---|
![]()
android.view.View
|
Public constructors | |
---|---|
WearableActionDrawerView(Context context)
|
|
WearableActionDrawerView(Context context, AttributeSet attrs)
|
|
WearableActionDrawerView(Context context, AttributeSet attrs, int defStyleAttr)
|
|
WearableActionDrawerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
Public methods | |
---|---|
boolean
|
canScrollHorizontally(int direction)
|
Menu
|
getMenu()
Returns the Menu object that this WearableActionDrawer represents. |
void
|
onDrawerOpened()
Called when the drawer has settled in a completely open state. |
void
|
onPeekContainerClicked(View v)
Called when anything within the peek container is clicked. |
void
|
setOnMenuItemClickListener(MenuItem.OnMenuItemClickListener listener)
Set a |
void
|
setTitle(CharSequence title)
Sets the title for this action drawer. |
Inherited methods | |
---|---|
![]()
android.support.wear.widget.drawer.WearableDrawerView
|