Skip to content

Commit

Permalink
fix: getChild array index bound error
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 11, 2023
1 parent 0814eb6 commit 3bb2375
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/li/songe/gkd/service/AbExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ private val getAttr: (AccessibilityNodeInfo, String) -> Any? = { node, name ->
}
}

val abTransform = Transform(getAttr = getAttr,
val abTransform = Transform(
getAttr = getAttr,
getName = { node -> node.className },
getChildren = getChildren,
getChild = { node, index -> node.getChild(index) },
getChild = { node, index -> if (index in 0..<node.childCount) node.getChild(index) else null },
getParent = { node -> node.parent },
getDescendants = { node ->
sequence {
Expand Down

0 comments on commit 3bb2375

Please sign in to comment.