update 修复返回首页问题
This commit is contained in:
@@ -30,8 +30,8 @@ fun goHome() {
|
||||
* 可能因为管理员排版首页Tab而导致找不到匹配title
|
||||
*/
|
||||
fun goHomeTab(title: String): Boolean {
|
||||
var atHome = false
|
||||
while (!atHome) {
|
||||
var find = false
|
||||
while (!find) {
|
||||
val list = AccessibilityUtil.findAllOnceByText(getRoot(), title, exact = true)
|
||||
for (item in list) {
|
||||
val childCount = item.parent?.parent?.parent?.childCount
|
||||
@@ -48,10 +48,13 @@ fun goHomeTab(title: String): Boolean {
|
||||
AccessibilityUtil.performClick(item)
|
||||
sleep(300)
|
||||
}
|
||||
atHome = true
|
||||
find = true
|
||||
}
|
||||
}
|
||||
if (!atHome) {
|
||||
if (!find) {
|
||||
if (isAtHome()) {
|
||||
return false
|
||||
} else {
|
||||
backPress()
|
||||
//如果在登录页面就提示关闭worktool主功能
|
||||
if (AccessibilityUtil.findOnceByText(getRoot(), "手机号登录", exact = true) != null) {
|
||||
@@ -62,8 +65,9 @@ fun goHomeTab(title: String): Boolean {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
LogUtils.v("进入首页-${title}页")
|
||||
return atHome
|
||||
return find
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user