View Hierarchy Tree Node
data class ViewHierarchyTreeNode(val nodeId: Long = 1, val accessibilityText: String? = null, val centerPoint: String? = null, val checked: Boolean = false, val children: List<ViewHierarchyTreeNode> = emptyList(), val className: String? = null, val clickable: Boolean = false, val dimensions: String? = null, val enabled: Boolean = false, val focusable: Boolean = false, val focused: Boolean = false, val ignoreBoundsFiltering: Boolean = false, val password: Boolean = false, val resourceId: String? = null, val scrollable: Boolean = false, val selected: Boolean = false, val text: String? = null, val depth: Int = 0, var containerId: String? = null)
Allows a data model that isn't just straight xml for view hierarchy information.
All UiAutomator attributes: index text resource-id class package content-desc checkable checked clickable enabled focusable focused scrollable long-clickable password selected bounds
Constructors
Link copied to clipboard
constructor(nodeId: Long = 1, accessibilityText: String? = null, centerPoint: String? = null, checked: Boolean = false, children: List<ViewHierarchyTreeNode> = emptyList(), className: String? = null, clickable: Boolean = false, dimensions: String? = null, enabled: Boolean = false, focusable: Boolean = false, focused: Boolean = false, ignoreBoundsFiltering: Boolean = false, password: Boolean = false, resourceId: String? = null, scrollable: Boolean = false, selected: Boolean = false, text: String? = null, depth: Int = 0, containerId: String? = null)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Collect all clickable and enabled elements in the view hierarchy. This is a flat extraction, not an optimization.
Link copied to clipboard
Filter out elements that are outside the bounds of the screen.
Link copied to clipboard
Check if a view hierarchy element is interactable.
Link copied to clipboard
Relabels the tree with new nodeIds using a shared atomic incrementer. Returns a new tree with the same structure and data, but fresh nodeIds.