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 sendDown. The SemanticsNodeInteraction can be found by one of the finder methods such as findByTag.

Example usage:

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

Summary

Extension functions
From androidx.ui.test
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

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.

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 component we're interacting with.

Inherited extension properties
From androidx.ui.test
Float

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

Offset

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

Offset

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

Offset

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

Offset

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

Offset

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

Offset

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

Float

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

Float

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

PxBounds

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

Int

Shorthand for size.height

Float

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

Float

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

IntSize

Returns the size of the component we're interacting with

Float

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

Offset

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

Offset

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

Offset

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

Int

Shorthand for size.width