当前位置: 移动技术网 > IT编程>移动开发>Android > 分享Android微信红包插件

分享Android微信红包插件

2019年07月24日  | 移动技术网IT编程  | 我要评论

马靴美女,两天一夜100214,realflow

本文实例为大家分享了android微信红包插件,供大家参考,具体内容如下

效果图:

具体代码

@targetapi(build.version_codes.jelly_bean)
 private void handlewindowchange(accessibilitynodeinfo nodeinfo) {
  switch (stage.getinstance().getcurrentstage()) {
   case stage.opening_stage:
    // 调试信息,打印ttl
    // log.d("ttl", string.valueof(ttl));
 
    /* 如果打开红包失败且还没到达最大尝试次数,重试 */
    if (openhongbao(nodeinfo) == -1 && ttl < max_ttl) return;
 
    ttl = 0;
    stage.getinstance().entering(stage.fetched_stage);
    performmyglobalaction(global_action_back);
    if (nodestofetch.size() == 0) handlewindowchange(nodeinfo);
    break;
   case stage.opened_stage:
    listsuccessnodes = nodeinfo.findaccessibilitynodeinfosbytext("红包详情");
    if (successnodes.isempty() && ttl < max_ttl) {
     ttl += 1;
     return;
    }
    ttl = 0;
    stage.getinstance().entering(stage.fetched_stage);
    performmyglobalaction(global_action_back);
    break;
   case stage.fetched_stage:
    /* 先消灭待抢红包队列中的红包 */
    if (nodestofetch.size() > 0) {
     /* 从最下面的红包开始戳 */
     accessibilitynodeinfo node = nodestofetch.remove(nodestofetch.size() - 1);
     if (node.getparent() != null) {
      string id = gethongbaohash(node);
 
      if (id == null) return;
 
      fetchedidentifiers.add(id);
 
      // 调试信息,在每次打开红包后打印出已经获取的红包
      // log.d("fetched", arrays.tostring(fetchedidentifiers.toarray()));
 
      stage.getinstance().entering(stage.opening_stage);
      node.getparent().performaction(accessibilitynodeinfo.action_click);
     }
     return;
    }
 
    stage.getinstance().entering(stage.fetching_stage);
    fetchhongbao(nodeinfo);
    stage.getinstance().entering(stage.fetched_stage);
    break;
  }
 }

插件下载:

本文已被整理到了《android微信开发教程汇总》,欢迎大家学习阅读。

希望本文所述对大家实现微信红包功能有所帮助,帮助大家更好的学习android软件编程。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网