Stay organized with collections Save and categorize content based on your preferences.
added in version 26.1.0
belongs to Maven artifact com.android.support:wear:28.0.0-alpha1

WearableNavigationDrawerView

public class WearableNavigationDrawerView
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.WearableNavigationDrawerView


Ease of use class for creating a Wearable navigation drawer. This can be used with WearableDrawerLayout to create a drawer for users to easily navigate a wearable app.

There are two ways this information may be presented: as a single page and as multiple pages. The single page navigation drawer will display 1-7 items to the user representing different navigation verticals. If more than 7 items are provided to a single page navigation drawer, the navigation drawer will be displayed as empty. The multiple page navigation drawer will display 1 or more pages to the user, each representing different navigation verticals.

The developer may specify which style to use with the app:navigationStyle custom attribute. If not specified, singlePage will be used as the default.

Summary

Nested classes

interface WearableNavigationDrawerView.OnItemSelectedListener

Listener which is notified when the user selects an item. 

class WearableNavigationDrawerView.WearableNavigationDrawerAdapter

Adapter for specifying the contents of WearableNavigationDrawer. 

Constants

int MULTI_PAGE

Multi-page navigation drawer style.

int SINGLE_PAGE

Single page navigation drawer style.

Inherited constants

From class android.support.wear.widget.drawer.WearableDrawerView
From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

WearableNavigationDrawerView(Context context)
WearableNavigationDrawerView(Context context, AttributeSet attrs)
WearableNavigationDrawerView(Context context, AttributeSet attrs, int defStyleAttr)
WearableNavigationDrawerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public methods

void addOnItemSelectedListener(WearableNavigationDrawerView.OnItemSelectedListener listener)

Add an WearableNavigationDrawerView.OnItemSelectedListener that will be notified when the user selects an item.

boolean canScrollHorizontally(int direction)
int getNavigationStyle()

Returns the style this drawer is using, either SINGLE_PAGE or MULTI_PAGE.

void onDrawerClosed()

Called when the drawer has settled in a completely closed state.

void onDrawerOpened()

Called when the drawer has settled in a completely open state.

boolean onInterceptTouchEvent(MotionEvent ev)
void removeOnItemSelectedListener(WearableNavigationDrawerView.OnItemSelectedListener listener)

Remove an WearableNavigationDrawerView.OnItemSelectedListener.

void setAdapter(WearableNavigationDrawerView.WearableNavigationDrawerAdapter adapter)

Set a WearableNavigationDrawerView.WearableNavigationDrawerAdapter that will supply data for this drawer.

void setCurrentItem(int index, boolean smoothScrollTo)

Changes which index is selected.

Inherited methods

From class android.support.wear.widget.drawer.WearableDrawerView