update 优化字符串匹配
This commit is contained in:
@@ -190,11 +190,11 @@ object WeworkLoopImpl {
|
||||
}
|
||||
AccessibilityUtil.findTextAndClick(getRoot(), "通过验证")
|
||||
var textNode = AccessibilityUtil.findOneByText(getRoot(), "完成", "发消息", "添加请求已过期,添加失败", exact = true)
|
||||
if (textNode?.text == "完成") {
|
||||
if (textNode?.text?.toString() == "完成") {
|
||||
AccessibilityUtil.performClick(textNode)
|
||||
}
|
||||
textNode = AccessibilityUtil.findOneByText(getRoot(), "发消息", "添加请求已过期,添加失败", exact = true)
|
||||
if (textNode?.text == "添加请求已过期,添加失败") {
|
||||
if (textNode?.text?.toString() == "添加请求已过期,添加失败") {
|
||||
LogUtils.d("添加好友失败")
|
||||
} else {
|
||||
val weworkMessageBean = WeworkMessageBean()
|
||||
|
||||
@@ -1615,7 +1615,7 @@ object WeworkOperationImpl {
|
||||
if (AccessibilityUtil.findTextInput(getRoot(), content, append = append)) {
|
||||
AccessibilityUtil.findOneByText(getRoot(), "发送", exact = true, timeout = 2000)
|
||||
val sendButton = AccessibilityUtil.findAllByClazz(getRoot(), Views.Button)
|
||||
.firstOrNull { it.text == "发送" }
|
||||
.firstOrNull { it.text?.toString() == "发送" }
|
||||
if (sendButton != null) {
|
||||
LogUtils.d("发送消息: \n$content")
|
||||
log("发送消息: \n$content")
|
||||
@@ -1808,7 +1808,7 @@ object WeworkOperationImpl {
|
||||
val text = child.text
|
||||
val selected = child.isSelected
|
||||
LogUtils.v("text: $text selected: $selected")
|
||||
if (tagList.count { it == text } > 0) {
|
||||
if (tagList.count { it == text?.toString() } > 0) {
|
||||
if (!selected) {
|
||||
AccessibilityUtil.performClick(child)
|
||||
}
|
||||
@@ -1824,7 +1824,7 @@ object WeworkOperationImpl {
|
||||
sleep(Constant.POP_WINDOW_INTERVAL)
|
||||
//可能有两次确定 另一次为添加新tag
|
||||
val textNode = AccessibilityUtil.findOneByText(getRoot(), "确定", "个人信息")
|
||||
if (textNode?.text == "确定") {
|
||||
if (textNode?.text?.toString() == "确定") {
|
||||
AccessibilityUtil.performClick(textNode)
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user