fix 类型判断异常

This commit is contained in:
尹甲仑
2022-08-26 15:44:01 +08:00
parent 96f15bb969
commit 34eedd095c

View File

@@ -398,7 +398,6 @@ object AccessibilityUtil {
var currentTime = startTime
while (currentTime - startTime <= timeout) {
val result = findOnceByText(node, *textList, exact = exact)
LogUtils.v("text: ${textList.joinToString()} result == null: ${result == null}")
if (result != null) return result
sleep(SHORT_INTERVAL)
if (root) {
@@ -424,7 +423,7 @@ object AccessibilityUtil {
else if (textNodeList.size > 0) {
for (textNode in textNodeList) {
for (text in textList) {
if (textNode.text == text) {
if (textNode.text?.toString() == text) {
return textNode
}
}
@@ -480,7 +479,7 @@ object AccessibilityUtil {
list: ArrayList<AccessibilityNodeInfo> = ArrayList()
): ArrayList<AccessibilityNodeInfo> {
if (node == null) return list
val nodeText = node.text
val nodeText = node.text?.toString()
if (nodeText != null) {
for (text in textList) {
if (exact && nodeText == text) {