FollowTarget

@ExperimentalFollowingSubspaceApi
abstract class FollowTarget


A FollowTarget can be used to have an element follow a target such as an anchor or view.

Summary

Public companion functions

FollowTarget
anchor(anchor: Anchor, mode: FollowMode)

Targeting an anchor allows content to be positioned relative to that anchor's location.

FollowTarget

By designating content to follow the user's view, it will keep that content near the user and typically within the field of view, even as the user moves around.

Public companion functions

anchor

Added in 1.0.0-beta02
fun anchor(anchor: Anchor, mode: FollowMode = FollowMode.tight()): FollowTarget

Targeting an anchor allows content to be positioned relative to that anchor's location.

Parameters
anchor: Anchor

represents the anchor which the trailing element will be tethered to. As the anchor moves, so will the element.

mode: FollowMode = FollowMode.tight()

determines how the trailing element follows the target. It can be made to move faster and be more responsive. The default is FollowMode.tight().

view

Added in 1.0.0-beta02
fun view(mode: FollowMode = FollowMode.soft()): FollowTarget

By designating content to follow the user's view, it will keep that content near the user and typically within the field of view, even as the user moves around.

Parameters
mode: FollowMode = FollowMode.soft()

determines how the trailing element follows the target. It can be made to move faster and be more responsive. The default is FollowMode.soft().