Search in sources :

Example 6 with ImMsgBean

use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleChatUserDefActivity method initListView.

private void initListView() {
    chattingListAdapter = new ChattingListAdapter(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) {
        }
    });
}
Also used : ChattingListAdapter(com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter) ImMsgBean(com.xhsemoticonskeyboard.common.data.ImMsgBean) ArrayList(java.util.ArrayList) AbsListView(android.widget.AbsListView)

Example 7 with ImMsgBean

use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleChatUserDefActivity method OnSendBtnClick.

private void OnSendBtnClick(String msg) {
    if (!TextUtils.isEmpty(msg)) {
        ImMsgBean bean = new ImMsgBean();
        bean.setContent(msg);
        chattingListAdapter.addData(bean, true, false);
        scrollToBottom();
    }
}
Also used : ImMsgBean(com.xhsemoticonskeyboard.common.data.ImMsgBean)

Example 8 with ImMsgBean

use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleChatActivity method initListView.

private void initListView() {
    chattingListAdapter = new ChattingListAdapter(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) {
        }
    });
}
Also used : ChattingListAdapter(com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter) ImMsgBean(com.xhsemoticonskeyboard.common.data.ImMsgBean) ArrayList(java.util.ArrayList) AbsListView(android.widget.AbsListView)

Example 9 with ImMsgBean

use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleChatActivity method OnSendBtnClick.

private void OnSendBtnClick(String msg) {
    if (!TextUtils.isEmpty(msg)) {
        ImMsgBean bean = new ImMsgBean();
        bean.setContent(msg);
        chattingListAdapter.addData(bean, true, false);
        scrollToBottom();
    }
}
Also used : ImMsgBean(com.xhsemoticonskeyboard.common.data.ImMsgBean)

Example 10 with ImMsgBean

use of com.xhsemoticonskeyboard.common.data.ImMsgBean in project XhsEmoticonsKeyboard by w446108264.

the class SimpleChatOnCoordinatorLayoutActivity method initListView.

private void initListView() {
    chattingListAdapter = new ChattingListAdapter(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) {
        }
    });
}
Also used : ChattingListAdapter(com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter) ImMsgBean(com.xhsemoticonskeyboard.common.data.ImMsgBean) ArrayList(java.util.ArrayList) AbsListView(android.widget.AbsListView)

Aggregations

ImMsgBean (com.xhsemoticonskeyboard.common.data.ImMsgBean)11 AbsListView (android.widget.AbsListView)5 ArrayList (java.util.ArrayList)5 ChattingListAdapter (com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter)4 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1