0

I need to implement a horizontally scrollable slider, something like

Item1 is selected Item 1 is selected

Item2 is selected enter image description here

Item3 is selected enter image description here

I tried to use both RecyclerView and HorizontalScrollView. But in both cases if all the items are visible, the view will not scroll anymore.

But I need to scroll the items so that the one in the center of the screen will be the selected option. And the end of the list (first and last item of the list) should be scrolled till the middle of the screen only.

Any suggestions are really appreciated.

coder
  • 312
  • 3
  • 12
  • 1
    You should look at this library, it has a feature something you want https://github.com/nshmura/RecyclerTabLayout – ertuzun Feb 26 '21 at 09:03
  • 1
    Also to keep scrolling once all items are shown you could either add invisible dummy items or add padding to your recyclerview. – J7bits Feb 26 '21 at 12:18
  • This is what I was looking for - https://stackoverflow.com/a/53510142/1554537 – coder Mar 01 '21 at 06:43

0 Answers0