WearableActionDrawerView

public class WearableActionDrawerView extends WearableDrawerView


Ease of use class for creating a Wearable action drawer. This can be used with 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 {@code app:actionMenu} attribute in the XML layout file. Example:
    <androidx.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 with . 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, , size, and getItem are implemented.

For MenuItem, setting and getting the title and icon, getItemId, and setOnMenuItemClickListener are implemented.

Summary

Public constructors

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

Public methods

@Override @NonNull boolean
@NonNull Menu

Returns the Menu object that this WearableActionDrawer represents.

@Override @NonNull void

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

@Override @NonNull void

Called when anything within the peek container is clicked.

@NonNull void

Set a OnMenuItemClickListener for this action drawer.

@NonNull void

Sets the title for this action drawer.

Inherited methods

From class FrameLayout
From class View
@NonNull void
@NonNull void
@NonNull void
@NonNull ViewPropertyAnimator
@NonNull void
@NonNull void
@NonNull void
@NonNull void

This method is deprecated.

@NonNull void
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
@NonNull boolean
canScrollVertically(@NonNull int direction)
final @NonNull void
@NonNull void
final @NonNull void
@NonNull boolean
@NonNull void
@NonNull void
static @NonNull int
combineMeasuredStates(@NonNull int curState, @NonNull int newState)
@NonNull void
@NonNull WindowInsets
computeSystemWindowInsets(
    @NonNull WindowInsets in,
    @NonNull Rect outLocalInsets
)
@NonNull AccessibilityNodeInfo
@NonNull void
@NonNull void

This method is deprecated.

@NonNull boolean
@NonNull boolean
dispatchNestedFling(
    @NonNull float velocityX,
    @NonNull float velocityY,
    @NonNull boolean consumed
)
@NonNull boolean
dispatchNestedPreFling(@NonNull float velocityX, @NonNull float velocityY)
@NonNull boolean
dispatchNestedPrePerformAccessibilityAction(
    @NonNull int action,
    @NonNull Bundle arguments
)
@NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@NonNull boolean
@NonNull void
draw(@NonNull Canvas canvas)
@NonNull void
drawableHotspotChanged(@NonNull float x, @NonNull float y)
final @NonNull T
<T extends View> findViewById(@NonNull int id)
final @NonNull T
<T extends View> findViewWithTag(@NonNull Object tag)
@NonNull void
forceHasOverlappingRendering(@NonNull boolean hasOverlappingRendering)
@NonNull void
@NonNull void
generateDisplayHash(
    @NonNull String hashAlgorithm,
    @NonNull Rect bounds,
    @NonNull Executor executor,
    @NonNull DisplayHashResultCallback callback
)
static @NonNull int
@NonNull View.AccessibilityDelegate
@NonNull int
@NonNull AccessibilityNodeProvider
@NonNull CharSequence
@NonNull int
@NonNull int
@NonNull float
@NonNull Animation
@NonNull Matrix
@NonNull IBinder
@NonNull Array<@NonNull int>
@NonNull Map<@NonNull Integer, @NonNull Integer>
@NonNull Array<@NonNull String>
final @NonNull AutofillId
@NonNull int
@NonNull AutofillValue
@NonNull Drawable
@NonNull BlendMode
@NonNull ColorStateList
@NonNull PorterDuff.Mode
@NonNull int
final @NonNull int
@NonNull float
@NonNull Rect
@NonNull boolean
final @NonNull boolean
final @NonNull ContentCaptureSession
@NonNull CharSequence
final @NonNull Context
final @NonNull boolean
static @NonNull int
getDefaultSize(@NonNull int size, @NonNull int measureSpec)
@NonNull Display