printToString

Function

Common
fun SemanticsNodeInteraction.printToString(
    /*@IntRange(from = 0)*/
    maxDepth: Int = Int.MAX_VALUE
): String

Prints all the semantics nodes information it holds into string.

By default this also prints all the sub-hierarchy. This can be changed by setting a custom max depth in maxDepth.

Note that this will fetch the latest snapshot of nodes it sees in the hierarchy for the IDs it collected before. So the output can change over time if the tree changes.

Parameters

maxDepthMax depth of the nodes in hierarchy to print. Zero will print just this node. Must not be negative.
Common
fun SemanticsNodeInteractionCollection.printToString(
    /*@IntRange(from = 0)*/
    maxDepth: Int = 0
): String

Prints all the semantics nodes information it holds into string.

By default this does not print nodes sub-hierarchies. This can be changed by setting a custom max depth in maxDepth.

Note that this will fetch the latest snapshot of nodes it sees in the hierarchy for the IDs it collected before. So the output can change over time if the tree changes.

Parameters

maxDepthMax depth of the nodes in hierarchy to print. Zero will print nodes in this collection only. Must not be negative.