Skip to content
This repository was archived by the owner on Apr 26, 2023. It is now read-only.
This repository was archived by the owner on Apr 26, 2023. It is now read-only.

Swipeable list items inside a fragment in a ViewPager #47

Open

Description

@Drakuwa

Hello all,

I'm having trouble with the EnhancedListView in a fragment from ViewPager. I'm not sure if this question has been answered here, but I couldn't find a solution.

I've initialized an enhanced list view with a custom BaseAdapter which is in a the first out of 3 fragments of a view pager. The swiping (SwipeDirection.END) only works when my list is scrolling and I interrupt the scrolling with a horizontal slide on top of a list item. When the list isn't scrolling, the swipe on top of a list item isn't detected.

I tried calling view.getParent().requestDisallowInterceptTouchEvent(true); for every single list item in the adapter, but that only cancels the list view scrolling, and view.getParent().getParent().requestDisallowInterceptTouchEvent(true); which cancels the swiping to the next fragment but does not enable swipe to dismiss.

For the record, I initialize the list like this:
EnhancedListView lv = (EnhancedListView) v.findViewById(R.id.transactionsList);
lv.setAdapter(adapter);
lv.enableSwipeToDismiss();
// transactionHolder - id of the list item layout
lv.setSwipingLayout(R.id.transactionHolder);
EnhancedListView.UndoStyle style = UndoStyle.SINGLE_POPUP;
lv.setUndoStyle(style);
EnhancedListView.SwipeDirection direction = SwipeDirection.END;
lv.setSwipeDirection(direction);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions