use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class FinalUserDataBase method getFriendsRecomment.
/**
* For reference information
*
* @return
*/
public List<FriendRecommentVo> getFriendsRecomment() {
List<FriendRecommentVo> mList = new ArrayList<FriendRecommentVo>();
if (null == db) {
return mList;
}
String sql = "select * from " + TableField.TABLE_FRIENDS_RECOMMENT + " order by " + TableField._ID + " desc ";
Cursor cursor = db.rawQuery(sql, null);
FriendRecommentVo msg;
while (cursor.moveToNext()) {
msg = new FriendRecommentVo();
msg.setMsgId(cursor.getString(cursor.getColumnIndex(TableField._MSGID)));
msg.setFriendId(cursor.getString(cursor.getColumnIndex(TableField.FIELD_CHAT_THIRDID)));
msg.setUid(cursor.getString(cursor.getColumnIndex(TableField.FIELD_FRIEND_UID)));
msg.setUsername(cursor.getString(cursor.getColumnIndex(TableField.FIELD_FRIEND_UNAME)));
msg.setPic(cursor.getString(cursor.getColumnIndex(TableField.FIELD_FRIEND_PIC)));
msg.setThumb(cursor.getString(cursor.getColumnIndex(TableField.FIELD_FRIEND_THUMB)));
msg.setType(cursor.getInt(cursor.getColumnIndex(TableField.FIELD_CHAT_TYPE)));
msg.setTime(cursor.getLong(cursor.getColumnIndex(TableField.FIELD_CHAT_MSGTIME)));
msg.setUnread(cursor.getInt(cursor.getColumnIndex(TableField.FIELD_CHAT_UNREAD)));
msg.setThirdName(cursor.getString(cursor.getColumnIndex(TableField.FIELD_CHAT_THIRDNAME)));
UserBaseVo baseVo = FinalUserDataBase.getInstance().getUserBaseVoByUid(msg.getUid());
if (baseVo == null) {
// 不是好友
msg.setAgree(false);
} else {
msg.setAgree(true);
}
try {
if (!TextUtils.isEmpty(msg.getThirdName())) {
if (msg.getThirdName().endsWith(")") && msg.getThirdName().contains("(")) {
msg.setThirdName(msg.getThirdName().substring(0, msg.getThirdName().lastIndexOf("(")));
}
}
} catch (Exception e) {
e.printStackTrace();
}
mList.add(msg);
}
cursor.close();
return mList;
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class MainFoundFragmentUI method onItemClick.
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
WifiPeopleVO wifiPeopleVO = mDatas.get(position);
UserBaseVo info = new UserBaseVo();
info.setLocalId(wifiPeopleVO.getLocalId());
info.setMid(wifiPeopleVO.getMid());
info.setUsername(wifiPeopleVO.getUserName());
info.setNote(wifiPeopleVO.getNote());
info.setThumb(wifiPeopleVO.getThumb());
info.setGender(wifiPeopleVO.getGender());
info.setSightml(wifiPeopleVO.getSightml());
info.setAge(wifiPeopleVO.getAge());
info.setFriendLog(wifiPeopleVO.getFriendLog());
info.setOffLineFound(true);
Utils.intentFriendUserInfo(getActivity(), info, false);
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class MainMessageFragmentUI method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0 && resultCode == Activity.RESULT_OK) {
// 选择联系人返回
ArrayList<UserBaseVo> selectList = (ArrayList<UserBaseVo>) data.getSerializableExtra("selectList");
if (selectList != null && selectList.size() == 1) {
UserBaseVo vo = selectList.get(0);
Utils.intentChattingUI(getActivity(), vo.getLocalId(), vo.getThumb(), vo.getShowName(), vo.getGender(), vo.getFriendLog(), false, false, false, 0, false);
} else if (selectList != null && selectList.size() > 1) {
StringBuilder touids = new StringBuilder();
for (UserBaseVo vo : selectList) {
touids.append(vo.getLocalId()).append(",");
}
touids.deleteCharAt(touids.lastIndexOf(","));
createDiscussionGroups(touids.toString(), selectList);
}
}
}
Aggregations