1

I would like to make a horizontal RecyclerView like this: (ignore white circle in the centre)

Here the major things are scaling the center item and scaling the outgoing item as well. Can I have some reference point as how can I achieve such a view?

Paras Sidhu
  • 652
  • 1
  • 12
  • 36

1 Answers1

1

You can use below library for this I have already use this library for same

https://github.com/Azoft/CarouselLayoutManager

Add CarouselLayoutManager and set recycler view property as per below

CarouselLayoutManager layoutManager = new CarouselLayoutManager(CarouselLayoutManager.HORIZONTAL, true);
layoutManager.setPostLayoutListener(new CarouselZoomPostLayoutListener());

yourAdapter = new YourAdapter(arrayList, context);
binding.rvGame.setLayoutManager(layoutManager);
binding.rvGame.setHasFixedSize(true);
binding.rvGame.setAdapter(yourAdapter);
binding.rvGame.addOnScrollListener(new CenterScrollListener());

I hope this can help you!

Thank You.

Hardik Talaviya
  • 1,396
  • 5
  • 18
  • 1
    This didn't work for me. Items never appeared. I know that for this, RecyclerView has to be of fixed size but somehow no items appeared and I followed the same way as above. – Paras Sidhu Feb 06 '20 at 13:33
  • @ParasSidhu May be problem in your code I was already achieved this thing using same and it's working perfectly. – Hardik Talaviya Feb 06 '20 at 13:36
  • Sorry for the delay, here it's: https://gist.github.com/sidhuparas/0fa91ce7c02acb8e7c9bd72ad30e01d3 No items appear. I tried with normal layout manager and its showing the items so there should not be anything wrong with anything else – Paras Sidhu Feb 09 '20 at 09:47