use of com.rideread.rideread.data.been.MsgInfo in project ride-read-android by Ride-Read.
the class MsgUtils method addMsgInfo.
public static void addMsgInfo(UserBaseInfo user, String msg, long time) {
JSONObject msgUserJson = getMsgUserObj();
if (null == msgUserJson)
msgUserJson = new JSONObject();
MsgInfo msginfo = new MsgInfo(user, msg, time);
String key = Integer.toString(user.getUid());
if (msgUserJson.containsKey(key))
msgUserJson.remove(key);
msgUserJson.put(key, msginfo);
saveMsgUserList(msgUserJson);
}
use of com.rideread.rideread.data.been.MsgInfo in project ride-read-android by Ride-Read.
the class MsgUserAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder tHolder, int position) {
MsgUserHolder holder = (MsgUserHolder) tHolder;
MsgInfo info = mList.get(position);
ImgLoader.getInstance().displayImage(info.getFaceUrl(), holder.mImgAvatar);
holder.mTvName.setText(info.getUsername());
holder.mTvTime.setText(TimeUtils.getFriendlyTimeSpanByNow(info.getTime()));
holder.mTvContent.setText(info.getMsg());
holder.mClMsgUserView.setOnClickListener(v -> {
Bundle bundle = new Bundle();
bundle.putSerializable(ChatSingleActivity.CHAT_USER, info);
mActivity.gotoActivity(ChatSingleActivity.class, bundle);
});
// holder.setIsRecyclable(false);
}
Aggregations