fix 类型判断异常
This commit is contained in:
@@ -398,7 +398,6 @@ object AccessibilityUtil {
|
|||||||
var currentTime = startTime
|
var currentTime = startTime
|
||||||
while (currentTime - startTime <= timeout) {
|
while (currentTime - startTime <= timeout) {
|
||||||
val result = findOnceByText(node, *textList, exact = exact)
|
val result = findOnceByText(node, *textList, exact = exact)
|
||||||
LogUtils.v("text: ${textList.joinToString()} result == null: ${result == null}")
|
|
||||||
if (result != null) return result
|
if (result != null) return result
|
||||||
sleep(SHORT_INTERVAL)
|
sleep(SHORT_INTERVAL)
|
||||||
if (root) {
|
if (root) {
|
||||||
@@ -424,7 +423,7 @@ object AccessibilityUtil {
|
|||||||
else if (textNodeList.size > 0) {
|
else if (textNodeList.size > 0) {
|
||||||
for (textNode in textNodeList) {
|
for (textNode in textNodeList) {
|
||||||
for (text in textList) {
|
for (text in textList) {
|
||||||
if (textNode.text == text) {
|
if (textNode.text?.toString() == text) {
|
||||||
return textNode
|
return textNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,7 +479,7 @@ object AccessibilityUtil {
|
|||||||
list: ArrayList<AccessibilityNodeInfo> = ArrayList()
|
list: ArrayList<AccessibilityNodeInfo> = ArrayList()
|
||||||
): ArrayList<AccessibilityNodeInfo> {
|
): ArrayList<AccessibilityNodeInfo> {
|
||||||
if (node == null) return list
|
if (node == null) return list
|
||||||
val nodeText = node.text
|
val nodeText = node.text?.toString()
|
||||||
if (nodeText != null) {
|
if (nodeText != null) {
|
||||||
for (text in textList) {
|
for (text in textList) {
|
||||||
if (exact && nodeText == text) {
|
if (exact && nodeText == text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user