1 lvMaster.setOnScrollListener(new ScrollListener() {
2 @Override
3 public void onScrollStateChanged(AbsListView absListView, int i) {
4 super.onScrollStateChanged(absListView, i);
5 }
6
7 @Override
8 public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
9 super.onScroll(absListView, firstVisibleItem, visibleItemCount, totalItemCount);
10 View animView;
11 for (int i = 0; i < visibleItemCount; i++) {
12 animView = lvMaster.getListView().getChildAt(i);
13 if (animView == null) {
14 continue;
15 }
16 if (getScroll(lvMaster.getListView()) <= 0 && visibleItemCount == 1) {
17 ViewHelper.setAlpha(animView, 1f);
18 } else {
19 if(animView.getBottom()<=lvMaster.getListView().getBottom()){
20 ViewHelper.setAlpha(animView, 1f);
21 }
22 else {
23 ViewHelper.setAlpha(animView, 0f);
24 }
25 }
26 }
27 }
28 });