fix getGroupInfo
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
android:name="org.yameida.worktool.activity.ListenActivity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden"
|
||||
android:theme="@style/AppTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package org.yameida.worktool.service
|
||||
|
||||
import android.graphics.Rect
|
||||
import android.view.accessibility.AccessibilityNodeInfo
|
||||
import com.blankj.utilcode.util.GsonUtils
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import org.yameida.worktool.Constant
|
||||
import org.yameida.worktool.model.WeworkMessageBean
|
||||
import org.yameida.worktool.model.WeworkMessageListBean
|
||||
@@ -31,6 +33,14 @@ fun goHomeTab(title: String): Boolean {
|
||||
val list = getRoot().findAccessibilityNodeInfosByText("消息")
|
||||
for (item in list) {
|
||||
if (item.parent.parent.parent.childCount == 5) {
|
||||
//处理侧边栏抽屉打开
|
||||
if (title == "消息") {
|
||||
val rect = Rect()
|
||||
item.getBoundsInScreen(rect)
|
||||
if (rect.left > ScreenUtils.getScreenWidth() / 2) {
|
||||
goHomeTab("工作台")
|
||||
}
|
||||
}
|
||||
atHome = true
|
||||
val tempList = getRoot().findAccessibilityNodeInfosByText(title)
|
||||
for (tempItem in tempList) {
|
||||
|
||||
@@ -115,7 +115,7 @@ object WeworkGetImpl {
|
||||
val weworkMessageBean = WeworkMessageBean()
|
||||
weworkMessageBean.type = WeworkMessageBean.GET_GROUP_INFO
|
||||
val tvManagerFlag =
|
||||
AccessibilityUtil.findOneByText(getRoot(), "由企业微信用户创建,可邀请微信用户进群", "该群由企业微信用户创建")
|
||||
AccessibilityUtil.findOneByText(getRoot(), "微信用户创建")
|
||||
val button = AccessibilityUtil.findFrontNode(tvManagerFlag)
|
||||
val tvGroupName = AccessibilityUtil.findOneByClazz(button, Views.TextView)
|
||||
if (tvGroupName != null && tvGroupName.text != null) {
|
||||
|
||||
@@ -485,7 +485,7 @@ object WeworkOperationImpl {
|
||||
private fun groupRename(groupName: String): Boolean {
|
||||
if (WeworkRoomUtil.intoGroupManager()) {
|
||||
val textView =
|
||||
AccessibilityUtil.findOneByText(getRoot(), "由企业微信用户创建,可邀请微信用户进群", "该群由企业微信用户创建")
|
||||
AccessibilityUtil.findOneByText(getRoot(), "微信用户创建")
|
||||
val button = AccessibilityUtil.findFrontNode(textView)
|
||||
if (button != null) {
|
||||
AccessibilityUtil.performClick(button)
|
||||
|
||||
@@ -119,11 +119,7 @@ object WeworkRoomUtil {
|
||||
* @return true 成功进入群管理页
|
||||
*/
|
||||
fun intoGroupManager(): Boolean {
|
||||
if (AccessibilityUtil.findOneByText(
|
||||
getRoot(),
|
||||
"由企业微信用户创建,可邀请微信用户进群",
|
||||
"该群由企业微信用户创建"
|
||||
) != null) {
|
||||
if (AccessibilityUtil.findOneByText(getRoot(), "微信用户创建") != null) {
|
||||
return true
|
||||
}
|
||||
val list = findOneByClazz(getRoot(), Views.ListView)
|
||||
|
||||
Reference in New Issue
Block a user