We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
//找出动态列表 var list = id("recycler_view").findOne(); //遍历动态 list.children().forEach(function(child){ //找出点赞图标 var like = child.findOne(id("feed_action_view_like")); //找出点赞数量 var likeCount = child.findOne(id("text_view")); //如果这两个控件没有找到就不继续了 if(like == null || likeCount == null){ return; } //判断点赞数量是否小于10 if(parseInt(likeCount.text()) < 10){ //点赞 like.click(); } }); 例子
The text was updated successfully, but these errors were encountered:
// 案例1: UiCollection collection = text("xxx").find(); // 查找全部 text = "xxx"的节点 // 对查找到的集合进行条件过滤,根据item 继续往下按条件查找 id = "ttt" UiObject uiObject = collection.filterOne(item -> id("ttt").findOne(item).exists());
// 案例2: UiObject uiObj1 = text("xxx").findOne(); UiObject uiObj2 = id("ttt").findOne(uiObj1.node); // 将上一个 node 作为参数传入 findOne(node) 即可
Sorry, something went wrong.
No branches or pull requests
//找出动态列表
var list = id("recycler_view").findOne();
//遍历动态
list.children().forEach(function(child){
//找出点赞图标
var like = child.findOne(id("feed_action_view_like"));
//找出点赞数量
var likeCount = child.findOne(id("text_view"));
//如果这两个控件没有找到就不继续了
if(like == null || likeCount == null){
return;
}
//判断点赞数量是否小于10
if(parseInt(likeCount.text()) < 10){
//点赞
like.click();
}
});
例子
The text was updated successfully, but these errors were encountered: