update at列表优化模式
This commit is contained in:
@@ -285,6 +285,13 @@ object WeworkGetImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
val tvCountFlag = AccessibilityUtil.findOnceByText(getRoot(), "查看全部群成员", exact = true)
|
||||||
|
val tvCount = AccessibilityUtil.findBackNode(tvCountFlag)
|
||||||
|
if (tvCount != null && tvCount.text != null) {
|
||||||
|
LogUtils.d("群成员: " + tvCount.text)
|
||||||
|
val count = tvCount.text.toString().replace("人", "")
|
||||||
|
weworkMessageBean.groupNumber = count.toIntOrNull()
|
||||||
|
}
|
||||||
val gridView = AccessibilityUtil.findOneByClazz(getRoot(), Views.GridView)
|
val gridView = AccessibilityUtil.findOneByClazz(getRoot(), Views.GridView)
|
||||||
if (gridView != null && gridView.childCount >= 2) {
|
if (gridView != null && gridView.childCount >= 2) {
|
||||||
val tvOwnerName = AccessibilityUtil.findOnceByClazz(gridView.getChild(0), Views.TextView)
|
val tvOwnerName = AccessibilityUtil.findOnceByClazz(gridView.getChild(0), Views.TextView)
|
||||||
@@ -292,13 +299,17 @@ object WeworkGetImpl {
|
|||||||
LogUtils.d("群主: " + tvOwnerName.text)
|
LogUtils.d("群主: " + tvOwnerName.text)
|
||||||
weworkMessageBean.groupOwner = tvOwnerName.text.toString()
|
weworkMessageBean.groupOwner = tvOwnerName.text.toString()
|
||||||
}
|
}
|
||||||
}
|
if (!saveMembers && weworkMessageBean.groupNumber ?: 0 <= 8) {
|
||||||
val tvCountFlag = AccessibilityUtil.findOnceByText(getRoot(), "查看全部群成员", exact = true)
|
val set = linkedSetOf<String>()
|
||||||
val tvCount = AccessibilityUtil.findBackNode(tvCountFlag)
|
for (i in 0 until gridView.childCount) {
|
||||||
if (tvCount != null && tvCount.text != null) {
|
val item = gridView.getChild(i)
|
||||||
LogUtils.d("群成员: " + tvCount.text)
|
val name = AccessibilityUtil.findOnceByClazz(item, Views.TextView)?.text?.toString()
|
||||||
val count = tvCount.text.toString().replace("人", "")
|
?: continue
|
||||||
weworkMessageBean.groupNumber = count.toIntOrNull()
|
set.add(name)
|
||||||
|
}
|
||||||
|
LogUtils.d("群成员: ${set.joinToString()}")
|
||||||
|
weworkMessageBean.nameList = set.toList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
val tvAnnouncementFlag = AccessibilityUtil.findOnceByText(getRoot(), "群公告", exact = true)
|
val tvAnnouncementFlag = AccessibilityUtil.findOnceByText(getRoot(), "群公告", exact = true)
|
||||||
val tvAnnouncement = AccessibilityUtil.findBackNode(tvAnnouncementFlag)
|
val tvAnnouncement = AccessibilityUtil.findBackNode(tvAnnouncementFlag)
|
||||||
|
|||||||
@@ -1707,8 +1707,20 @@ object WeworkOperationImpl {
|
|||||||
AccessibilityUtil.performClickWithSon(AccessibilityUtil.findFrontNode(voiceFlag))
|
AccessibilityUtil.performClickWithSon(AccessibilityUtil.findFrontNode(voiceFlag))
|
||||||
}
|
}
|
||||||
var atFailed = false
|
var atFailed = false
|
||||||
val atList = if (!at.isNullOrEmpty()) listOf(at) else atList
|
val atList = if (!at.isNullOrEmpty()) arrayListOf(at) else atList?.toMutableList()
|
||||||
if (!atList.isNullOrEmpty() && (roomType == WeworkMessageBean.ROOM_TYPE_INTERNAL_GROUP || roomType == WeworkMessageBean.ROOM_TYPE_EXTERNAL_GROUP)) {
|
if (!atList.isNullOrEmpty() && (roomType == WeworkMessageBean.ROOM_TYPE_INTERNAL_GROUP || roomType == WeworkMessageBean.ROOM_TYPE_EXTERNAL_GROUP)) {
|
||||||
|
val nameList = arrayListOf<String>()
|
||||||
|
if (atList.count { it.startsWith("#regex#") } > 0 && WeworkRoomUtil.intoGroupManager()) {
|
||||||
|
val groupInfo = WeworkGetImpl.getGroupInfoDetail(saveAddress = false, saveMembers = false)
|
||||||
|
nameList.addAll(groupInfo.nameList)
|
||||||
|
val regex = atList.first { it.startsWith("#regex#") }.split("#regex#").last().toRegex()
|
||||||
|
for (name in groupInfo.nameList) {
|
||||||
|
if (name != Constant.myName && name.matches(regex)) {
|
||||||
|
atList.add(name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
atList.removeIf { it.startsWith("#regex#") }
|
||||||
atList.forEachIndexed { index, at ->
|
atList.forEachIndexed { index, at ->
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
AccessibilityUtil.findTextInput(getRoot(), "@")
|
AccessibilityUtil.findTextInput(getRoot(), "@")
|
||||||
|
|||||||
Reference in New Issue
Block a user