Google is committed to advancing racial equity for Black communities. See how.

PartialGestureScope

class PartialGestureScope : BaseGestureScope
kotlin.Any
   ↳ androidx.ui.test.BaseGestureScope
   ↳ androidx.ui.test.PartialGestureScope

The receiver scope for injecting partial gestures on the semanticsNode identified by the corresponding SemanticsNodeInteraction. Gestures can be injected by calling methods defined on PartialGestureScope, such as down. The SemanticsNodeInteraction can be found by one of the finder methods such as onNodeWithTag.

Example usage:

val position = Offset(10.px, 10.px)
onNodeWithTag("myWidget")
   .performPartialGesture { sendDown(position) }
   .assertIsDisplayed()
   .performPartialGesture { sendUp(position) }

Summary

Extension functions
From androidx.ui.test
Unit

Sends a cancel event to cancel the current partial gesture.

Unit
PartialGestureScope.down(pointerId: Int, position: Offset)

Sends a down event for the pointer with the given pointerId at position on the associated node.

Unit

Sends a down event for the default pointer at position on the associated node.

Unit

Sends a move event without updating any of the pointer positions.

Unit
PartialGestureScope.moveBy(pointerId: Int, delta: Offset)

Sends a move event on the associated node, with the position of the pointer with the given pointerId moved by the given delta.

Unit

Sends a move event on the associated node, with the position of the default pointer moved by the given delta.

Unit

Moves the position of the pointer with the given pointerId by the given delta, but does not send a move event.

Unit
PartialGestureScope.movePointerTo(pointerId: Int, position: Offset)

Updates the position of the pointer with the given pointerId to the given position, but does not send a move event.

Unit
PartialGestureScope.moveTo(pointerId: Int, position: Offset)

Sends a move event on the associated node, with the position of the pointer with the given pointerId updated to position.

Unit

Sends a move event on the associated node, with the position of the default pointer updated to position.

Unit

Sends a cancel event to cancel the current partial gesture.

Unit
PartialGestureScope.sendDown(pointerId: Int, position: Offset)

Sends a down event for the pointer with the given pointerId at position on the associated component.

Unit

Sends a down event for the default pointer at position on the associated component.

Unit

Sends a move event without updating any of the pointer positions.

Unit

Sends a move event on the associated component, with the position of the pointer with the given pointerId moved by the given delta.

Unit

Sends a move event on the associated component, with the position of the default pointer moved by the given delta.

Unit
PartialGestureScope.sendMoveTo(pointerId: Int, position: Offset)

Sends a move event on the associated component, with the position of the pointer with the given pointerId updated to position.

Unit

Sends a move event on the associated component, with the position of the default pointer updated to position.

Unit
PartialGestureScope.sendUp(pointerId: Int = 0)

Sends an up event for the pointer with the given pointerId, or the default pointer if pointerId is omitted, on the associated component.

Unit
PartialGestureScope.up(pointerId: Int = 0)

Sends an up event for the pointer with the given pointerId, or the default pointer if pointerId is omitted, on the associated node.

Inherited extension functions
From androidx.ui.test
Offset

Transforms the position to global coordinates, as defined by globalBounds

Offset
BaseGestureScope.percentOffset(@FloatRange(-1.0, 1.0) x: Float = 0f, @FloatRange(-1.0, 1.0) y: Float = 0f)

Creates an Offset relative to the size of the node we're interacting with.

Inherited extension properties
From androidx.ui.test
Float

Returns the y-coordinate for the bottom of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the center of the bottom edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the bottom left corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the bottom right corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the center of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the center of the left edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the center of the right edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Float

Returns the x-coordinate for the center of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Float

Returns the y-coordinate for the center of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

PxBounds

Returns the global bounds of the node we're interacting with

Int

Shorthand for size.height

Float

Returns the x-coordinate for the left edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Float

Returns the x-coordinate for the right edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

IntSize

Returns the size of the node we're interacting with

Float

Returns the y-coordinate for the bottom of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the center of the top edge of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the top left corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Offset

Returns the top right corner of the node we're interacting with, in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Int

Shorthand for size.width