update 优化查找控件

This commit is contained in:
gallonyin
2023-06-12 18:44:30 +08:00
parent d88db3a9e7
commit a1ae8702ef

View File

@@ -2216,7 +2216,7 @@ object WeworkOperationImpl {
private fun groupChangeRemark(groupRemark: String?): Boolean { private fun groupChangeRemark(groupRemark: String?): Boolean {
if (groupRemark == null) return true if (groupRemark == null) return true
if (WeworkRoomUtil.intoGroupManager()) { if (WeworkRoomUtil.intoGroupManager()) {
val textView = AccessibilityUtil.findOneByText(getRoot(), "备注", exact = true) val textView = AccessibilityUtil.scrollAndFindByText(WeworkController.weworkService, getRoot(), "备注", exact = true)
if (textView != null) { if (textView != null) {
AccessibilityUtil.performClick(textView) AccessibilityUtil.performClick(textView)
if (AccessibilityUtil.findTextInput(getRoot(), groupRemark)) { if (AccessibilityUtil.findTextInput(getRoot(), groupRemark)) {
@@ -2244,7 +2244,7 @@ object WeworkOperationImpl {
private fun groupTemplate(groupTemplate: String?): Boolean { private fun groupTemplate(groupTemplate: String?): Boolean {
if (groupTemplate == null) return true if (groupTemplate == null) return true
if (WeworkRoomUtil.intoGroupManager()) { if (WeworkRoomUtil.intoGroupManager()) {
val textView = AccessibilityUtil.findOneByText(getRoot(), "使用模板快速配置群", exact = true) val textView = AccessibilityUtil.scrollAndFindByText(WeworkController.weworkService, getRoot(), "使用模板快速配置群", exact = true)
if (textView != null) { if (textView != null) {
AccessibilityUtil.performClick(textView) AccessibilityUtil.performClick(textView)
val item = AccessibilityUtil.findOneByDesc(getRoot(), groupTemplate) val item = AccessibilityUtil.findOneByDesc(getRoot(), groupTemplate)