WearableButtons

public final class WearableButtons


Class containing helpers for managing wearable buttons.

Summary

Nested types

WearableButtons.ButtonInfo

Metadata for a specific button.

Constants

static final @NonNull int

Represents the center third of the bottom side on a square device.

static final @NonNull int

Represents the left third of the bottom side on a square device.

static final @NonNull int

Represents the right third of the bottom side on a square device.

static final @NonNull int

Represents the east position on a round device.

static final @NonNull int

Represents the east-northeast position on a round device.

static final @NonNull int

Represents the east-southeast position on a round device.

static final @NonNull int

Represents the bottom third of the left side on a square device.

static final @NonNull int

Represents the center third of the left side on a square device.

static final @NonNull int

Represents the top third of the left side on a square device.

static final @NonNull int

Represents the northeast position on a round device.

static final @NonNull int

Represents the north-northeast position on a round device.

static final @NonNull int

Represents the north-northwest position on a round device.

static final @NonNull int

Represents the north position on a round device.

static final @NonNull int

Represents the northwest position on a round device.

static final @NonNull int

Represents the bottom third of the right side on a square device.

static final @NonNull int

Represents the center third of the right side on a square device.

static final @NonNull int

Represents the top third of the right side on a square device.

static final @NonNull int

Represents the southeast position on a round device.

static final @NonNull int

Represents the south position on a round device.

static final @NonNull int

Represents the south-southeast position on a round device.

static final @NonNull int

Represents the south-southwest position on a round device.

static final @NonNull int

Represents the southwest position on a round device.

static final @NonNull int

Represents the center third of the top side on a square device.

static final @NonNull int

Represents the left third of the top side on a square device.

static final @NonNull int

Represents the right third of the top side on a square device.

static final @NonNull int

Represents that the location zone is unknown.

static final @NonNull int

Represents the west position on a round device.

static final @NonNull int

Represents the west-northwest position on a round device.

static final @NonNull int

Represents the west-southwest position on a round device.

Public methods

static @NonNull int

Get the number of hardware buttons available.

static @Nullable Drawable
getButtonIcon(@NonNull Context context, @NonNull int keycode)

Returns an icon that can be used to represent the location of a button.

static @Nullable WearableButtons.ButtonInfo
getButtonInfo(@NonNull Context context, @NonNull int keycode)

Returns a ButtonInfo containing the metadata for a specific button.

static @Nullable CharSequence
getButtonLabel(@NonNull Context context, @NonNull int keycode)

Returns a CharSequence that describes the placement location of a button.

static @VisibleForTesting(otherwise = VisibleForTesting.NONE) @NonNull void