3

I am trying to disable scrolling in the groups when one group is expanded . And let the scrolling only in the expanded group's child zone. So far, the whole expandableListView 's scrolling is disabled.

I created an ExpandableListView like this:

ExpandableListView mList;
mList.setAdapter(new SimpleExpandableListAdapter(.... ));

mList.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
    @Override
    public boolean onGroupClick(final ExpandableListView parent, final View v, final int groupPosition,
            final long id) {

        disableScroll(parent);
        return false;
    }
});

The method disableScroll uses OnTouchListener ( see Disable scrolling in listview )

void disableScroll(final View view) {
    view.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(final View v, final MotionEvent event) {
            return (event.getAction() == MotionEvent.ACTION_MOVE);
        }
    });
}

Is it possible to enable the scrolling only in the ExpandableListView's childs when one group is expanded?

Community
  • 1
  • 1
Raymond Chenon
  • 11,482
  • 15
  • 77
  • 110

0 Answers0