0

I have implemented Tablayout using viewpager inside recyclerview. and also integrated swipe delete using ItemTouchHelper in recyclerview.

Now i am facing one issue, Can't able to access viewpager moving. When i am trying to change the page its affecting swipe delete function.

Anyone help me out.

Thanks and Regards, Gowtham.R

  • 1
    In my opinion, its not good practice to add swipe action to the list items inside view pager. You could add a context menu on long press of the list item instead. – SripadRaj Feb 28 '18 at 10:18
  • you can try this https://stackoverflow.com/questions/25978462/swiperefreshlayout-viewpager-limit-horizontal-scroll-only – Santanu Sur Feb 28 '18 at 10:20

1 Answers1

1

why delete swipe ?! you can use this under methods for disable swipe in viewPager : it worked for me.

view_pager.setOnTouchListener { _, _ -> true }

and

view_pager.beginFakeDrag()

and now you can change the page with Above Tabs in TabLayout.

Mehrdad Dolatkhah
  • 668
  • 2
  • 9
  • 28