use of com.lcodecore.tkrefreshlayout.RefreshListenerAdapter in project TwinklingRefreshLayout by lcodecorex.
the class NestedLayoutActivity method setupRecyclerView.
private void setupRecyclerView(RecyclerView rv) {
rv.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
photoAdapter = new PhotoAdapter();
rv.setAdapter(photoAdapter);
final TwinklingRefreshLayout refreshLayout = (TwinklingRefreshLayout) findViewById(R.id.refresh);
// ProgressLayout headerView = new ProgressLayout(this);
BezierLayout headerView = new BezierLayout(this);
refreshLayout.setHeaderView(headerView);
refreshLayout.setMaxHeadHeight(140);
// refreshLayout.setFloatRefresh(true);
// refreshLayout.setPureScrollModeOn(true);
refreshLayout.setOverScrollBottomShow(false);
refreshLayout.setTargetView(rv);
// refreshLayout.setAutoLoadMore(true);
// addHeader();
refreshCard();
refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
@Override
public void onRefresh(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
refreshCard();
refreshLayout.finishRefreshing();
}
}, 2000);
}
@Override
public void onLoadMore(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
loadMoreCard();
refreshLayout.finishLoadmore();
}
}, 2000);
}
});
// refreshLayout.startRefresh();
}
use of com.lcodecore.tkrefreshlayout.RefreshListenerAdapter in project TwinklingRefreshLayout by lcodecorex.
the class PhotoActivity method setupRecyclerView.
private void setupRecyclerView(RecyclerView rv) {
rv.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
photoAdapter = new PhotoAdapter();
rv.setAdapter(photoAdapter);
final TwinklingRefreshLayout refreshLayout = (TwinklingRefreshLayout) findViewById(R.id.refresh);
// ProgressLayout headerView = new ProgressLayout(this);
BezierLayout headerView = new BezierLayout(this);
refreshLayout.setHeaderView(headerView);
refreshLayout.setMaxHeadHeight(140);
// refreshLayout.setFloatRefresh(true);
// refreshLayout.setPureScrollModeOn(true);
refreshLayout.setOverScrollBottomShow(false);
// refreshLayout.setAutoLoadMore(true);
// addHeader();
refreshCard();
findViewById(R.id.ib_refresh).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
refreshLayout.startRefresh();
}
});
refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
@Override
public void onRefresh(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
refreshCard();
refreshLayout.finishRefreshing();
}
}, 2000);
}
@Override
public void onLoadMore(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
loadMoreCard();
refreshLayout.finishLoadmore();
}
}, 2000);
}
});
// refreshLayout.startRefresh();
}
use of com.lcodecore.tkrefreshlayout.RefreshListenerAdapter in project TwinklingRefreshLayout by lcodecorex.
the class CoordinateActivity method setupRecyclerView.
private void setupRecyclerView(RecyclerView rv) {
rv.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
photoAdapter = new PhotoAdapter();
rv.setAdapter(photoAdapter);
final TwinklingRefreshLayout refreshLayout = (TwinklingRefreshLayout) findViewById(R.id.refresh);
ProgressLayout header = new ProgressLayout(this);
refreshLayout.setHeaderView(header);
refreshLayout.setFloatRefresh(true);
refreshLayout.setEnableOverScroll(false);
refreshLayout.setHeaderHeight(140);
refreshLayout.setMaxHeadHeight(240);
refreshLayout.setTargetView(rv);
refreshCard();
refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
@Override
public void onRefresh(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
refreshCard();
refreshLayout.finishRefreshing();
}
}, 2000);
}
@Override
public void onLoadMore(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
loadMoreCard();
refreshLayout.finishLoadmore();
}
}, 2000);
}
});
}
use of com.lcodecore.tkrefreshlayout.RefreshListenerAdapter in project SmartCampus by Vegen.
the class EmploymentListActivity method setupUI.
@Override
protected void setupUI() {
type = getIntent().getIntExtra("type", Constant.NOTICE);
title = getIntent().getStringExtra("title");
url = getIntent().getStringExtra("url");
setTitle(title);
refreshLayout.setEnableLoadmore(false);
refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
@Override
public void onRefresh(TwinklingRefreshLayout refreshLayout) {
super.onRefresh(refreshLayout);
loadData();
}
});
employmentListAdapter = new EmploymentListAdapter();
employmentListAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(linearLayoutManager);
recyclerView.setAdapter(employmentListAdapter);
new QuickReturnTopManager(recyclerView);
recyclerView.addItemDecoration(new ListItemDecoration());
View emptyView = View.inflate(this, R.layout.app_view_empty, null);
employmentListAdapter.setEmptyView(emptyView);
employmentListAdapter.setOnLoadMoreListener(() -> presenter().getEmploymentList(url + page, type), recyclerView);
}
use of com.lcodecore.tkrefreshlayout.RefreshListenerAdapter in project SmartCampus by Vegen.
the class LostAndFoundActivity method setupUI.
@Override
protected void setupUI() {
setTitle("失物招领");
lostAndFoundAdapter = new LostAndFoundAdapter();
lostAndFoundAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
RecyclerView.LayoutManager layoutManage = /*new FullyGridLayoutManager(this, 2); // */
new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
recyclerView.setLayoutManager(layoutManage);
recyclerView.setAdapter(lostAndFoundAdapter);
new QuickReturnTopManager(recyclerView);
recyclerView.addItemDecoration(new GridItemDecoration());
View emptyView = View.inflate(this, R.layout.app_view_empty, null);
lostAndFoundAdapter.setEmptyView(emptyView);
lostAndFoundAdapter.setOnLoadMoreListener(() -> {
presenter().getLostList(SKIP, skip);
LogUtils.e("更多更多!!!");
}, recyclerView);
lostAndFoundAdapter.disableLoadMoreIfNotFullPage();
refreshLayout.setEnableLoadmore(false);
refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
@Override
public void onRefresh(TwinklingRefreshLayout refreshLayout) {
super.onRefresh(refreshLayout);
loadData();
}
});
}
Aggregations