Search in sources :

Example 1 with Divider

use of cn.bingoogolapple.refreshlayout.demo.widget.Divider in project BGARefreshLayout-Android by bingoogolapple.

the class SwipeRecyclerViewActivity method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mRefreshLayout.setRefreshViewHolder(new BGANormalRefreshViewHolder(mApp, true));
    initBanner();
    mDataRv.addItemDecoration(new Divider(this));
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    mDataRv.setLayoutManager(linearLayoutManager);
    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 : BGANormalRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder) List(java.util.List) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Example 2 with Divider

use of cn.bingoogolapple.refreshlayout.demo.widget.Divider in project BGARefreshLayout-Android by bingoogolapple.

the class RefreshSwipeRecyclerViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    //        mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), false);
    mAdapter.addHeaderView(DataEngine.getCustomHeaderView(mApp));
    BGAMoocStyleRefreshViewHolder moocStyleRefreshViewHolder = new BGAMoocStyleRefreshViewHolder(mApp, true);
    moocStyleRefreshViewHolder.setOriginalImage(R.mipmap.bga_refresh_moooc);
    moocStyleRefreshViewHolder.setUltimateColor(R.color.imoocstyle);
    mRefreshLayout.setRefreshViewHolder(moocStyleRefreshViewHolder);
    mDataRv.addItemDecoration(new Divider(mApp));
    mDataRv.setLayoutManager(new LinearLayoutManager(mApp));
    mDataRv.setAdapter(mAdapter.getHeaderAndFooterAdapter());
}
Also used : BGAMoocStyleRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGAMoocStyleRefreshViewHolder) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Example 3 with Divider

use of cn.bingoogolapple.refreshlayout.demo.widget.Divider in project BGARefreshLayout-Android by bingoogolapple.

the class StickyNavRecyclerViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    mDataRv.addItemDecoration(new Divider(mApp));
    //        mDataRv.setLayoutManager(new GridLayoutManager(mApp, 2, GridLayoutManager.VERTICAL, false));
    mDataRv.setLayoutManager(new LinearLayoutManager(mApp, LinearLayoutManager.VERTICAL, false));
    mDataRv.setAdapter(mAdapter);
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Example 4 with Divider

use of cn.bingoogolapple.refreshlayout.demo.widget.Divider in project BGARefreshLayout-Android by bingoogolapple.

the class RefreshRecyclerViewFragment method processLogic.

@Override
protected void processLogic(Bundle savedInstanceState) {
    //        mRefreshLayout.setCustomHeaderView(DataEngine.getCustomHeaderView(mApp), true);
    View headerView = View.inflate(mApp, R.layout.view_custom_header2, null);
    // 测试自定义header中控件的点击事件
    headerView.findViewById(R.id.btn_custom_header2_test).setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ToastUtil.show("点击了测试按钮");
        }
    });
    // 模拟网络数据加载,测试动态改变自定义header的高度
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            ((TextView) getViewById(R.id.tv_custom_header2_title)).setText(R.string.test_custom_header_title);
            ((TextView) getViewById(R.id.tv_custom_header2_desc)).setText(R.string.test_custom_header_desc);
        }
    }, 2000);
    //        mRefreshLayout.setCustomHeaderView(headerView, true);
    mAdapter.addHeaderView(headerView);
    BGAStickinessRefreshViewHolder stickinessRefreshViewHolder = new BGAStickinessRefreshViewHolder(mApp, true);
    stickinessRefreshViewHolder.setStickinessColor(R.color.colorPrimary);
    stickinessRefreshViewHolder.setRotateImage(R.mipmap.bga_refresh_stickiness);
    mRefreshLayout.setRefreshViewHolder(stickinessRefreshViewHolder);
    mDataRv.addItemDecoration(new Divider(mApp));
    mDataRv.setLayoutManager(new GridLayoutManager(mApp, 2, GridLayoutManager.VERTICAL, false));
    //        mDataRv.setLayoutManager(new LinearLayoutManager(mApp, LinearLayoutManager.VERTICAL, false));
    mDataRv.setAdapter(mAdapter.getHeaderAndFooterAdapter());
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) BGAStickinessRefreshViewHolder(cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder) Handler(android.os.Handler) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) Divider(cn.bingoogolapple.refreshlayout.demo.widget.Divider)

Example 5 with Divider

use of cn.bingoogolapple.refreshlayout.demo.widget.Divider 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

Divider (cn.bingoogolapple.refreshlayout.demo.widget.Divider)5 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 GridLayoutManager (android.support.v7.widget.GridLayoutManager)2 BGAMoocStyleRefreshViewHolder (cn.bingoogolapple.refreshlayout.BGAMoocStyleRefreshViewHolder)2 List (java.util.List)2 Handler (android.os.Handler)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 TextView (android.widget.TextView)1 BGANormalRefreshViewHolder (cn.bingoogolapple.refreshlayout.BGANormalRefreshViewHolder)1 BGAStickinessRefreshViewHolder (cn.bingoogolapple.refreshlayout.BGAStickinessRefreshViewHolder)1