Search in sources :

Example 11 with ImMsgBean

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

the class SimpleTranslucentChatActivity 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