swipe
fun IndirectPointerInjectionScope.swipe(start: Offset, end: Offset, durationMillis: Long = 200)
Performs a swipe gesture on nodes in the focus path.
The motion events are linearly interpolated between start and end.
The coordinates are NOT in the node's local coordinate system (see IndirectPointerInjectionScope.inputDeviceSize) and is usually used for focused movement (that is, a focused node would move to the next/previous focusable node in the hierarchy with a swipe).
Parameters
| start | The position of the pointer starting the swipe gesture, in the indirect pointer input device's coordinate system (IndirectPointerInjectionScope.inputDeviceSize). |
| end | The position of the pointer ending the swipe gesture, in the indirect pointer input device's coordinate system (IndirectPointerInjectionScope.inputDeviceSize). |
| durationMillis | The duration of the swipe gesture (default duration is 200 milliseconds) |
swipe
fun IndirectPointerInjectionScope.swipe(
curve: (timeMillis: Long) -> Offset,
durationMillis: Long = 200,
keyTimes: List<Long> = emptyList(),
)
Performs a swipe gesture on nodes in the focus path.
The swipe follows the curve from 0 till durationMillis. Will force sampling of an event at all times defined in keyTimes. The time between events is kept as close to eventPeriodMillis as possible, given the constraints.
The coordinates are NOT in the node's local coordinate system (see IndirectPointerInjectionScope.inputDeviceSize) and is usually used for focused movement (that is, a focused node would move to the next/previous focusable node in the hierarchy with a swipe).
Parameters
| curve | The function that describes the gesture. The argument passed to the function is the time in milliseconds since the start of the swipe, and the return value is the location of the pointer at that point in time. |
| durationMillis | The duration of the gesture (default duration is 200 milliseconds) |
| keyTimes | An optional list of timestamps in milliseconds at which a move event must be sampled |
swipe
Deprecated
Replaced by TouchInjectionScope. Use performTouchInput instead of performGesture
fun GestureScope.swipe(start: Offset, end: Offset, durationMillis: Long = 200) =
delegateScope.touch { swipe(start, end, durationMillis) }
Performs the swipe gesture on the associated node. The motion events are linearly interpolated between start and end. The coordinates are in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default duration is 200 milliseconds.
Parameters
| start | The start position of the gesture, in the node's local coordinate system |
| end | The end position of the gesture, in the node's local coordinate system |
| durationMillis | The duration of the gesture |
swipe
fun TouchInjectionScope.swipe(start: Offset, end: Offset, durationMillis: Long = 200)
Performs a swipe gesture on the associated node.
The motion events are linearly interpolated between start and end. The coordinates are in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default duration is 200 milliseconds.
Parameters
| start | The start position of the gesture, in the node's local coordinate system |
| end | The end position of the gesture, in the node's local coordinate system |
| durationMillis | The duration of the gesture |
swipe
fun TouchInjectionScope.swipe(
curve: (timeMillis: Long) -> Offset,
durationMillis: Long = 200,
keyTimes: List<Long> = emptyList(),
)
Performs a swipe gesture on the associated node.
The swipe follows the curve from 0 till durationMillis. Will force sampling of an event at all times defined in keyTimes. The time between events is kept as close to eventPeriodMillis as possible, given the constraints. The coordinates are in the node's local coordinate system, where (0, 0) is the top left corner of the node. The default duration is 200 milliseconds.
Parameters
| curve | The function that describes the gesture. The argument passed to the function is the time in milliseconds since the start of the swipe, and the return value is the location of the pointer at that point in time. |
| durationMillis | The duration of the gesture |
| keyTimes | An optional list of timestamps in milliseconds at which a move event must be sampled |