makeString

open fun makeString(extraTextFunction: Function<View, String>): String

Generates a string describing the views tree using the views' toString methods and an extra information function.

The output is a string, with each view of the tree in its own line, indented according to its depth in the tree, and then the extra information supplied by teh function.

This can be used, for example, to print all views and their respective text and is useful for when assertions fail.

Return

a string describing the tree

Parameters

extraTextFunction

the function returning extra information to print per view, or null if not extra information should be printed


open fun makeString(startingDepth: Int, extraTextFunction: Function<View, String>): String

Generates a string describing the views tree using the views' toString methods and an extra information function with formatting starting at the given depth.

The output is a string, with each view of the tree in its own line, indented according to its depth in the tree, and then the extra information supplied by teh function.

This can be used, for example, to print all views and their respective text and is useful for when assertions fail.

Return

a string describing the tree

Parameters

startingDepth

the starting depth of the tree for spacing