I've been trying to implement a recyclerView to function similar to a ViewPager by displaying one item at a time. I looked at https://github.com/lsjwzh/RecyclerViewPager and found it useful. I basically want to implement a vertical ViewPager using recyclerView wherein each item overlaps over the other during transitions. Should i be looking at inter-item animations? And if so, I would appreciate any help that i could get. Or should I just stick to a ViewPager? (My apprehensions about ViewPager are that it may be slower than a recyclerView)
Asked
Active
Viewed 885 times
1
-
You could try this library https://github.com/lsjwzh/RecyclerViewPager – lubilis Jun 14 '16 at 12:44
-
Yes, I did try that. But as i said, i need a different sort of transition between items - something which imitates a viewpager – Vijeet Vergis Jun 14 '16 at 13:25
-
Sorry i didn't read the library reference, if you don't want to use ViewPager i think you'll need to extend RecyclerView, disable scroll and add a SwipeGesture to enable paging. About animation, you'll have to move programmatically the RecyclerView according touch swipe coordinates – lubilis Jun 14 '16 at 13:37
-
Thanks, I'll look into it – Vijeet Vergis Jun 15 '16 at 02:06
1 Answers
0
You can try this project I did for Udacity Android Nanodegree. This holds a similar functionallity:
https://github.com/sprengerst/udacity_nanodegree_project_5
There, a Viewerpager is populated by Fragments which are then populated by a Loader.

Stefan Sprenger
- 1,050
- 20
- 42
-
I looked into your project, but again this is not what i want to achieve. I want to view only one item of the recyclerview at a time per page. But i want to show the transitions from one item to the other as fragment transitions. – Vijeet Vergis Jun 15 '16 at 02:09
-
Sorry for my missunderstanding, but isn't the DetailView of each article such a thing? The Detailview is handled by Fragments in a Viewerpager, which make the Articles horicontal swipeable? So you see one full article at a time but can swipe through all articles. – Stefan Sprenger Jun 15 '16 at 05:37
-
I'm sorry for not having explained what i want clearly enough. I basically want to implement a vertical ViewPager using recyclerView wherein each item overlaps over the other during transitions – Vijeet Vergis Jun 17 '16 at 07:02
-
@Vijeet Vergis so you want vertical scrollable fragments with animation? – Stefan Sprenger Jun 17 '16 at 07:05
-
Maybe this link could help you for the vertical part: http://stackoverflow.com/a/22797619/2522174 – Stefan Sprenger Jun 17 '16 at 07:06
-
And here is a guide to make transition to a viewerpager object. I'm not sure if the vertical edition is easy to combine with animations. http://blog.rhesoft.com/2015/03/20/tutorial-viewpagertransforms-library-animations-for-transforming-viewpager-on-android-studio/ – Stefan Sprenger Jun 17 '16 at 07:09
-
No, but they are cardview items consisiting of an imageview and a textview. they work sort of similar to this https://github.com/lsjwzh/RecyclerViewPager. – Vijeet Vergis Jun 17 '16 at 07:20
-
What I'm able to achieve till now is a vertical viewPager along with each item taking up a whole page. What i want to achieve is the overlapping effect on this – Vijeet Vergis Jun 17 '16 at 07:21
-
So you mean like the Itunes Mediatek a cover in the middle an the other items left and right? – Stefan Sprenger Jun 17 '16 at 07:25
-
Maybe this could help then: http://stackoverflow.com/q/20883849/2522174 – Stefan Sprenger Jun 17 '16 at 07:31
-
Sort of like that, but instead the other items would be up and down instead of left and right – Vijeet Vergis Jun 17 '16 at 07:33
-
Thank you for all the time you took to help me with my query. I'll look into it – Vijeet Vergis Jun 17 '16 at 07:35
-
Ah ok. I think this library could be the right one. https://github.com/Azoft/CarouselLayoutManager – Stefan Sprenger Jun 17 '16 at 07:35
-
-