Frank-Zhu / PullZoomView

An Android custom ListView and ScrollView with pull to zoom-in.
Apache License 2.0
2.32k stars 624 forks source link

Can't set an OnScrollListener() #32

Open silviahisham opened 9 years ago

silviahisham commented 9 years ago

I need to set OnScrollListener for PullToZoomListViewEx to be able to endlessly scroll the list and get results.

revisedagain commented 8 years ago

try this

listView.getPullRootView().setOnScrollListener(new AbsListView.OnScrollListener() {
            @Override
            public void onScrollStateChanged(AbsListView view,
                                             int scrollState) { // TODO Auto-generated method stub

            }

            @Override
            public void onScroll(AbsListView view, int firstVisibleItem,
                                 int visibleItemCount, int totalItemCount) {

                int lastInScreen = firstVisibleItem + visibleItemCount;
                if (lastInScreen == totalItemCount) {
                    System.out.println("the end");

                } else {

                }

            }
        });

where listView is the name of your listview