Function

animateMoveAlong

Move the trackpad along the given [curve], sending a stream of move events to get an animated path of [durationMillis] milliseconds.

mouseInputAnimateMoveAlong

fun mouseInputAnimateMoveAlong() {
    composeTestRule.onNodeWithTag("myComponent").performMouseInput {
        // Hover over the node, making a full circle with a radius of 100px
        val r = 100f
        animateMoveAlong(
            curve = {
                val angle = 2 * PI * it / 1000
                center + Offset(r * cos(angle).toFloat(), r * sin(angle).toFloat())
            },
            durationMillis = 1000L,
        )
    }
}

trackpadInputAnimateMoveAlong

fun trackpadInputAnimateMoveAlong() {
    composeTestRule.onNodeWithTag("myComponent").performTrackpadInput {
        // Hover over the node, making a full circle with a radius of 100px
        val r = 100f
        animateMoveAlong(
            curve = {
                val angle = 2 * PI * it / 1000
                center + Offset(r * cos(angle).toFloat(), r * sin(angle).toFloat())
            },
            durationMillis = 1000L,
        )
    }
}