Interface

TouchInjectionScope

The receiver scope of the touch input injection lambda from performTouchInput.

touchInputClick

@Sampled
fun touchInputClick() {
    composeTestRule.onNodeWithTag("myComponent").performTouchInput { click() }
}

touchInputSwipeUp

@Sampled
fun touchInputSwipeUp() {
    composeTestRule.onNodeWithTag("myComponent").performTouchInput { swipeUp() }
}

touchInputLShapedGesture

@Sampled
fun touchInputLShapedGesture() {
    composeTestRule.onNodeWithTag("myComponent").performTouchInput {
        down(topLeft)
        moveTo(topLeft + percentOffset(0f, .1f))
        moveTo(topLeft + percentOffset(0f, .2f))
        moveTo(topLeft + percentOffset(0f, .3f))
        moveTo(topLeft + percentOffset(0f, .4f))
        moveTo(centerLeft)
        moveTo(centerLeft + percentOffset(.1f, 0f))
        moveTo(centerLeft + percentOffset(.2f, 0f))
        moveTo(centerLeft + percentOffset(.3f, 0f))
        moveTo(centerLeft + percentOffset(.4f, 0f))
        moveTo(center)
        up()
    }
}
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: