Function
Common
fun SemanticsNodeInteraction.performRotaryScrollInput(
block: RotaryInjectionScope.() -> Unit
): SemanticsNodeInteraction
Executes the rotary input specified in the given block.
The block receives a RotaryInjectionScope which provides access to rotary input injection functions, such as RotaryInjectionScope.rotateToScrollVertically or RotaryInjectionScope.rotateToScrollHorizontally.
All events that are injected from the block are batched together and sent after block is complete. This method blocks while the events are injected. If an error occurs during execution of block or injection of the events, all (subsequent) events are dropped and the error is thrown here.
Example of performing a scroll with three events:
Parameters
| block | A lambda with RotaryInjectionScope as receiver that describes the gesture by sending all rotary scroll events. |
Returns
The SemanticsNodeInteraction that is the receiver of this method |
Code Examples
rotaryInputScroll
fun rotaryInputScroll() {
composeTestRule.onNodeWithTag("myComponent").performRotaryScrollInput {
rotateToScrollVertically(3.0f)
rotateToScrollVertically(10.0f)
rotateToScrollVertically(2.0f)
}
}