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

UiApplier

class UiApplier : Applier<Any>
kotlin.Any
   ↳ androidx.compose.ui.node.UiApplier

Summary

Public constructors
<init>(root: Any)

Public methods
Unit

Move to the root and remove all nodes from the root, preparing both this Applier and its root to be used as the target of a new composition in the future.

Unit
down(node: Any)

Indicates that the applier is getting traversed "down" the tree.

Unit
insert(index: Int, instance: Any)

Indicates that instance should be inserted as a child to current at index

Unit
move(from: Int, to: Int, count: Int)

Indicates that the children of current from from to from + count should be moved to to + count.

Unit
remove(index: Int, count: Int)

Indicates that the children of current from index to index + count should be removed.

Unit
up()

Indicates that the applier is getting traversed "up" the tree.

Inherited functions
Properties
Any

The node that operations will be applied on at any given time.

Public constructors

<init>

UiApplier(root: Any)

Public methods

clear

fun clear(): Unit

Move to the root and remove all nodes from the root, preparing both this Applier and its root to be used as the target of a new composition in the future.

down

fun down(node: Any): Unit

Indicates that the applier is getting traversed "down" the tree. When this gets called, node is expected to be a child of current, and after this operation, node is expected to be the new current.

insert

fun insert(
    index: Int,
    instance: Any
): Unit

Indicates that instance should be inserted as a child to current at index

move

fun move(
    from: Int,
    to: Int,
    count: Int
): Unit

Indicates that the children of current from from to from + count should be moved to to + count.

The to index is related to the position before the change, so, for example, to move an element at position 1 to after the element at position 2, from should be 1 and to should be 3. If the elements were A B C D E, calling move(1, 3, 1) would result in the elements being reordered to A C B D E.

remove

fun remove(
    index: Int,
    count: Int
): Unit

Indicates that the children of current from index to index + count should be removed.

up

fun up(): Unit

Indicates that the applier is getting traversed "up" the tree. After this operation completes, the current should return the "parent" of the current node at the beginning of this operation.

Properties

current

var current: Any

The node that operations will be applied on at any given time. It is expected that the value of this property will change as down and up are called.