1

I am using AndroidSlidingUpPanel in my project. The second panel of AndroidSlidingUpPanel only contains the list view of button which are scrollable. AndroidSlidingUpPanel and scrolling listview are working perfectly, but I have to prevent scrolling the listview when the AndroidSlidingUpPanel is in the COLLAPSE state, and scrolling must be active only in the AndroidSlidingUpPanel EXPAND state. How can I achieve this?

How can I prevent scrolling of the list view in the onScroll method of setOnScrollListener?

I wrote this but it is not working.

listview.setOnScrollListener(new AbsListView.OnScrollListener() {
    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
        if (slidingLayout != null && slidingLayout.getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
            Log.d(TAG, "onScrollStateChanged Event *COLLAPSED**********");
            return;
        }
    }

    @Override
    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
       if (slidingLayout != null && slidingLayout.getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
            Log.d(TAG, "onScroll Event Event *COLLAPSED**********");
            return;
        }
    }
});
Pang
  • 9,564
  • 146
  • 81
  • 122
Nithin Krishnan P
  • 748
  • 1
  • 6
  • 14

0 Answers0