@Override public void bindData(Object o) { super.bindData(o); AVIMMessage message = (AVIMMessage) o; if (message instanceof AVIMLocationMessage) { final AVIMLocationMessage locMsg = (AVIMLocationMessage) message; contentView.setText(locMsg.getText()); } }
@Override public void initView() { super.initView(); conventLayout.addView(View.inflate(getContext(), R.layout.lcim_chat_item_location, null)); contentView = (TextView) itemView.findViewById(R.id.locationView); conventLayout.setBackgroundResource( isLeft ? R.drawable.lcim_chat_item_left_bg : R.drawable.lcim_chat_item_right_bg); contentView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { LCIMLocationItemClickEvent event = new LCIMLocationItemClickEvent(); event.message = message; EventBus.getDefault().post(event); } }); }