Node

class Node(owner: Any) : LifecycleGraph

Functions

addChild
Link copied to clipboard
fun addChild(child: LifecycleGraph.Node)
Adds child as a dependent lifecycle sharing the same scope and attachment status as this instance.
addChildren
Link copied to clipboard
fun addChildren(childrenToAdd: Collection<LifecycleGraph.Node>)
addListener
Link copied to clipboard
fun addListener(listener: LifecycleListener): CancellationToken
dumpBranchToRoot
Link copied to clipboard
fun dumpBranchToRoot(): String
dumpTree
Link copied to clipboard
fun dumpTree(): String
hasChild
Link copied to clipboard
fun hasChild(child: LifecycleGraph.Node): Boolean
onDidAttach
Link copied to clipboard
fun onDidAttach(validity: LifecycleListener.Validity = LifecycleListener.Validity.Infinite, listener: () -> Unit): CancellationToken
Registers listener for the DidAttach event.
onDidDetach
Link copied to clipboard
fun onDidDetach(validity: LifecycleListener.Validity = LifecycleListener.Validity.Infinite, listener: () -> Unit): CancellationToken
Registers listener for the DidDetach event.
onWillAttach
Link copied to clipboard
fun onWillAttach(validity: LifecycleListener.Validity = LifecycleListener.Validity.Infinite, listener: () -> Unit): CancellationToken
Registers listener for the WillAttach event.
onWillDetach
Link copied to clipboard
fun onWillDetach(validity: LifecycleListener.Validity = LifecycleListener.Validity.Infinite, listener: () -> Unit): CancellationToken
Registers listener for the WillDetach event.
removeChild
Link copied to clipboard
fun removeChild(child: LifecycleGraph.Node)
removeChildren
Link copied to clipboard
fun removeChildren(childrenToRemove: Collection<Lifecycle>)
removeFromParent
Link copied to clipboard
fun removeFromParent()
removeListener
Link copied to clipboard
fun removeListener(listener: LifecycleListener)
runOnceIfAttached
Link copied to clipboard
fun runOnceIfAttached(runner: suspend CoroutineScope.() -> Unit): Boolean
Launches runner right away if attached, does nothing otherwise.
topMostNode
Link copied to clipboard
fun topMostNode(): LifecycleGraph
toString
Link copied to clipboard
open override fun toString(): String
whileAttached
Link copied to clipboard
fun whileAttached(runner: suspend CoroutineScope.() -> Unit): CancellationToken
Registers runner to be launched each time this lifecycle is attached to a scope and cancelled once detached.

Properties

debugDescription
Link copied to clipboard
val debugDescription: String
isAttached
Link copied to clipboard
val isAttached: Boolean