WearableNavigationDrawerView

public class WearableNavigationDrawerView extends WearableDrawerView


Ease of use class for creating a Wearable navigation drawer. This can be used with 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 types

WearableNavigationDrawerView.OnItemSelectedListener

Listener which is notified when the user selects an item.

WearableNavigationDrawerView.WearableNavigationDrawerAdapter

Adapter for specifying the contents of WearableNavigationDrawer.

Constants

static final @NonNull int

Multi-page navigation drawer style.

static final @NonNull int

Single page navigation drawer style.

Public constructors

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

Public methods

@NonNull void

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

@Override @NonNull boolean
@WearableNavigationDrawerView.NavigationStyle @NonNull int

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

@Override @NonNull void

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

@Override @NonNull void

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

@Override @NonNull boolean
@NonNull void

Remove an OnItemSelectedListener.

@NonNull void

Set a WearableNavigationDrawerAdapter that will supply data for this drawer.

@NonNull void
setCurrentItem(@NonNull int index, @NonNull boolean smoothScrollTo)

Changes which index is selected.