Skip to content

Commit f6628de

Browse files
author
Ven
committed
示例微信不同版本无法滚动问题
1 parent 890e037 commit f6628de

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ proguard/
2929
.idea
3030
build
3131
readme1.md
32+
/key.jks
33+
/simple/_default/release/output-metadata.json

graphics/1691765846270.jpg

13.2 KB
Loading

simple/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ android {
4343
}
4444

4545
dependencies {
46-
implementation project(':assists')
46+
// implementation project(':assists')
4747
implementation project(':base')
4848
implementation "androidx.room:room-runtime:2.4.3"
4949
implementation 'androidx.room:room-ktx:2.4.3'
5050
implementation 'com.github.mrmike:ok2curl:0.8.0'
51-
// implementation 'com.github.ven-coder:assists:1.0.1'
51+
implementation 'com.github.ven-coder:assists:1.0.1'
5252
}

simple/src/main/java/com/ven/assists/simple/step/ScrollContacts.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.ven.assists.simple.step
22

33
import android.content.ComponentName
44
import android.content.Intent
5-
import android.util.Log
65
import android.view.accessibility.AccessibilityNodeInfo
76
import com.ven.assist.Assists
87
import com.ven.assist.ext.click
@@ -47,7 +46,6 @@ class ScrollContacts : StepImpl {
4746
OverManager.log("滚动下一页:${step.data}")
4847
UIOperate.findByTags("android.widget.ListView").forEach {
4948
val screen = it.getBoundsInScreen()
50-
Log.d(Assists.Config.logTag, "${screen.left}/${screen.top}/${screen.right}/${screen.bottom}")
5149
if (screen.left >= 0 && screen.left < UIOperate.getX(1080, 1080) &&
5250
screen.right >= UIOperate.getX(1080, 1080)
5351
) {
@@ -61,6 +59,20 @@ class ScrollContacts : StepImpl {
6159
}
6260

6361
}
62+
UIOperate.findByTags("androidx.recyclerview.widget.RecyclerView").forEach {
63+
val screen = it.getBoundsInScreen()
64+
if (screen.left >= 0 && screen.left < UIOperate.getX(1080, 1080) &&
65+
screen.right >= UIOperate.getX(1080, 1080)
66+
) {
67+
it.performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD)
68+
if (step.data as Int >= 5) {
69+
OverManager.log("停止滚动")
70+
return@next
71+
}
72+
StepManager.execute(this::class.java, Step.STEP_3, data = ((step.data as Int) + 1))
73+
return@next
74+
}
75+
}
6476
}
6577
}
6678
}

simple/src/main/res/layout/view_main_over.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,23 @@
6161
android:layout_width="match_parent"
6262
android:layout_height="wrap_content"
6363
android:backgroundTint="@color/colorAccent"
64-
android:text="打开微信朋友圈"
64+
android:text="自动打开微信朋友圈"
6565
android:textColor="@color/colorPrimary" />
6666

6767
<Button
6868
android:id="@+id/btn_publish_social"
6969
android:layout_width="match_parent"
7070
android:layout_height="wrap_content"
7171
android:backgroundTint="@color/colorAccent"
72-
android:text="发表一条微信私密朋友圈"
72+
android:text="自动发表一条微信私密朋友圈"
7373
android:textColor="@color/colorPrimary" />
7474

7575
<Button
7676
android:id="@+id/btn_scroll_contacts"
7777
android:layout_width="match_parent"
7878
android:layout_height="wrap_content"
7979
android:backgroundTint="@color/colorAccent"
80-
android:text="滚动微信通讯录"
80+
android:text="自动滚动微信通讯录"
8181
android:textColor="@color/colorPrimary" />
8282

8383
<Button

0 commit comments

Comments
 (0)