use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.
the class QqActivity method initListView.
private void initListView() {
chattingListAdapter = new QqChattingListAdapter(this);
List<ImMsgBean> beanList = new ArrayList<>();
for (int i = 0; i < 20; i++) {
ImMsgBean bean = new ImMsgBean();
bean.setContent("Test:" + i);
beanList.add(bean);
}
chattingListAdapter.addData(beanList);
lvChat.setAdapter(chattingListAdapter);
lvChat.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
switch(scrollState) {
case SCROLL_STATE_FLING:
break;
case SCROLL_STATE_IDLE:
break;
case SCROLL_STATE_TOUCH_SCROLL:
ekBar.reset();
break;
}
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
});
}
use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.
the class SimpleChatOnCoordinatorLayoutActivity method OnSendBtnClick.
private void OnSendBtnClick(String msg) {
if (!TextUtils.isEmpty(msg)) {
ImMsgBean bean = new ImMsgBean();
bean.setContent(msg);
chattingListAdapter.addData(bean, true, false);
scrollToBottom();
}
}
use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.
the class SimpleTranslucentChatActivity method OnSendBtnClick.
private void OnSendBtnClick(String msg) {
if (!TextUtils.isEmpty(msg)) {
ImMsgBean bean = new ImMsgBean();
bean.setContent(msg);
chattingListAdapter.addData(bean, true, false);
scrollToBottom();
}
}
use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.
the class ChattingListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final ImMsgBean bean = mData.get(position);
int type = getItemViewType(position);
View holderView = null;
switch(type) {
case VIEW_TYPE_LEFT_TEXT:
ViewHolderLeftText holder;
if (convertView == null) {
holder = new ViewHolderLeftText();
holderView = mInflater.inflate(R.layout.listitem_cha_left_text, null);
holderView.setFocusable(true);
holder.iv_avatar = (ImageView) holderView.findViewById(R.id.iv_avatar);
holder.tv_content = (TextView) holderView.findViewById(R.id.tv_content);
holderView.setTag(holder);
convertView = holderView;
} else {
holder = (ViewHolderLeftText) convertView.getTag();
}
disPlayLeftTextView(position, convertView, holder, bean);
break;
case VIEW_TYPE_LEFT_IMAGE:
ViewHolderLeftImage imageHolder;
if (convertView == null) {
imageHolder = new ViewHolderLeftImage();
holderView = mInflater.inflate(R.layout.listitem_chat_left_image, null);
holderView.setFocusable(true);
imageHolder.iv_avatar = (ImageView) holderView.findViewById(R.id.iv_avatar);
imageHolder.iv_image = (ImageView) holderView.findViewById(R.id.iv_image);
holderView.setTag(imageHolder);
convertView = holderView;
} else {
imageHolder = (ViewHolderLeftImage) convertView.getTag();
}
disPlayLeftImageView(position, convertView, imageHolder, bean);
break;
default:
convertView = new View(mActivity);
break;
}
return convertView;
}
use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.
the class QqActivity method OnSendBtnClick.
private void OnSendBtnClick(String msg) {
if (!TextUtils.isEmpty(msg)) {
ImMsgBean bean = new ImMsgBean();
bean.setContent(msg);
chattingListAdapter.addData(bean, true, false);
scrollToBottom();
}
}
Aggregations