Search in sources :

Example 1 with VideoContentAdapter

use of com.qyh.myblog_android.ui.adapter.VideoContentAdapter in project Qblog_Android by qiaoyhh.

the class VideoContentFragment method initView.

@Override
protected void initView() {
    mAdapter = new VideoContentAdapter(R.layout.item_videocontent_view, null);
    mLayoutManger = new LinearLayoutManager(mContext);
    viewMain.setLayoutManager(mLayoutManger);
    viewMain.setHasFixedSize(true);
    viewMain.addItemDecoration(new RecyclerViewDecoration(mContext, LinearLayoutManager.HORIZONTAL, R.drawable.divider_mileage));
    viewMain.setAdapter(mAdapter);
    swipeRefresh.setColorSchemeColors(getResources().getColor(R.color.blue_light), getResources().getColor(R.color.green_light), getResources().getColor(R.color.orange_light), getResources().getColor(R.color.red_light));
    swipeRefresh.setOnRefreshListener(this);
    mAdapter.setEnableLoadMore(false);
    mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {

        @Override
        public void onLoadMoreRequested() {
            page++;
            getVideoList(page, Constants.TYPE_LOADMORE);
        }
    });
}
Also used : RecyclerViewDecoration(com.qyh.myblog_android.widget.RecyclerViewDecoration) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) VideoContentAdapter(com.qyh.myblog_android.ui.adapter.VideoContentAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)1 VideoContentAdapter (com.qyh.myblog_android.ui.adapter.VideoContentAdapter)1 RecyclerViewDecoration (com.qyh.myblog_android.widget.RecyclerViewDecoration)1