Applier

interface Applier<N>

An Applier is responsible for applying the tree-based operations that get emitted during a composition. Every Composer has an Applier which it uses to emit.

A custom Applier implementation will be needed in order to utilize Compose to build and maintain a tree of a novel type.

Samples

androidx.compose.runtime.samples.CustomTreeComposition

See also

Functions

clear
Link copied to clipboard
common
abstract fun clear()
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
Link copied to clipboard
common
abstract fun down(node: N)
Indicates that the applier is getting traversed "down" the tree.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
insertBottomUp
Link copied to clipboard
common
abstract fun insertBottomUp(index: Int, instance: N)
Indicates that instance should be inserted as a child of current at index.
insertTopDown
Link copied to clipboard
common
abstract fun insertTopDown(index: Int, instance: N)
Indicates that instance should be inserted as a child to current at index.
move
Link copied to clipboard
common
abstract fun move(from: Int, to: Int, count: Int)
Indicates that count children of current should be moved from index from to index to.
onBeginChanges
Link copied to clipboard
common
open fun onBeginChanges()
Called when the Composer is about to begin applying changes using this applier.
onEndChanges
Link copied to clipboard
common
open fun onEndChanges()
Called when the Composer is finished applying changes using this applier.
remove
Link copied to clipboard
common
abstract fun remove(index: Int, count: Int)
Indicates that the children of current from index to index + count should be removed.
toString
Link copied to clipboard
common
open fun toString(): String
up
Link copied to clipboard
common
abstract fun up()
Indicates that the applier is getting traversed "up" the tree.

Properties

current
Link copied to clipboard
common
abstract val current: N
The node that operations will be applied on at any given time.

Inheritors

AbstractApplier
Link copied to clipboard