diff --git a/app/src/main/java/com/fisherbone/fuzhu/LiveActivity.java b/app/src/main/java/com/fisherbone/fuzhu/LiveActivity.java index ca81ab1..2f09264 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/LiveActivity.java +++ b/app/src/main/java/com/fisherbone/fuzhu/LiveActivity.java @@ -7,6 +7,8 @@ import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; +import com.fisherbone.fuzhu.abllib.AblStepHandler; +import com.fisherbone.fuzhu.abllib.AblSteps; import com.fisherbone.fuzhu.abllib.utils.AblUtil; import com.fisherbone.fuzhu.databinding.ActivityLiveBinding; import com.fisherbone.fuzhu.entity.FourEvent; @@ -49,6 +51,11 @@ public class LiveActivity extends BaseActivity{ @Override public void onClick(View view) { ProfileSpUtils.getInstance().saveLiveBean(liveBean1); +// AblStepHandler.getInstance().setStop(false); +// AblStepHandler.sendMsg(AblSteps.STEP_1); + + + if("0".equals(ChangLiang.phonetype)) { EventBus.getDefault().post(new FourEvent("success", "6")); }else if("3".equals(ChangLiang.phonetype)) { diff --git a/app/src/main/java/com/fisherbone/fuzhu/fragment/LiwuFragment.java b/app/src/main/java/com/fisherbone/fuzhu/fragment/LiwuFragment.java index 124608d..fc1c067 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/fragment/LiwuFragment.java +++ b/app/src/main/java/com/fisherbone/fuzhu/fragment/LiwuFragment.java @@ -38,7 +38,6 @@ public class LiwuFragment extends Fragment { Bundle bundle = getArguments(); //这里就拿到了之前传递的参数 //visitor_id = bundle.getString("visitor_id"); - FoldLayout foldlayout = (FoldLayout) view.findViewById(R.id.foldlayout); // foldlayout.setOnItemClickListener(); List views1 = new ArrayList<>(); @@ -46,35 +45,20 @@ public class LiwuFragment extends Fragment { ItemLiwusetBinding binding= DataBindingUtil.inflate(inflater, R.layout.item_liwuset, container, false); binding.setLivebean(liveBean1); views1.add(binding.getRoot()); - // foldlayout.addItemView(views1); foldlayout.addItemView(views1); - - // rl_liwu = (RelativeLayout) view.findViewById(R.id.rl_liwu); switch1 = (Switch) view.findViewById(R.id.switch1); -// if (randomlikes.equals("0")) { -// binding.switch1.setChecked(false); -// } else { -// binding.switch1.setChecked(true); -// } switch1.setSwitchTextAppearance(getActivity(), 0); switch1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { //控制开关字体颜色 if (b) { - // Toast.makeText(getActivity(), "开", Toast.LENGTH_SHORT).show(); - // recFollowBean.setRandomlikes("1"); foldlayout.isopen(); } else { - // Toast.makeText(getActivity(), "关", Toast.LENGTH_SHORT).show(); - // recFollowBean.setRandomlikes("0"); foldlayout.isclosed(); } - } }); - return view; } - } 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 2919b6d..a5da137 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep0.java @@ -1,10 +1,13 @@ package com.fisherbone.fuzhu.step; import android.graphics.Rect; +import android.os.Build; import android.os.Message; import android.util.Log; import android.view.accessibility.AccessibilityNodeInfo; +import androidx.annotation.RequiresApi; + import com.fisherbone.fuzhu.ChangLiang; import com.fisherbone.fuzhu.abllib.AblService; import com.fisherbone.fuzhu.abllib.AblStepHandler; @@ -12,7 +15,9 @@ import com.fisherbone.fuzhu.abllib.AblSteps; import com.fisherbone.fuzhu.abllib.BaseAblStep; import com.fisherbone.fuzhu.abllib.utils.AblViewUtil; import com.fisherbone.fuzhu.db.DouyinBean; +import com.fisherbone.fuzhu.entity.LiveBean; import com.fisherbone.fuzhu.utils.EmojiFilter; +import com.fisherbone.fuzhu.utils.ProfileSpUtils; import java.util.ArrayList; import java.util.List; @@ -34,63 +39,273 @@ public class TestAblStep0 extends BaseAblStep { break; case AblSteps.STEP_2: AblViewUtil.mySleep(5); - // getNodeInfoh(); - // AblStepHandler.sendMsg(AblSteps.STEP_50); +// getNodeInfoh(); +// LiveBean liveBean1 = ProfileSpUtils.getInstance().getLiveBean(); +// String liwunum = liveBean1.getLiwucishu(); +// int fastnum = Integer.valueOf(liwunum); +// faliwu("大啤酒",2,fastnum); - getdouyinid(); + + getdoubsi(); default: } } - private void getdouyinid() { - - AblViewUtil.mySleep(2); - //获取抖音号 - getdouyin(); - - - DouyinBean douyinBean = new DouyinBean(); - douyinBean.setLogin_status("1"); - douyinBean.setShort_id(ChangLiang.short_id); - douyinBean.setShort_name(ChangLiang.short_name); - - AblViewUtil.mySleep(2); - AblViewUtil.back(); - AblViewUtil.mySleep(1); - } - - private void getdouyin() { - int num = 0; - List accessibilityNodeInfos = new ArrayList<>(); + private int getdoubsi() { + int doubinum = 0; AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); for (int i = 0; i < root.getChildCount(); i++) { AccessibilityNodeInfo child = root.getChild(i); - Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); - nodeZuobiao(child); - Rect rect = new Rect(); - child.getBoundsInScreen(rect); - if (rect.top >= 564 && rect.bottom <= 761) { - if ("android.widget.TextView".equals(child.getClassName())) { - if (num < 3) { - accessibilityNodeInfos.add(child); - num = num + 1; + // Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); + for (int y = 0; y < child.getChildCount(); y++) { + AccessibilityNodeInfo child1 = child.getChild(y); + // Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); + for (int j = 0; j < child1.getChildCount(); j++) { + AccessibilityNodeInfo child2 = child1.getChild(j); + Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription()); + Rect rect = new Rect(); + child2.getBoundsInScreen(rect); + if (rect.top >= 2092 && rect.bottom <= 2151) { + if ("android.widget.TextView".equals(child2.getClassName())) { + //(928,2092),(981,2151) + if (child2.getText() != null) { + String doubi = child2.getText().toString(); + Log.e("TIAOSHI###", "----抖币数:" + doubi); + doubinum = Integer.valueOf(doubi); + + } + } } } } } - AccessibilityNodeInfo accessibilityNodeInfoo = accessibilityNodeInfos.get(1); - String str = accessibilityNodeInfoo.getText().toString(); - String[] all = str.split(":"); - // Log.e("TIAOSHI###", "获得的抖音号==" + all[0]); - Log.e("TIAOSHI###", "获得的抖音号==" + all[1]); - ChangLiang.short_id = all[1]; - - AccessibilityNodeInfo accessibilityNodeInfo = accessibilityNodeInfos.get(0); - String s = accessibilityNodeInfo.getText().toString(); - String s1 = EmojiFilter.filterEmoji(s);//去除字符串中包含的表情符号 - Log.e("TIAOSHI###", "获得的抖音号昵称==" + s1); - ChangLiang.short_name = s1; + return doubinum; } + + /** + * 发送礼物 + * @param str 礼物名称 + * @param danjia 单价 + * @param fastnum 发送个数 + */ + private void faliwu(String str,int danjia,int fastnum) { + AblViewUtil.mySleep(2); + int getdoubi = getdoubi(); + + int fastdoubi = fastnum * danjia; + if (getdoubi >= fastdoubi) { + } else { + fastdoubi = getdoubi; + } + //点开礼物 + clickmoreli(); + AblViewUtil.mySleep(1); + //点击背包 + clickmenu("5"); + AblViewUtil.mySleep(1); + //点击礼物 + clickmenu("1"); + AblViewUtil.mySleep(1); + AccessibilityNodeInfo hognbaonode = geliwu(str).get(0); + double num = fastdoubi / danjia; + int intnum = new Double(num).intValue(); + if (intnum > 0) { + for (int i = 0; i <= intnum; i++) { + AblViewUtil.mySleep(1); + clickcommonthree(hognbaonode, ""); + Log.e("TIAOSHI###", "发礼物的循环次数"+i); + String liwutime = ProfileSpUtils.getInstance().getLiveBean().getLiwutime(); + int jiangetime = Integer.valueOf(liwutime); + AblViewUtil.mySleep(jiangetime); + } + } else { + Log.e("TIAOSHI###", "发礼物的抖币不够了"); + } + } + /** + * 获得抖币 + * + * @return + */ + private int getdoubi() { + int doubinum = 0; + AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); + for (int i = 0; i < root.getChildCount(); i++) { + AccessibilityNodeInfo child = root.getChild(i); + // Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); + for (int y = 0; y < child.getChildCount(); y++) { + AccessibilityNodeInfo child1 = child.getChild(y); + // Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); + for (int j = 0; j < child1.getChildCount(); j++) { + AccessibilityNodeInfo child2 = child1.getChild(j); + Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription()); + if ("android.widget.TextView".equals(child2.getClassName())) { + if (child2.getText() != null) { + String doubi = child2.getText().toString(); + Log.e("TIAOSHI###", "----抖币数:" + doubi); + doubinum = Integer.valueOf(doubi); + + } + } + } + } + } + return doubinum; + } + + /** + * 点击直播间下方的更多按钮(备注:通过搜索点击直播进去的可用) + * 1.说点什么 + * 2.更多 + * 3.礼物 + */ + public void clickmoreli() { + AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); + for (int i = 0; i < root.getChildCount(); i++) { + AccessibilityNodeInfo child = root.getChild(i); + // Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); + for (int y = 0; y < child.getChildCount(); y++) { + AccessibilityNodeInfo child1 = child.getChild(y); + Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); + nodeZuobiao(child1); + if ("android.widget.RelativeLayout".equals(child1.getClassName())) { + if (child1.getContentDescription() != null) { + if (child1.getContentDescription().equals("礼物")) { + AblService.getInstance().clickcommontwo(child1, ""); + } + } + } + } + } + } + + private ArrayList getrecyy() { + ArrayList objects = new ArrayList<>(); + AccessibilityNodeInfo root = AblService.getInstance().getRootInActiveWindow(); + for (int i = 0; i < root.getChildCount(); i++) { + AccessibilityNodeInfo child = root.getChild(i); + Log.e("TIAOSHI###", "----oneNode:" + child.getClassName() + ":" + child.getText() + ":" + child.getContentDescription()); + for (int y = 0; y < child.getChildCount(); y++) { + AccessibilityNodeInfo child1 = child.getChild(y); + Log.e("TIAOSHI###", "----twoNode:" + child1.getClassName() + ":" + child1.getText() + ":" + child1.getContentDescription()); + if ("androidx.recyclerview.widget.RecyclerView".equals(child1.getClassName())) { + objects.add(child1); + } + } + } + return objects; + } + + /** + * 获得背包中第一个位置的了礼物 + */ + private List geliwu(String text) { + List liwus = new ArrayList<>(); + 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()); + if (child3.getText() != null) { + if (text.equals(child3.getText().toString())) { + liwus.add(child2); + } + + } + } + } + } + } + return liwus; + } + + @RequiresApi(api = Build.VERSION_CODES.N) + public void clickcommonthree(AccessibilityNodeInfo accessibilityNodeInfo, String s) { + if (accessibilityNodeInfo != null) { + Rect rect = new Rect(); + accessibilityNodeInfo.getBoundsInScreen(rect); + AblService.getInstance().clickPoint((rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2, 300); + Log.e("TIAOSHI###", "点击" + s + "按钮"); + Log.e("TIAOSHI###", "点击" + s + "按钮" + "(" + (rect.left + rect.right) / 2 + "," + (rect.top + rect.bottom) / 2 + ")"); + } else { + Log.e("TIAOSHI###", "没有找到" + s + "按钮"); + } + } + + + /** + * 点击礼物下面的菜单 + * 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: + } + } + } + } + } + } + + } diff --git a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep30.java b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep30.java index fb5dbfe..97030b2 100644 --- a/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep30.java +++ b/app/src/main/java/com/fisherbone/fuzhu/step/TestAblStep30.java @@ -161,19 +161,6 @@ public class TestAblStep30 extends NoticeBase { } clickcommonthree(nodeinfo, ""); AblViewUtil.mySleep(1); - //获得刷礼物的次数 -// LiveBean livebean = ProfileSpUtils.getInstance().getLiveBean(); -// String liwucishu = livebean.getLiwucishu(); -// int liwunum = Integer.valueOf(liwucishu); -// if (liwusubstring >= liwunum) { -// } else { -// liwunum = liwusubstring; -// } -// for (int i = 0; i < liwunum; i++) { -// AblViewUtil.mySleep(1); -// clickcommonthree(nodeinfo, ""); -// AblViewUtil.mySleep(4); -// } for (int i = 0; i < liwusubstring; i++) { AblViewUtil.mySleep(1); clickcommonthree(nodeinfo, ""); @@ -186,51 +173,66 @@ public class TestAblStep30 extends NoticeBase { AblViewUtil.back(); } } - // AblStepHandler.sendMsg(AblSteps.STEP_217); - int randumInt10 = RandumInt.getRandumInt10(); AblViewUtil.mySleep(randumInt10); - AblStepHandler.sendMsg(AblSteps.STEP_214); + AblStepHandler.sendMsg(AblSteps.STEP_217); break; case AblSteps.STEP_217: - //直播间刷红包 - AblViewUtil.mySleep(2); - //点击发红包 - int getdoubi = getdoubi(); - //获得刷礼物的次数 - LiveBean liveBean1 = ProfileSpUtils.getInstance().getLiveBean(); - String hongbaonum = liveBean1.getHongbaonum(); - int fastnum = Integer.valueOf(hongbaonum); - int fastdoubi = fastnum * 20; - if (getdoubi >= fastdoubi) { - } else { - fastdoubi = getdoubi; + if(!liveBean.getSwitchfive()) { + AblViewUtil.mySleep(1); + //点开礼物 + clickmoreli(); + AblViewUtil.mySleep(2); + LiveBean liveBean1 = ProfileSpUtils.getInstance().getLiveBean(); + String liwunum = liveBean1.getLiwucishu(); + int fastnum = Integer.valueOf(liwunum); + faliwu("大啤酒", 2, fastnum); + AblViewUtil.back(); } - double num = fastdoubi / 20; - int intnum = new Double(num).intValue(); - if (intnum > 0) { - for (int i = 0; i < intnum; i++) { - AblViewUtil.mySleep(1); - //点开礼物 - clickmoreli(); - //触发容器元素的滚动事件 - ArrayList getrecyy = getrecyy(); - getrecyy.get(0).performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD); - AblViewUtil.mySleep(3); - List geliwwu = geliwu("红包"); - AccessibilityNodeInfo hognbaonode = geliwwu.get(0); - clickcommonthree(hognbaonode, ""); - String hongbaotime = ProfileSpUtils.getInstance().getLiveBean().getHongbaotime(); - int jiangetime = Integer.valueOf(hongbaotime); - AblViewUtil.mySleep(jiangetime); - } - } else { - Log.e("TIAOSHI###", "发红包的抖币不够了"); - } - - AblStepHandler.sendMsg(AblSteps.STEP_218); + int randumInt12 = RandumInt.getRandumInt10(); + AblViewUtil.mySleep(randumInt12); + AblStepHandler.sendMsg(AblSteps.STEP_214); break; case AblSteps.STEP_218: + +// //直播间刷红包 +// AblViewUtil.mySleep(2); +// //点击发红包 +// int getdoubi = getdoubi(); +// //获得刷礼物的次数 +// LiveBean liveBean1 = ProfileSpUtils.getInstance().getLiveBean(); +// String hongbaonum = liveBean1.getHongbaonum(); +// int fastnum = Integer.valueOf(hongbaonum); +// int fastdoubi = fastnum * 20; +// if (getdoubi >= fastdoubi) { +// } else { +// fastdoubi = getdoubi; +// } +// double num = fastdoubi / 20; +// int intnum = new Double(num).intValue(); +// if (intnum > 0) { +// for (int i = 0; i < intnum; i++) { +// AblViewUtil.mySleep(1); +// //点开礼物 +// clickmoreli(); +// //触发容器元素的滚动事件 +// ArrayList getrecyy = getrecyy(); +// getrecyy.get(0).performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD); +// AblViewUtil.mySleep(3); +// List geliwwu = geliwu("红包"); +// AccessibilityNodeInfo hognbaonode = geliwwu.get(0); +// clickcommonthree(hognbaonode, ""); +// String hongbaotime = ProfileSpUtils.getInstance().getLiveBean().getHongbaotime(); +// int jiangetime = Integer.valueOf(hongbaotime); +// AblViewUtil.mySleep(jiangetime); +// } +// } else { +// Log.e("TIAOSHI###", "发红包的抖币不够了"); +// } + + AblStepHandler.sendMsg(AblSteps.STEP_219); + break; + case AblSteps.STEP_219: //开始直播间跟单 ChangLiang.gendanopen = 1; Log.e("TIAOSHI###", "开始跟单"); @@ -240,6 +242,53 @@ public class TestAblStep30 extends NoticeBase { } } + + /** + * 发送礼物 + * @param str 礼物名称 + * @param danjia 单价 + * @param fastnum 发送个数 + */ + private void faliwu(String str,int danjia,int fastnum) { + AblViewUtil.mySleep(2); + int getdoubi = getdoubi(); + + int fastdoubi = fastnum * danjia; + if (getdoubi >= fastdoubi) { + } else { + fastdoubi = getdoubi; + } + //点开礼物 + clickmoreli(); + AblViewUtil.mySleep(1); + //点击背包 + clickmenu("5"); + AblViewUtil.mySleep(1); + //点击礼物 + clickmenu("1"); + AblViewUtil.mySleep(1); + AccessibilityNodeInfo hognbaonode = geliwu(str).get(0); + double num = fastdoubi / danjia; + int intnum = new Double(num).intValue(); + Log.e("TIAOSHI###", intnum+"次数"); + if (intnum > 0) { + for (int i = 0; i <= intnum; i++) { + AblViewUtil.mySleep(1); + clickcommonthree(hognbaonode, ""); + Log.e("TIAOSHI###", "发礼物的循环次数"+i); + String liwutime = ProfileSpUtils.getInstance().getLiveBean().getLiwutime(); + int jiangetime = Integer.valueOf(liwutime); + AblViewUtil.mySleep(jiangetime); + } + } else { + Log.e("TIAOSHI###", "发礼物的抖币不够了"); + } + } + + + /** + * 进入直播间 + */ private void moveLive(String content) { AblViewUtil.mySleep(2); String nodeName = getNodeName(); @@ -678,7 +727,6 @@ public class TestAblStep30 extends NoticeBase { AccessibilityNodeInfo child1 = child.getChild(y); for (int j = 0; j < child1.getChildCount(); j++) { AccessibilityNodeInfo child2 = child1.getChild(j); - if ("android.view.ViewGroup".equals(child2.getClassName())) { Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription()); for (int x = 0; x < child2.getChildCount(); x++) { AccessibilityNodeInfo child3 = child2.getChild(x); @@ -690,7 +738,7 @@ public class TestAblStep30 extends NoticeBase { } } } - } + } } return liwus; @@ -713,12 +761,16 @@ public class TestAblStep30 extends NoticeBase { for (int j = 0; j < child1.getChildCount(); j++) { AccessibilityNodeInfo child2 = child1.getChild(j); Log.e("TIAOSHI###", "----threeNode:" + child2.getClassName() + ":" + child2.getText() + ":" + child1.getContentDescription()); - if ("android.widget.TextView".equals(child2.getClassName())) { - if (child2.getText() != null) { - String doubi = child2.getText().toString(); - Log.e("TIAOSHI###", "----抖币数:" + doubi); - doubinum = Integer.valueOf(doubi); + Rect rect = new Rect(); + child2.getBoundsInScreen(rect); + if (rect.top >= 2092 && rect.bottom <= 2151) { + if ("android.widget.TextView".equals(child2.getClassName())) { + if (child2.getText() != null) { + String doubi = child2.getText().toString(); + Log.e("TIAOSHI###", "----抖币数:" + doubi); + doubinum = Integer.valueOf(doubi); + } } } } diff --git a/app_config.gradle b/app_config.gradle index ff89741..310d348 100644 --- a/app_config.gradle +++ b/app_config.gradle @@ -12,8 +12,8 @@ ext { applicationId : "com.fisherbone.fuzhu", minSdkVersion : 24, targetSdkVersion : 29, - versionCode : 174, - versionName : "1.7.4", + versionCode : 175, + versionName : "1.7.5", testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner" ]