Question

I'm looking to create a carousel that snaps to whatever page covers most of the screen after a swipe, similar to how swipes can move through pages of android shortcuts and widgets. Similar to this. Each page should be able to display any assortment of layouts, data, or pictures.

I have looked at the resources on the "Creating an Android Image Carousel" page by Giancarlo Leonio. However, most questions are unanswered or do not apply to android.

I have seen tutorials with a viewpager, but they immediately switch pages after a swipe. I prefer that the pages appear to be connected.

Was it helpful?

Solution

You are looking for ViewPager. I don't know where you found these tutorials that lead you to believe that the interactions would appear that the pages are not interconnected.

You can find a good tutorial and demo transitions on the official documentation: http://developer.android.com/training/animation/screen-slide.html

Additionally, if you also want the indicators that Carousels would normally have you can take a look at the most popular library out there for ViewPagers...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top