ViewTree

class ViewTree

This is a helper class to allow asserting on view trees and recursively verify predicates on its nodes within the narrow abilities that Robolectric affords us.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val root: View

Functions

Link copied to clipboard
fun findChild(predicate: Predicate<View>): ImmutableList<View>?

Find a view in the hierarchy for which the given predicate is true

fun findChild(predicate: Predicate<View>, shouldCheckChildren: Predicate<in ViewGroup>): ImmutableList<View>?

Find a view in the hierarchy for which the given predicate is true, while only check children of nodes as directed by the additional shouldCheckChildren predicate

Link copied to clipboard
fun makeString(extraTextFunction: Function<View, out String?>?): String

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

fun makeString(startingDepth: Int, extraTextFunction: Function<View, out 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.