Ahmet Özaydın
Ahmet Özaydın

Reputation: 51

How to make a recyclerview that shows one item and shows another item when it is swiped horizontally?

For example the recyclerview should show one image at the same time and other image should be shown when the recyclerview is swiped horizontally.(https://i.sstatic.net/4BBrs.jpg)

I use Linear Layout as horizontally to show images.

Upvotes: 0

Views: 124

Answers (1)

Ahmet Özaydın
Ahmet Özaydın

Reputation: 51

I've found a solution. I wanted to show just one item or image at the same time in a recylerview and when the recyclerview is swiped next item would be shown to the user. That work is just basic as adding that piece of code in the below after making the configuration of your recylerview.

 PagerSnapHelper().attachToRecyclerView(yourRecyclerView)

Upvotes: 1

Related Questions