@Override public void bindViewHolder(final ViewHolder holder, int position) { IMMsg imMsg = ((ChatEnumMapAdater) getDataBindAdapter()).get(position); initPlayBtn(imMsg, holder.idPlayButton); Map<String, Object> map = imMsg.getAttrs(); if (map != null && map.get(MessageAgent.MAPKEY) != null) UserService.findUserInConversationAllInfo( (String) map.get(MessageAgent.MAPKEY), new FindCallback<AVObject>() { @Override public void done(List<AVObject> list, AVException e) { if (list != null && list.size() > 0) { Glide.with(ChatFragment.instance) .load(list.get(0).getAVFile(User.AVATAR).getUrl()) // .tag(getDataBindAdapter().context) .into(holder.idChatTextIvBg); holder.idChatTextTvName.setText(list.get(0).getString(User.NICKNAME)); } } }); /* try { UserService.findUserUrl(msg.getFrom(), new FindCallback<AVObject>() { @Override public void done(List<AVObject> list, AVException e) { if (list != null && list.size() > 0) { Picasso.with(getDataBindAdapter().context) .load(list.get(0).getAVFile(User.AVATAR).getUrl()) .tag(getDataBindAdapter().context) .into(holder.idChatTextIvBg); holder.idChatTextTvName.setText(list.get(0).getString(User.NICKNAME)); } } }); } catch (AVException e) { e.printStackTrace(); return; }*/ }
@Override public void bindViewHolder(final ViewHolder holder, int position) { ChatEnumMapAdater chatEnumMapAdater = (ChatEnumMapAdater) getDataBindAdapter(); holder.idChatTextTvName.setText(chatEnumMapAdater.nickNameForMe); Glide.with(ChatFragment.instance) .load(chatEnumMapAdater.faceUrlForMe) // .tag(getDataBindAdapter().context) .into(holder.idChatTextIvBg); IMMsg imMsg = chatEnumMapAdater.get(position); Glide.with(getDataBindAdapter().context) .load(imMsg.getUrl()) // .tag(getDataBindAdapter().context) .override(400, 400) .into(holder.mImageView); /*try { UserService.findUserUrl(msg.getFrom(), new FindCallback<AVObject>() { @Override public void done(List<AVObject> list, AVException e) { if (list != null && list.size() > 0) { Picasso.with(getDataBindAdapter().context) .load(list.get(0).getAVFile(User.AVATAR).getUrl()) .tag(getDataBindAdapter().context) .into(holder.idChatTextIvBg); holder.idChatTextTvName.setText(list.get(0).getString(User.NICKNAME)); } } }); } catch (AVException e) { e.printStackTrace(); return; }*/ }