Function

multiTouchSwipeWithVelocity

Performs a multi-touch swipe gesture on the associated node such that each pointer ends with the given velocity.

touchInputMultiTouchSwipeWithVelocity

@Sampled
fun touchInputMultiTouchSwipeWithVelocity() {
    // Pinch open (zoom in) with two fingers starting at the center and moving outwards with
    // velocity
    composeTestRule.onNodeWithTag("myComponent").performTouchInput {
        val swipe0 = SwipeInfo(start = center, end = center - Offset(200f, 0f), endVelocity = 1000f)
        val swipe1 = SwipeInfo(start = center, end = center + Offset(200f, 0f), endVelocity = 1000f)
        multiTouchSwipeWithVelocity(listOf(swipe0, swipe1))
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: