fix 对某个节点或子节点进行点击
This commit is contained in:
@@ -349,23 +349,21 @@ object AccessibilityUtil {
|
|||||||
* 对某个节点或子节点进行点击
|
* 对某个节点或子节点进行点击
|
||||||
*/
|
*/
|
||||||
fun performClickWithSon(nodeInfo: AccessibilityNodeInfo?): Boolean {
|
fun performClickWithSon(nodeInfo: AccessibilityNodeInfo?): Boolean {
|
||||||
var nodeInfo: AccessibilityNodeInfo? = nodeInfo ?: return false
|
if (nodeInfo == null) return false
|
||||||
while (nodeInfo != null) {
|
if (nodeInfo.isClickable) {
|
||||||
if (nodeInfo.isClickable) {
|
nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK)
|
||||||
nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK)
|
return true
|
||||||
return true
|
}
|
||||||
}
|
if (nodeInfo.childCount > 0) {
|
||||||
if (nodeInfo.childCount > 0) {
|
for (i in 0 until nodeInfo.childCount) {
|
||||||
for (i in 0 until nodeInfo.childCount) {
|
if (performClickWithSon(nodeInfo.getChild(i))) {
|
||||||
if (performClickWithSon(nodeInfo.getChild(i))) {
|
return true
|
||||||
return true
|
}
|
||||||
}
|
}
|
||||||
}
|
return false
|
||||||
} else {
|
} else {
|
||||||
nodeInfo = null
|
return false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user