1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 13:25:13 +00:00

fix: back in ui

This commit is contained in:
RedDeadDepresso 2024-01-10 00:55:47 +00:00
parent 1b1304442f
commit b22681b71a
2 changed files with 4 additions and 4 deletions

View File

@ -188,4 +188,4 @@ class Device(Screenshot, Control, AppControl, Platform):
self.click_record_clear() self.click_record_clear()
def back(self): def back(self):
self.u2.press("back") self.adb_shell("input keyevent 4")

View File

@ -130,7 +130,7 @@ class UI(MainPage):
self.interval_clear(list(Page.iter_check_buttons())) self.interval_clear(list(Page.iter_check_buttons()))
# loading_timer = Timer(0.5) # loading_timer = Timer(0.5)
back_timer = Timer(8, 5).start() back_timer = Timer(10, 10)
logger.hr(f"UI goto {destination}") logger.hr(f"UI goto {destination}")
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
@ -177,6 +177,7 @@ class UI(MainPage):
if self.ui_additional(): if self.ui_additional():
continue continue
back_timer.start()
if back_timer.reached_and_reset(): if back_timer.reached_and_reset():
if self.match_color(LOGIN_LOADING, interval=5, threshold=80) or self.appear_trademark_year(): if self.match_color(LOGIN_LOADING, interval=5, threshold=80) or self.appear_trademark_year():
from tasks.login.login import Login from tasks.login.login import Login
@ -214,7 +215,6 @@ class UI(MainPage):
else: else:
logger.info("Goto %s" % destination) logger.info("Goto %s" % destination)
self.ui_goto(destination, skip_first_screenshot=True) self.ui_goto(destination, skip_first_screenshot=True)
self.close_popup(destination.check_button)
return True return True
def ui_ensure_index( def ui_ensure_index(
@ -441,7 +441,7 @@ class UI(MainPage):
wait = Timer(1).start() wait = Timer(1).start()
while 1: while 1:
self.device.screenshot() self.device.screenshot()
if self.match_color(check_button): if self.match_color(check_button) or not self.appear(check_button):
break break
self.device.back() self.device.back()
if timer.reached(): if timer.reached():