ViewFlipper
is a handy container in Android, showing one child
at a time out of an arbitrary number of children. In that sense,
it is a bit like tabs, just without, y'know, the tabs. Instead, it
is up to you to arrange to flip between one child and another.
ViewSwiper
is a subclass of ViewFlipper
that uses gestures.
The user can swipe their finger right-to-left to move to the
next child, or from left-to-right to move to the previous child.
This is distributed as an Android library project, following the conventions of the Android Parcel Project. You can download a ZIP file containing just the library project (sans sample code) from the Downloads section of this GitHub repository.
Add the library project to your main project. Then, you can
reference the com.commonsware.cwac.ViewSwiper
widget in your
layout files, as a drop-in replacement for ViewFlipper
.
You can elect to add android:gestureColor
and/or
android:uncertainGestureColor
attributes, to control
the color that is "drawn" by the user's swipes. By default,
it is yellow. Set both to be transparent (#00000000
) to
eliminate the effect.
This depends upon the cwac-parcel
library for accessing
project-level resources.
This is version v0.1.1 of this module, meaning it is brand-spankin'-new.
There is a demo/
directory containing a demo project. It uses
the library project itself to access the source code and
resources of the ViewSwiper
library.
The code in this project is licensed under the Apache Software License 2.0, per the terms of the included LICENSE file.
If you have questions regarding the use of this code, please post a question
on StackOverflow tagged with commonsware
and android
. Be sure to indicate
what CWAC module you are having issues with, and be sure to include source code
and stack traces if you are encountering crashes.
v0.1.1: Fixed bug in Ant packaging tasks v0.1.0: initial release