Search in sources :

Example 6 with BGAMoocStyleRefreshViewHolder

use of cn.bingoogolapple.refreshlayout.BGAMoocStyleRefreshViewHolder in project BGARefreshLayout-Android by bingoogolapple.

the class NormalRecyclerViewActivity method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    BGAMoocStyleRefreshViewHolder moocStyleRefreshViewHolder = new BGAMoocStyleRefreshViewHolder(mApp, true);
    moocStyleRefreshViewHolder.setOriginalImage(R.mipmap.bga_refresh_moooc);
    moocStyleRefreshViewHolder.setUltimateColor(R.color.imoocstyle);
    mRefreshLayout.setRefreshViewHolder(moocStyleRefreshViewHolder);
    initBanner();
    mDataRv.addItemDecoration(new Divider(this));
    mDataRv.setLayoutManager(new GridLayoutManager(mApp, 2, GridLayoutManager.VERTICAL, false));
    //        mDataRv.setLayoutManager(new LinearLayoutManager(mApp, LinearLayoutManager.VERTICAL, false));
    mDataRv.setAdapter(mAdapter);
    mEngine.loadInitDatas().enqueue(new Callback<List<RefreshModel>>() {

        @Override
        public void onResponse(Call<List<RefreshModel>> call, Response<List<RefreshModel>> response) {
            mAdapter.setData(response.body());
        }

        @Override
        public void onFailure(Call<List<RefreshModel>> call, Throwable t) {
        }
    });
}
Also used : BGAMoocStyleRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGAMoocStyleRefreshViewHolder) GridLayoutManager(android.support.v7.widget.GridLayoutManager) List(java.util.List) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Aggregations

BGAMoocStyleRefreshViewHolder (cn.bingoogolapple.refreshlayout.BGAMoocStyleRefreshViewHolder)6 Divider (cn.bingoogolapple.refreshlayout.demo.widget.Divider)2 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 List (java.util.List)1