Search in sources :

Example 1 with SwipeAdapterViewAdapter

use of cn.bingoogolapple.refreshlayout.demo.adapter.SwipeAdapterViewAdapter in project BGARefreshLayout-Android by bingoogolapple.

the class RefreshSwipeListViewFragment method setListener.

@Override
protected void setListener() {
    mRefreshLayout.setDelegate(this);
    mDataLv.setOnItemClickListener(this);
    mDataLv.setOnItemLongClickListener(this);
    mDataLv.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            if (AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL == scrollState) {
                mAdapter.closeOpenedSwipeItemLayoutWithAnim();
            }
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        }
    });
    mAdapter = new SwipeAdapterViewAdapter(mApp);
    mAdapter.setOnItemChildClickListener(this);
    mAdapter.setOnItemChildLongClickListener(this);
}
Also used : AbsListView(android.widget.AbsListView) SwipeAdapterViewAdapter(cn.bingoogolapple.refreshlayout.demo.adapter.SwipeAdapterViewAdapter)

Example 2 with SwipeAdapterViewAdapter

use of cn.bingoogolapple.refreshlayout.demo.adapter.SwipeAdapterViewAdapter in project BGARefreshLayout-Android by bingoogolapple.

the class SwipeListViewActivity method setListener.

@Override
protected void setListener() {
    mRefreshLayout.setDelegate(this);
    mDataLv.setOnItemClickListener(this);
    mDataLv.setOnItemLongClickListener(this);
    mDataLv.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            if (AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL == scrollState) {
                mAdapter.closeOpenedSwipeItemLayoutWithAnim();
            }
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
        }
    });
    mAdapter = new SwipeAdapterViewAdapter(this);
    mAdapter.setOnItemChildClickListener(this);
    mAdapter.setOnItemChildLongClickListener(this);
    findViewById(R.id.retweet).setOnClickListener(this);
    findViewById(R.id.comment).setOnClickListener(this);
    findViewById(R.id.praise).setOnClickListener(this);
}
Also used : AbsListView(android.widget.AbsListView) SwipeAdapterViewAdapter(cn.bingoogolapple.refreshlayout.demo.adapter.SwipeAdapterViewAdapter)

Aggregations

AbsListView (android.widget.AbsListView)2 SwipeAdapterViewAdapter (cn.bingoogolapple.refreshlayout.demo.adapter.SwipeAdapterViewAdapter)2