新增 布局分析显示full id

This commit is contained in:
hyb1996
2018-11-11 22:06:44 +08:00
parent 76fa44960c
commit b805cefeac
2 changed files with 6 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ public class NodeInfoView extends RecyclerView {
private static final String[] FIELD_NAMES = { private static final String[] FIELD_NAMES = {
"id", "id",
"idHex", "idHex",
"fullId",
"bounds", "bounds",
"depth", "depth",
"desc", "desc",

View File

@@ -28,6 +28,7 @@ public class NodeInfo {
public String id; public String id;
public String idHex; public String idHex;
public String fullId;
public String desc; public String desc;
public String className; public String className;
public String packageName; public String packageName;
@@ -60,7 +61,8 @@ public class NodeInfo {
public NodeInfo(Resources resources, UiObject node, NodeInfo parent) { public NodeInfo(Resources resources, UiObject node, NodeInfo parent) {
id = simplifyId(node.getViewIdResourceName()); fullId = node.getViewIdResourceName();
id = simplifyId(fullId);
desc = node.desc(); desc = node.desc();
className = node.className(); className = node.className();
packageName = node.packageName(); packageName = node.packageName();
@@ -96,8 +98,8 @@ public class NodeInfo {
indexInParent = node.indexInParent(); indexInParent = node.indexInParent();
this.parent = parent; this.parent = parent;
if (resources != null && packageName != null && id != null) { if (resources != null && packageName != null && fullId != null) {
idHex = "0x" + Integer.toHexString(resources.getIdentifier(node.getViewIdResourceName(), null, null)); idHex = "0x" + Integer.toHexString(resources.getIdentifier(fullId, null, null));
} }
} }