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

Swipeable list items inside a fragment in a ViewPager #47

Open
Drakuwa opened this issue May 4, 2014 · 0 comments
Open

Swipeable list items inside a fragment in a ViewPager #47

Drakuwa opened this issue May 4, 2014 · 0 comments

Comments

@Drakuwa
Copy link

Drakuwa commented May 4, 2014

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);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant