{% setvar book_path %}/reference/dokkatest/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ViewDebug.HierarchyHandler

{% setvar page_path %}dokkatest/platform/ViewDebug.HierarchyHandler.html{% endsetvar %} {% setvar can_switch %}1{% endsetvar %} {% include "reference/_java_switcher2.md" %}

interface ViewDebug.HierarchyHandler


Allows a View to inject custom children into HierarchyViewer. For example,WebView uses this to add its internal layer tree as a child to itself

Summary

Public methods

abstract @NonNull void
dumpViewHierarchyWithProperties(
    @NonNull BufferedWriter out,
    @NonNull int level
)

Dumps custom children to hierarchy viewer.See ViewDebug.dumpViewWithProperties(Context, View, BufferedWriter, int)for the formatAn empty implementation should simply do nothing

abstract @NonNull View
findHierarchyView(@NonNull String className, @NonNull int hashCode)

Returns a View to enable grabbing screenshots from custom childrenreturned in dumpViewHierarchyWithProperties.

Public methods

dumpViewHierarchyWithProperties

@NonNull
public abstract void dumpViewHierarchyWithProperties(
    @NonNull BufferedWriter out,
    @NonNull int level
)

Dumps custom children to hierarchy viewer.See ViewDebug.dumpViewWithProperties(Context, View, BufferedWriter, int)for the formatAn empty implementation should simply do nothing

Parameters
@NonNull BufferedWriter out

The output writer

@NonNull int level

The indentation level

findHierarchyView

@NonNull
public abstract View findHierarchyView(@NonNull String className, @NonNull int hashCode)

Returns a View to enable grabbing screenshots from custom childrenreturned in dumpViewHierarchyWithProperties.

Parameters
@NonNull String className

The className of the view to find

@NonNull int hashCode

The hashCode of the view to find

Returns
View

the View to capture from, or null if not found