Compose Modifier

onIndirectPointerGesture

A Modifier that detects high-level click and horizontal swipe gestures from an IndirectPointerEvent source.

OnIndirectPointerGestureSample

@Composable
@Sampled
fun OnIndirectPointerGestureSample() {
    Box(
        modifier =
            Modifier.fillMaxSize()
                .onIndirectPointerGesture(
                    enabled = true,
                    onSwipeForward = { /* onSwipeForward */ },
                    onSwipeBackward = { /* onSwipeBackward */ },
                    onClick = { /* onClick */ },
                )
                .focusTarget()
    ) {
        // App()
    }
}
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: