Search in sources :

Example 1 with MsgInfo

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);
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) MsgInfo(com.rideread.rideread.data.been.MsgInfo)

Example 2 with MsgInfo

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);
}
Also used : MsgInfo(com.rideread.rideread.data.been.MsgInfo) Bundle(android.os.Bundle)

Aggregations

MsgInfo (com.rideread.rideread.data.been.MsgInfo)2 Bundle (android.os.Bundle)1 JSONObject (com.alibaba.fastjson.JSONObject)1