{% setvar book_path %}/reference/kotlin/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/_kotlin_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 functions

Unit

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

View
findHierarchyView(className: String, hashCode: Int)

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

Public functions

dumpViewHierarchyWithProperties

fun dumpViewHierarchyWithProperties(out: BufferedWriter, level: Int): Unit

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

Parameters
out: BufferedWriter

The output writer

level: Int

The indentation level

findHierarchyView

fun findHierarchyView(className: String, hashCode: Int): View

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

Parameters
className: String

The className of the view to find

hashCode: Int

The hashCode of the view to find

Returns
View

the View to capture from, or null if not found