RotaryInjectionScope


The receiver scope of rotary input injection lambda from performRotaryScrollInput.

A rotary event can be sent with rotateToScrollVertically or rotateToScrollHorizontally. All events sent by these methods are batched together and sent as a whole after performRotaryScrollInput has executed its code block.

Example of performing a scroll with three events:

import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performRotaryScrollInput

composeTestRule.onNodeWithTag("myComponent").performRotaryScrollInput {
    rotateToScrollVertically(3.0f)
    rotateToScrollVertically(10.0f)
    rotateToScrollVertically(2.0f)
}

Summary

Public functions

Unit
rotateToScrollHorizontally(horizontalScrollPixels: Float)

Sends a scroll event that represents a rotation that will result in a scroll distance of horizontalScrollPixels.

Cmn
Unit
rotateToScrollVertically(verticalScrollPixels: Float)

Sends a scroll event that represents a rotation that will result in a scroll distance of verticalScrollPixels.

Cmn

Inherited functions

From androidx.compose.ui.unit.Density
open Int

Convert Dp to Int by rounding

Cmn
open Int

Convert Sp to Int by rounding

Cmn
open Dp

Convert an Int pixel value to Dp.

Cmn
open Dp

Convert a Float pixel value to a Dp

Cmn
open DpSize

Convert a Size to a DpSize.

Cmn
open Float

Convert Dp to pixels.

Cmn
open Float

Convert Sp to pixels.

Cmn
open Rect

Convert a DpRect to a Rect.

Cmn
open Size

Convert a DpSize to a Size.

Cmn
open TextUnit

Convert an Int pixel value to Sp.

Cmn
open TextUnit

Convert a Float pixel value to a Sp

Cmn
From androidx.compose.ui.unit.FontScaling
open Dp

Convert Sp to Dp.

Cmn
open TextUnit

Convert Dp to Sp.

Cmn
From androidx.compose.ui.test.InjectionScope
Unit
advanceEventTime(durationMillis: Long)

Adds the given durationMillis to the current event time, delaying the next event by that time.

Cmn
open Offset

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

Cmn

Inherited properties

From androidx.compose.ui.unit.Density
Float

The logical density of the display.

Cmn
From androidx.compose.ui.unit.FontScaling
Float

Current user preference for the scaling factor for fonts.

Cmn
From androidx.compose.ui.test.InjectionScope
open Float

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

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
open Float

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

Cmn
open Float

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

Cmn
open Long

The default time between two successive events.

Cmn
open Int

The height of the node in px.

Cmn
open Float

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

Cmn
open Float

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

Cmn
open Float

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

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
open Offset

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.

Cmn
ViewConfiguration

The ViewConfiguration in use by the SemanticsNode from the SemanticsNodeInteraction on which the input injection method is called.

Cmn
IntSize

The size of the visible part of the node we're interacting with in px, i.e. its clipped bounds.

Cmn
open Int

The width of the node in px.

Cmn

Public functions

rotateToScrollHorizontally

fun rotateToScrollHorizontally(horizontalScrollPixels: Float): Unit

Sends a scroll event that represents a rotation that will result in a scroll distance of horizontalScrollPixels. The event will be sent at the current event time. Positive horizontalScrollPixels values will correspond to rotating the scroll wheel clockwise, negative values correspond to rotating the scroll wheel anticlockwise.

Parameters
horizontalScrollPixels: Float

The amount of scroll, in pixels

rotateToScrollVertically

fun rotateToScrollVertically(verticalScrollPixels: Float): Unit

Sends a scroll event that represents a rotation that will result in a scroll distance of verticalScrollPixels. The event will be sent at the current event time. Positive verticalScrollPixels values will correspond to rotating the scroll wheel clockwise, negative values correspond to rotating the scroll wheel anticlockwise.

Parameters
verticalScrollPixels: Float

The amount of scroll, in pixels