SH02 发布的最佳帖子
function oncedone(widget,level){
indent = new Array(level).join(' ');
for(var i = 0; i < widget.childCount(); i++){
child = widget.child(i);
log(indent + child.className() + ', ' + child.id() + ' ' + child.depth() + ', ' + child.indexInParent() + ', ' + child.getText());
if (child.childCount() > 0) oncedone(child,level+1);
}
}
oncedone(className("android.widget.FrameLayout").findOnce(),0);
function oncedone(widget){
for(var i = 0; i < widget.childCount(); i++){
child = widget.child(i);
level = child.depth();
indent = new Array(level).join(' ');
log(indent + child.className() + ', ' + child.id() + ' ' + level + ', ' + child.indexInParent() + ', ' + child.getText());
if (child.childCount() > 0) oncedone(child);
}
}
oncedone(className("android.widget.FrameLayout").findOnce());