davidsun / horizontalpager

An Android horizontally scrolling view that snaps to child pages neatly and supports nested vertically scrolling child views.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HorizontalPager for Android

HorizontalPager is a modified version of Marc Reichelt's RealViewSwitcher. It's essentially a horizontal ScrollView that snaps to a full-width child (like the Android homescreen's switching behavior). This modified version supports vertically scrolling children inside the view (Lists, vertical ScrollView children), animates a little more quickly and consistently to views regardless of how "far away" a child is when the animation is requested, scrolls a bit more easily, and is screen-density-neutral regarding swipe sensitivity. It also includes a demo of how you can nest vertically scrolling elements inside the pager and use a RadioGroup as a tablike controller to switch pages (somewhat like the Android 2.0+ News widget). There's a simple demo to get you started in addition to the more complex one with an XML layout), or just grab the PageSwitcher class, drop it into your app, and get rolling.

PageSwitcher screenshot

License

Like Marc's original, this modified version is released under an Apache 2.0 license.

About

An Android horizontally scrolling view that snaps to child pages neatly and supports nested vertically scrolling child views.


Languages

Language:Java 100.0%