Function

movable

Configures this subspace element to be interactive and movable.

movable

Source set: Android
public fun SubspaceModifier.movable(
    enabled: Boolean = true,
    movePolicy: MovePolicy = MovePolicy.Default,
): SubspaceModifier

Configures this subspace element to be interactive and movable.

When this modifier is present and enabled, draggable UI controls will be shown that allow the user to move the element in 3D space. The specific behavior of this movement—such as whether the system automatically applies the transformation, leaves it to the developer, or anchors it to physical surfaces—is defined by the provided MovePolicy. Input events used for moving in this way are consumed.

There are some limitations that should be considered when using this modifier: 1) the draggable UI controls of nested composables using the movable modifier may conflict with each other. 2) Attaching multiple movable modifiers with auto-applying policies (like MovePolicy.system) to the same element will compound the movement distance, since each modifier independently applies the drag offset upon release.

Parameters

enabled true if this composable should be movable. Setting this to false will remove the interactable affordance associated with the content. Disabling the modifier after movement keeps the composable at its last dragged position. Removing the modifier entirely resets the composable to its original layout position.
movePolicy The MovePolicy that dictates how movement transformations are calculated and applied. Defaults to MovePolicy.Default.

Content updated: