Examples of QQCategory


Examples of iqq.im.bean.QQCategory

      JSONArray jsonMarknames = results.getJSONArray("marknames");
      // vip_level/u/is_vip
      JSONArray jsonVipinfo = results.getJSONArray("vipinfo");

      // 默认好友列表
      QQCategory c = new QQCategory();
      c.setIndex(0);
      c.setName("我的好友");
      c.setSort(0);
      store.addCategory(c);
      // 初始化好友列表
      for (int i = 0; i < jsonCategories.length(); i++) {
        JSONObject jsonCategory = jsonCategories.getJSONObject(i);
        QQCategory qqc = new QQCategory();
        qqc.setIndex(jsonCategory.getInt("index"));
        qqc.setName(jsonCategory.getString("name"));
        qqc.setSort(jsonCategory.getInt("sort"));
        store.addCategory(qqc);
      }
      // 处理好友基本信息列表 flag/uin/categories
      for (int i = 0; i < jsonFriends.length(); i++) {
        QQBuddy buddy = new QQBuddy();
        JSONObject jsonFriend = jsonFriends.getJSONObject(i);
        long uin = jsonFriend.getLong("uin");
        buddy.setUin(uin);
        buddy.setStatus(QQStatus.OFFLINE);
        buddy.setClientType(QQClientType.UNKNOWN);
        // 添加到列表中
        int category = jsonFriend.getInt("categories");
        QQCategory qqCategory = store.getCategoryByIndex(category);
        buddy.setCategory(qqCategory);
        qqCategory.getBuddyList().add(buddy);

        // 记录引用
        store.addBuddy(buddy);
      }
      // face/flag/nick/uin
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.