use of com.lcodecore.twinklingrefreshlayout.adapter.PhotoAdapter 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.twinklingrefreshlayout.adapter.PhotoAdapter 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.twinklingrefreshlayout.adapter.PhotoAdapter 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);
}
});
}
Aggregations