@Override
public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) {}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
if (view.getLastVisiblePosition() == view.getCount() - 1) {
if (!loading && foot.getChildCount() > 0) {
loading = true;
updateFootView(true);
page = adapter.getCount() / Constant.LIMIT;
int offset = page * Constant.LIMIT;
loadData(Constant.LIMIT, offset, Constant.MORE);
}
}
hideSoftInputFromWindow();
}
}
private void updateFootView(boolean loading) {
if (loading) {
tvload.setVisibility(View.INVISIBLE);
progresslay.setVisibility(View.VISIBLE);
} else {
tvload.setVisibility(View.VISIBLE);
progresslay.setVisibility(View.INVISIBLE);
}
}