From a81217a0b678d84a6d60e676d0722327a2607308 Mon Sep 17 00:00:00 2001 From: jianbo <263303411@qq.com> Date: Fri, 24 Sep 2021 15:31:30 +0800 Subject: [PATCH] atom --- .../fisherbone/fuzhu/step/TestAblStep0.java | 89 ++++--------------- .../fisherbone/fuzhu/step/TestAblStep31.java | 5 +- .../fisherbone/fuzhu/step/TestAblStep34.java | 4 +- 3 files changed, 23 insertions(+), 75 deletions(-) diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java index d71d2c9..9380394 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java @@ -47,82 +47,18 @@ public class TestAblStep0 extends BaseAblStep { case AblSteps.STEP_2: AblViewUtil.mySleep(2); // getNodeInfoh(); - clickmenu("5"); - geliwu(""); + // geliwu(""); + AblService.getInstance().clickPoint(100, 100, 200); break; default: } } - /** - * 点击礼物下面的菜单 - * 1.礼物 - * 2.表情 - * 3.粉丝团 - * 4.等级 - * 5.背包 - */ - public void clickmenu(String type) { - AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); - for (int i = 0; i < root.getChildCount(); i++) { - AccessibilityNodeInfo child = root.getChild(i); - for (int y = 0; y < child.getChildCount(); y++) { - AccessibilityNodeInfo child1 = child.getChild(y); - for (int j = 0; j < child1.getChildCount(); j++) { - AccessibilityNodeInfo child2 = child1.getChild(j); - Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription()); - for (int x = 0; x < child2.getChildCount(); x++) { - AccessibilityNodeInfo child3 = child2.getChild(x); - Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child1.getContentDescription()); - switch (type) { - case "1"://礼物 - if ("android.widget.TextView".equals(child3.getClassName())) { - if (child3.getText() != null) { - if (child3.getText().toString().equals("礼物")) { - AblService.getInstance().clickcommontwo(child3, ""); - } - } - } - break; - case "2"://表情 - if ("android.widget.TextView".equals(child3.getClassName())) { - if (child3.getText().toString().equals("表情")) { - AblService.getInstance().clickcommontwo(child3, ""); - } - } - break; - case "3"://粉丝团 - if ("android.widget.TextView".equals(child3.getClassName())) { - if (child3.getText().toString().equals("粉丝团")) { - AblService.getInstance().clickcommontwo(child3, ""); - } - } - break; - case "4"://等级 - if ("android.widget.TextView".equals(child3.getClassName())) { - if (child3.getText().toString().equals("等级")) { - AblService.getInstance().clickcommontwo(child3, ""); - } - } - case "5"://背包 - if ("android.widget.TextView".equals(child3.getClassName())) { - if (child3.getText().toString().equals("背包")) { - AblService.getInstance().clickcommontwo(child3, ""); - } - } - break; - default: - } - } - } - } - } - } - /** * 获得背包中第一排位置的了礼物 */ - private void geliwu(String text) { + private int geliwu(String text) { + int doubiNum = 0; ArrayList liwuBeans = new ArrayList<>(); ArrayList oneInfos = new ArrayList<>(); ArrayList twoInfos = new ArrayList<>(); @@ -144,12 +80,12 @@ public class TestAblStep0 extends BaseAblStep { // nodeZuobiao(child2); for (int x = 0; x < child2.getChildCount(); x++) { AccessibilityNodeInfo child3 = child2.getChild(x); -// Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); -// nodeZuobiao(child3); + Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); + nodeZuobiao(child3); Rect rect = new Rect(); child3.getBoundsInScreen(rect); - if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 40 && rect.right <= 248) { + if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 37 && rect.right <= 248) { Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); nodeZuobiao(child3); @@ -188,6 +124,13 @@ public class TestAblStep0 extends BaseAblStep { Gson gson = new Gson(); String s1 = gson.toJson(liwuBeans); Log.e("礼物的字符串", s1);//[{"login_status":"1","short_id":"xiao629972576","short_name":""}] + for(int j=0;j liwuBeans, ArrayList oneInfos) { @@ -214,9 +157,13 @@ public class TestAblStep0 extends BaseAblStep { Log.e("TIAOSHI###", "----礼物个数=:" + substring); } liwuBean.setLiwuNum(liwusubstring+""); + String liwuDanjia = liwuBean.getLiwuDanjia(); + int danjia = Integer.valueOf(liwuDanjia); + liwuBean.setLiwuDoubi(liwusubstring*danjia+""); liwuBeans.add(liwuBean); } } + } diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep31.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep31.java index 05075d9..bd2ed32 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep31.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep31.java @@ -57,6 +57,7 @@ public class TestAblStep31 extends HongbaoBase { AblViewUtil.mySleep(3); allowed(); AblViewUtil.mySleep(5); + Log.e("TIAOSHI###", "是否抢红包"+ProfileSpUtils.getInstance().getLiveSuiJiBean().getSwitchfive()+""); if (ProfileSpUtils.getInstance().getLiveSuiJiBean().getSwitchfive()) { AblService.getInstance().clickPoint(90, 163, 300); AblViewUtil.mySleep(3); @@ -77,7 +78,7 @@ public class TestAblStep31 extends HongbaoBase { if (ifControlView()) { AblViewUtil.mySleep(2); kongjiandingweitwo(); - if (!ProfileSpUtils.getInstance().getLiveSuiJiBean().getSwitchfive()) { + if (ProfileSpUtils.getInstance().getLiveSuiJiBean().getSwitchfive()) { boolean shifouyoufudai = shifouyoufudai(); Log.e("TIAOSHI###", "是否有福袋控件" + shifouyoufudai); if (!shifouyoufudai) { @@ -646,7 +647,7 @@ public class TestAblStep31 extends HongbaoBase { public void run() throws Exception { //关闭结果弹框 - AblService.getInstance().clickPoint(100, 100, 300); + AblService.getInstance().clickPoint(100, 100, 200); // closedjieguo(); //继续抢福袋 AblStepHandler.sendMsg(AblSteps.STEP_222); diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java index 8021455..10aec36 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep34.java @@ -771,7 +771,7 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red Log.e("TIAOSHI###", "slidingDir==" + slidingDir); } Log.e("TIAOSHI###", "滑——滑动后直播间的位置" + livePosition); - AblViewUtil.mySleep(3); + AblViewUtil.mySleep(1); tagControlView("", livePosition); AblStepHandler.sendMsg(AblSteps.STEP_254); @@ -1030,7 +1030,7 @@ public class TestAblStep34 extends HongbaoBase implements RedEnv.RedEnvFunc, Red Rect rect = new Rect(); child3.getBoundsInScreen(rect); - if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 40 && rect.right <= 248) { + if (rect.top >= 1438 && rect.bottom <= 1698 && rect.left >= 37 && rect.right <= 248) { Log.e("TIAOSHI###", "----fourNode:" + child3.getClassName() + ":" + child3.getText() + ":" + child3.getContentDescription()); nodeZuobiao(child3);