public final class ViewTree extends Object
Modifier and Type | Method and Description |
---|---|
<any> |
findChild(<any> predicate)
Find a view in the hierarchy for which the given predicate is true
|
<any> |
findChild(<any> predicate,
<any> shouldCheckChildren)
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
|
View |
getRoot() |
String |
makeString(<any> extraTextFunction)
Generates a string describing the views tree using the views' toString methods and an extra
information function.
|
static ViewTree |
of(View view) |
public static ViewTree of(View view)
public View getRoot()
@Nullable public <any> findChild(<any> predicate)
predicate
- the predicate to find a view upholding@Nullable public <any> findChild(<any> predicate, <any> shouldCheckChildren)
predicate
- the predicate to find a view upholdingshouldCheckChildren
- a predicate to decide whether topublic String makeString(<any> extraTextFunction)
extraTextFunction
- the function returning extra information to print per view, or null
if not extra information should be printed