WearableNavigationDrawer

public class WearableNavigationDrawer
extends WearableDrawerView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ android.support.wearable.view.drawer.WearableDrawerView
           ↳ android.support.wearable.view.drawer.WearableNavigationDrawer


This class is deprecated.
use the androidx.wear.widget.drawer.WearableNavigationDrawerView provided by the Jetpack Wear library instead.

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. 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:single_page custom attribute.

Summary

Nested classes

@interface WearableNavigationDrawer.NavigationStyle

This @interface is deprecated. use the androidx.wear.widget.drawer.WearableNavigationDrawerView provided by the Jetpack Wear library instead.  

class WearableNavigationDrawer.WearableNavigationDrawerAdapter

This class is deprecated. use the androidx.wear.widget.drawer.WearableNavigationDrawerView provided by the Jetpack Wear library instead.  

Inherited constants

Inherited fields

Public constructors

WearableNavigationDrawer(Context context)
WearableNavigationDrawer(Context context, AttributeSet attrs)
WearableNavigationDrawer(Context context, AttributeSet attrs, int defStyleAttr)

Public methods

boolean canScrollHorizontally(int direction)
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 setAdapter(WearableNavigationDrawer.WearableNavigationDrawerAdapter adapter)

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

void setCurrentItem(int index, boolean smoothScrollTo)

Changes which index is selected.

Inherited methods

Public constructors

WearableNavigationDrawer

public WearableNavigationDrawer (Context context)

Parameters
context Context

WearableNavigationDrawer

public WearableNavigationDrawer (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

WearableNavigationDrawer

public WearableNavigationDrawer (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

canScrollHorizontally

public boolean canScrollHorizontally (int direction)

Parameters
direction int

Returns
boolean

onDrawerClosed

public void onDrawerClosed ()

Called when the drawer has settled in a completely closed state. This is analogous to WearableDrawerLayout.DrawerStateCallback.onDrawerClosed(View).

onDrawerOpened

public void onDrawerOpened ()

Called when the drawer has settled in a completely open state. The drawer is interactive at this point. This is analogous to WearableDrawerLayout.DrawerStateCallback.onDrawerOpened(View).

onInterceptTouchEvent

public boolean onInterceptTouchEvent (MotionEvent ev)

Parameters
ev MotionEvent

Returns
boolean

setAdapter

public void setAdapter (WearableNavigationDrawer.WearableNavigationDrawerAdapter adapter)

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

Parameters
adapter WearableNavigationDrawer.WearableNavigationDrawerAdapter

setCurrentItem

public void setCurrentItem (int index, 
                boolean smoothScrollTo)

Changes which index is selected. WearableNavigationDrawer.WearableNavigationDrawerAdapter.onItemSelected(int) will be called when the specified index is reached, but it won't be called for items between the current index and the destination index.

Parameters
index int

smoothScrollTo boolean