How to horizontally center on the screen an item from a recyclerview (horizontal)?

1

What I want is the following result:

Whenever the user moves to the next or previous item, it will be centered on the screen, just as it works if I used the Carousel. I tried some carousel libs but they only allowed to add texts / images, and I need to put a layout inside with some editTexts and buttons that will later be retrieved their respective values.

    
asked by anonymous 08.08.2018 / 23:04

1 answer

0

If you use buttons to manage navigation you can use this command:

recyclerView.scrollToPosition(position);

which will center on the recycler view the position passed in the constructor.

I hope it helps.

    
09.08.2018 / 12:56