Google is committed to advancing racial equity for Black communities. See how.

Anchor

class Anchor
kotlin.Any
   ↳ androidx.compose.runtime.Anchor

An Anchor tracks a groups as its index changes due to other groups being inserted and removed before it. If the group the Anchor is tracking is removed, directly or indirectly, valid will return false. The current index of the group can be determined by passing either the SlotTable or SlotWriter to toIndexFor. If a SlotWriter is active, it must be used instead of the SlotTable as the anchor index could have shifted due to operations performed on the writer.

Summary

Public methods
Int

Int

Properties
Boolean

Public methods

toIndexFor

fun toIndexFor(slots: SlotTable): Int

toIndexFor

fun toIndexFor(writer: SlotWriter): Int

Properties

valid

val valid: Boolean