GestureEvent

class GestureEvent


Represents a gesture event that has occurred, containing information about the gesture action. This class encapsulates the data associated with a specific gesture, such as the type of gesture performed.

Summary

Nested types

Defines the set of supported gesture types.

Defines the set of actions that can be associated with a gesture.

Defines the bitmask of reasons why gesture actions might be unavailable.

Constants

const Int

The dismiss action associated with a gesture.

const Int

The action to be used to invoke AI features.

const Int

The page backward gesture action.

const Int

The page forward gesture action.

const Int

The primary action associated with a gesture.

const Int

The select gesture action to confirm/select an item.

const Int

The sleep action to put the device into a sleeping state.

const Int

The wake up action to wake the device from sleep.

const Int

Gesture action is available and enabled.

const Int

Gesture action is unavailable because the watch is not being worn.

const Int

Gesture action is unavailable for unspecified or unknown reasons.

const Int

Gesture action is disabled in System Settings.

const Int

Phone GMS specific: Unavailable because the remote client is disconnected.

const Int

Bloom gesture: user opens and spreads all fingers outward from a closed 'bud' position.

const Int

Clench gesture: user rapidly and deliberately closes their hand into a tight fist.

const Int

Double knock: the user makes a fist and bends their wrist up and down twice.

const Int

A double pinch gesture: when a user performs quick back-to-back pinches.

const Int

Double shake: the user shakes their wrist quickly twice.

const Int

Double wrist turn gesture: the user performs the wrist turn gesture twice.

const Int

Knock: the user makes a fist and bends their wrist up and down.

const Int

Maximum value for gesture types.

const Int

The minimum value for a gesture.

const Int

Palm up clench gesture: palm faces upward, user closes hand into a tight fist.

const Int

Palm up double pinch gesture: palm faces upward, user performs back-to-back pinches.

const Int

Palm up single pinch gesture: palm faces upward, user performs a pinch.

const Int

Pinch and flick backward gesture: maintains pinch while flicking hand toward the body.

const Int

Pinch and flick forward gesture: maintains pinch while flicking hand away from body.

const Int

Pinch and hold: maintains pinch for a short duration.

const Int

Shake: the user quickly shakes their wrist by rotating it outward.

const Int

A single pinch gesture: the user performs a quick pinch.

const Int

Unknown gesture type.

const Int

A wrist turn gesture: when a user turns the watch-wearing wrist, such as by turning the wrist outside and back inside.

Public constructors

GestureEvent(
    @GestureEvent.GestureAction gestureAction: Int,
    @GestureEvent.Gesture gesture: Int
)

Constructs a new GestureEvent.

Public functions

java-static String
Boolean
equals(o: Any?)
java-static String

Returns a String representing a given gesture, for logging and debugging.

Int
String!

Constants

ACTION_DISMISS

const val ACTION_DISMISS = 2: Int

The dismiss action associated with a gesture.

ACTION_INVOKE_AI

const val ACTION_INVOKE_AI = 5: Int

The action to be used to invoke AI features.

ACTION_PAGE_BACKWARD

const val ACTION_PAGE_BACKWARD = 8: Int

The page backward gesture action.

ACTION_PAGE_FORWARD

const val ACTION_PAGE_FORWARD = 7: Int

The page forward gesture action.

ACTION_PRIMARY

const val ACTION_PRIMARY = 1: Int

The primary action associated with a gesture.

ACTION_SELECT

const val ACTION_SELECT = 6: Int

The select gesture action to confirm/select an item.

ACTION_SLEEP

const val ACTION_SLEEP = 4: Int

The sleep action to put the device into a sleeping state.

ACTION_WAKE

const val ACTION_WAKE = 3: Int

The wake up action to wake the device from sleep.

FLAG_GESTURE_UNAVAILABILITY_REASON_NONE

const val FLAG_GESTURE_UNAVAILABILITY_REASON_NONE = 0: Int

Gesture action is available and enabled.

FLAG_GESTURE_UNAVAILABILITY_REASON_OFF_BODY

const val FLAG_GESTURE_UNAVAILABILITY_REASON_OFF_BODY = 4: Int

Gesture action is unavailable because the watch is not being worn.

FLAG_GESTURE_UNAVAILABILITY_REASON_UNKNOWN

const val FLAG_GESTURE_UNAVAILABILITY_REASON_UNKNOWN = 1: Int

Gesture action is unavailable for unspecified or unknown reasons.

FLAG_GESTURE_UNAVAILABILITY_REASON_USER_SETTING

const val FLAG_GESTURE_UNAVAILABILITY_REASON_USER_SETTING = 2: Int

Gesture action is disabled in System Settings.

FLAG_GESTURE_UNAVAILABILITY_REASON_WATCH_DISCONNECTED

const val FLAG_GESTURE_UNAVAILABILITY_REASON_WATCH_DISCONNECTED = 8: Int

Phone GMS specific: Unavailable because the remote client is disconnected.

GESTURE_BLOOM

const val GESTURE_BLOOM = 7: Int

Bloom gesture: user opens and spreads all fingers outward from a closed 'bud' position.

GESTURE_CLENCH

const val GESTURE_CLENCH = 8: Int

Clench gesture: user rapidly and deliberately closes their hand into a tight fist.

GESTURE_DOUBLE_KNOCK

const val GESTURE_DOUBLE_KNOCK = 14: Int

Double knock: the user makes a fist and bends their wrist up and down twice.

GESTURE_DOUBLE_PINCH

const val GESTURE_DOUBLE_PINCH = 1: Int

A double pinch gesture: when a user performs quick back-to-back pinches.

GESTURE_DOUBLE_SHAKE

const val GESTURE_DOUBLE_SHAKE = 16: Int

Double shake: the user shakes their wrist quickly twice.

GESTURE_DOUBLE_WRIST_TURN

const val GESTURE_DOUBLE_WRIST_TURN = 6: Int

Double wrist turn gesture: the user performs the wrist turn gesture twice.

GESTURE_KNOCK

const val GESTURE_KNOCK = 13: Int

Knock: the user makes a fist and bends their wrist up and down.

GESTURE_MAX

const val GESTURE_MAX = 16: Int

Maximum value for gesture types.

GESTURE_MIN

const val GESTURE_MIN = 1: Int

The minimum value for a gesture.

GESTURE_PALM_UP_CLENCH

const val GESTURE_PALM_UP_CLENCH = 9: Int

Palm up clench gesture: palm faces upward, user closes hand into a tight fist.

GESTURE_PALM_UP_DOUBLE_PINCH

const val GESTURE_PALM_UP_DOUBLE_PINCH = 5: Int

Palm up double pinch gesture: palm faces upward, user performs back-to-back pinches.

GESTURE_PALM_UP_SINGLE_PINCH

const val GESTURE_PALM_UP_SINGLE_PINCH = 4: Int

Palm up single pinch gesture: palm faces upward, user performs a pinch.

GESTURE_PINCH_AND_FLICK_BACKWARD

const val GESTURE_PINCH_AND_FLICK_BACKWARD = 11: Int

Pinch and flick backward gesture: maintains pinch while flicking hand toward the body.

GESTURE_PINCH_AND_FLICK_FORWARD

const val GESTURE_PINCH_AND_FLICK_FORWARD = 10: Int

Pinch and flick forward gesture: maintains pinch while flicking hand away from body.

GESTURE_PINCH_AND_HOLD

const val GESTURE_PINCH_AND_HOLD = 12: Int

Pinch and hold: maintains pinch for a short duration.

GESTURE_SHAKE

const val GESTURE_SHAKE = 15: Int

Shake: the user quickly shakes their wrist by rotating it outward.

GESTURE_SINGLE_PINCH

const val GESTURE_SINGLE_PINCH = 3: Int

A single pinch gesture: the user performs a quick pinch.

GESTURE_UNKNOWN

const val GESTURE_UNKNOWN = -1: Int

Unknown gesture type.

GESTURE_WRIST_TURN

const val GESTURE_WRIST_TURN = 2: Int

A wrist turn gesture: when a user turns the watch-wearing wrist, such as by turning the wrist outside and back inside.

Public constructors

GestureEvent

GestureEvent(
    @GestureEvent.GestureAction gestureAction: Int,
    @GestureEvent.Gesture gesture: Int
)

Constructs a new GestureEvent.

Parameters
@GestureEvent.GestureAction gestureAction: Int

The action performed, as defined by GestureAction.

@GestureEvent.Gesture gesture: Int

The gesture that was performed, as defined by Gesture.

Public functions

actionToString

java-static fun actionToString(@GestureEvent.GestureAction action: Int): String

equals

fun equals(o: Any?): Boolean

gestureToString

java-static fun gestureToString(@GestureEvent.Gesture gesture: Int): String

Returns a String representing a given gesture, for logging and debugging.

hashCode

fun hashCode(): Int

toString

fun toString(): String!

Public properties