João Sousa
João Sousa

Reputation: 21

Swipe in Recycler when applied in ViewPager

I have a viewpager that includes one recycler view.

Every item of the recycler view can be dismissed by swipe.

When i apply the recycler view in the view pager, the view pager does not allow the swipe-to-dismiss and overlay the control with the page swapping.

When i detect the swipe in the recycler, i disable the viewpager onInterceptTouchEvent, but the swipe movement initiated previously is restarted.

Anyone has a solution ?

Upvotes: 2

Views: 946

Answers (1)

McGuile
McGuile

Reputation: 828

Using a swipe action on a recyclerview item works against the swiping action of a viewpager. Essentially, you're telling the user to do the same action on the same screen to do two entirely different actions. This is bad design. Ask yourself if it is necessary to use both of these things. I had the same predicament and removed the viewpager entirely.

Upvotes: 1

Related Questions