use of com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout in project TwinklingRefreshLayout by lcodecorex.
the class MusicActivity method setupListView.
private void setupListView(ListView listView) {
TwinklingRefreshLayout refreshLayout = (TwinklingRefreshLayout) findViewById(R.id.refresh);
ProgressLayout headerView = new ProgressLayout(this);
refreshLayout.setHeaderView(headerView);
View exHeader = View.inflate(this, R.layout.header_music, null);
refreshLayout.addFixedExHeader(exHeader);
refreshLayout.setOverScrollRefreshShow(false);
// refreshLayout.setFloatRefresh(true);
adapter = new MusicAdapter();
listView.setAdapter(adapter);
adapter.refreshCard();
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
ToastUtil.show("item clicked!");
}
});
refreshLayout.setOnRefreshListener(new RefreshListenerAdapter() {
@Override
public void onRefresh(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
adapter.refreshCard();
refreshLayout.finishRefreshing();
}
}, 2000);
}
@Override
public void onLoadMore(final TwinklingRefreshLayout refreshLayout) {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
adapter.loadMoreCard();
refreshLayout.finishLoadmore();
}
}, 2000);
}
});
}
use of com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout 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.TwinklingRefreshLayout 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.TwinklingRefreshLayout 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.TwinklingRefreshLayout 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);
}
Aggregations