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) {
}
});
}
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());
}
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);
}
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());
}
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) {
}
});
}
Aggregations