示例#1
0
 /** 设定聊天名称 1. 如果是user类型, 点击触发UserProfile 2. 如果是群组,检测自己是不是还在群中 */
 private void setTitleByUser() {
   setTitle(peerEntity.getMainName());
   int peerType = peerEntity.getType();
   switch (peerType) {
     case DBConstant.SESSION_TYPE_GROUP:
       {
         GroupEntity group = (GroupEntity) peerEntity;
         Set<Integer> memberLists = group.getlistGroupMemberIds();
         if (!memberLists.contains(loginUser.getPeerId())) {
           Toast.makeText(MessageActivity.this, R.string.no_group_member, Toast.LENGTH_SHORT)
               .show();
         }
       }
       break;
     case DBConstant.SESSION_TYPE_SINGLE:
       {
         topTitleTxt.setOnClickListener(
             new View.OnClickListener() {
               @Override
               public void onClick(View v) {
                 IMUIHelper.openUserProfileActivity(MessageActivity.this, peerEntity.getPeerId());
               }
             });
       }
       break;
   }
 }
示例#2
0
  public static boolean handleGroupSearch(String key, GroupEntity group) {
    if (TextUtils.isEmpty(key) || group == null) {
      return false;
    }
    group.getSearchElement().reset();

    return handleTokenFirstCharsSearch(key, group.getPinyinElement(), group.getSearchElement())
        || handleTokenPinyinFullSearch(key, group.getPinyinElement(), group.getSearchElement())
        || handleNameSearch(group.getMainName(), key, group.getSearchElement());
  }