---
title: "LocalOneHandedGestureEnabled"
description: "CompositionLocal that controls whether one-handed gestures are enabled within the provided composition tree."
type: "property"
lastmod: "2026-06-04T09:07:43.971349Z"
---
## API Reference

> Source set: Android

```kotlin
public val LocalOneHandedGestureEnabled: ProvidableCompositionLocal<Boolean>
```

CompositionLocal that controls whether one-handed gestures are enabled within the provided
composition tree.

When set to `true` (the default), any `Modifier.oneHandedGesture` applied within this composition
scope will actively track and process one-handed gestures. When provided with `false`, those
modifiers will gracefully ignore relevant touch events without being removed from the composition
tree. 
```
CompositionLocalProvider(LocalOneHandedGestureEnabled provides false) { // Any oneHandedGesture modifiers inside this component will be disabled MyEncapsulatedScreenContent()
}
```

Sample demonstrating how to disable gesture:

## Code Examples

### OneHandedGestureDisableButtonSample
```kotlin
@Composable
fun OneHandedGestureDisableButtonSample() {
    var counter by remember { mutableIntStateOf(0) }
    var enabled by remember { mutableStateOf(true) }
    val interactionSource = remember { MutableInteractionSource() }
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Column(horizontalAlignment = Alignment.CenterHorizontally) {
            SwitchButton(checked = enabled, onCheckedChange = { enabled = it }) {
                Text("Gestures enabled")
            }
            Spacer(modifier = Modifier.height(6.dp))
            CompositionLocalProvider(LocalOneHandedGestureEnabled provides enabled) {
                Button(
                    onClick = {},
                    interactionSource = interactionSource,
                    modifier =
                        Modifier.oneHandedGesture(
                            action = GestureAction.Primary,
                            interactionSource = interactionSource,
                            onGesture = { counter++ },
                        ),
                ) {
                    OneHandedGestureIndicator(interactionSource = interactionSource) {
                        Text("Gestured $counter times")
                    }
                }
            }
        }
    }
}
```
