Start native apps faster with the Composables CLI ->
Class

AnchorPolicy

Represents the anchoring behavior of a spatial object.

Source set: Android
@Deprecated(
    message =
        "Use SubspaceModifier.movable(movePolicy = MovePolicy.anchor()) on the Composable's modifier instead."
)
public class AnchorPolicy(
    public val isEnabled: Boolean = true,
    public val anchorPlaneOrientations: Set<PlaneOrientation> = emptySet(),
    public val anchorPlaneSemantics: Set<PlaneSemantic> = emptySet(),
) : DragPolicy()

Represents the anchoring behavior of a spatial object.

An AnchorPolicy object can be placed and re-anchored on detected surfaces in the environment. This class defines properties that control how anchoring behaves, such as whether it's enabled and what types of planes it can anchor to.

This functionality requires androidx.xr.runtime.Session.configure to be called with androidx.xr.runtime.PlaneTrackingMode.HORIZONTAL_AND_VERTICAL. This configuration requires that the SCENE_UNDERSTANDING_COARSE Android permission is granted. If not granted, the anchorable functionality will be disabled, and the element will behave as if the anchorable modifier was not applied.

Functions

equals

Source set: Android
override fun equals(other: Any?): Boolean

hashCode

Source set: Android
override fun hashCode(): Int

toString

Source set: Android
override fun toString(): String