6월 3일의 ⁠#Android11: 베타 버전 출시 행사에 참여하세요.

GestureScope

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

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

Example usage:

findByTag("myWidget")
   .doGesture {
       sendSwipeUp()
   }

Summary

Extension functions

From androidx.ui.test
Unit

Performs a click gesture at the given position on the associated component.

Unit

Performs a click gesture on the associated component.

Unit

Performs a double click gesture at the given position on the associated component.

Unit

Performs a double click gesture on the associated component.

Unit

Performs a long click gesture at the given position on the associated component.

Unit

Performs a long click gesture at the middle of the associated component.

Unit
GestureScope.sendPinch(start0: PxPosition, end0: PxPosition, start1: PxPosition, end1: PxPosition, duration: Duration = 400.milliseconds)

Performs a pinch gesture on the associated component.

Unit
GestureScope.sendSwipe(start: PxPosition, end: PxPosition, duration: Duration = 200.milliseconds)

Performs the swipe gesture on the associated component.

Unit

Performs a swipe down gesture on the associated component.

Unit

Performs a swipe left gesture on the associated component.

Unit

Performs a swipe right gesture on the associated component.

Unit

Performs a swipe up gesture on the associated component.

Unit
GestureScope.sendSwipeWithVelocity(start: PxPosition, end: PxPosition, endVelocity: Float, duration: Duration = 200.milliseconds)

Performs the swipe gesture on the associated component, such that the velocity when the gesture is finished is roughly equal to endVelocity.

Inherited extension functions

From androidx.ui.test
PxPosition

Transforms the position to global coordinates, as defined by globalBounds

Inherited extension properties

From androidx.ui.test
PxPosition

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

PxBounds

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

IntPxSize

Returns the size of the component we're interacting with