-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.mk
37 lines (33 loc) · 1.64 KB
/
notes.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
1、
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
switch (scrollState) {
case AbsListView.OnScrollListener.SCROLL_STATE_IDLE: // 停止滚动
ImageLoader.getInstance().resume();
break;
case AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL: // 正在滚动
case AbsListView.OnScrollListener.SCROLL_STATE_FLING: // 手指做了抛的动作(手指离开屏幕前,用力滑了一下)
default:
ImageLoader.getInstance().pause();
}
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (firstVisibleItem == 0) {
}
if (!isGoing && (visibleItemCount + firstVisibleItem == totalItemCount)) {
if (curPage < pageCount) {
footView.setVisibility(View.VISIBLE);
//listView.addFooterView(footView);
initHttp(MORE);
} else {
footView.setText(getResources().getString(R.string.load_finish));
footView.setVisibility(View.VISIBLE);
}
} else {
footView.setVisibility(View.VISIBLE);
footView.setText(getResources().getString(R.string.load_more));
}
}
});