Skip to content

Commit

Permalink
1. add printText printInfo
Browse files Browse the repository at this point in the history
2. 优化 UiSelector
  • Loading branch information
jinjintao committed Apr 28, 2024
1 parent 0bac2a8 commit 862dff2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/linsheng/FATJS/node/AccUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public void onCancelled(GestureDescription gestureDescription1) {
*/
public static boolean clickExactPoint(float x1, float y1, long duration) {
Path path = new Path();
// printLogMsg("[x => " + x1 + ", y => " + y1 + "]", 0);
printLogMsg("[x => " + x1 + ", y => " + y1 + "]", 0);
if (x1 > mWidth || y1 > mHeight || x1 < 0 || y1 < 0) {
printLogMsg("mWidth: " + mWidth, 0);
printLogMsg("mHeight: " + mHeight, 0);
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/linsheng/FATJS/node/UiObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@

import static com.linsheng.FATJS.node.AccUtils.AccessibilityHelper;
import static com.linsheng.FATJS.node.AccUtils.findAllText;
import static com.linsheng.FATJS.node.AccUtils.getBounds;
import static com.linsheng.FATJS.node.AccUtils.printLogMsg;

import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.GestureDescription;
import android.graphics.Path;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.view.accessibility.AccessibilityNodeInfo;

import androidx.annotation.RequiresApi;

import com.linsheng.FATJS.config.GlobalVariableHolder;
import com.linsheng.FATJS.utils.StringUtils;

import java.sql.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
Expand Down Expand Up @@ -671,7 +668,12 @@ public void printInfo() {
if (StringUtils.isNotEmpty(desc))
builder.append("desc: ").append(desc).append("\n");

builder.append("class: ").append(node.getClassName());
builder.append("class: ").append(node.getClassName()).append("\n");

Rect bounds = getBounds(node);
String rectString = "[" + bounds.left + "," + bounds.top + "]" + "[" + bounds.right + "," + bounds.bottom + "]";
builder.append("bounds: ").append(rectString);

printLogMsg(builder.toString());
}

Expand Down

0 comments on commit 862dff2

Please sign in to comment.