1

I have developed an app which contains a horizontal RecyclerView with two Buttons (back/forward) when clicked on the button the child view scroll to the respective position ( for forward it scrolls to position+1 and back is scrolled to position-1).

But the user can also drag the screen to left or right the view the next or previous view. I just want to disable that the user can't drag the screen left or right to view the next or previous child views.

But when clicked on the button it will scroll forward or backwards according to the selection.

user3040153
  • 169
  • 9
  • I have tried linearLayoutManager = new LinearLayoutManager(context) { @Override public boolean canScrollVertically() { return false; } }; but it completely disables the horizontal scroll and even it does not scolls to the posiiton when clicked on the button – Kushal Mahapatro Feb 15 '17 at 05:49
  • 1
    disable touch of recyclerview – user3040153 Feb 15 '17 at 05:53
  • If you want to disable scroll by user then check this post http://stackoverflow.com/questions/5763304/disable-scrollview-programmatically – Pratik Popat Feb 15 '17 at 06:15
  • 2
    Maybe `ViewPager` suits your needs better. – Lym Zoy Feb 15 '17 at 07:47

0 Answers0