Search in sources :

Example 1 with ChattingListAdapter

use of com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter 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 2 with ChattingListAdapter

use of com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter 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 3 with ChattingListAdapter

use of com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter 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)

Example 4 with ChattingListAdapter

use of com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter 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

AbsListView (android.widget.AbsListView)4 ChattingListAdapter (com.xhsemoticonskeyboard.common.adapter.ChattingListAdapter)4 ImMsgBean (com.xhsemoticonskeyboard.common.data.ImMsgBean)4 ArrayList (java.util.ArrayList)4