Here is a demo to show how it works. (sorry about the color, it's a gif)

Or you can watch the handyCalc video demo in my_submission_is_a_calculator-t1704.html
There is some other widget in android.widget that you can flip, like Spinner, Gallery. In Spinner, you cannot flip if it's child is focusable, like a button in a Spinner.
Now i'll just show you how to use it. you can view the code below or download a package and import in your eclipse to run it yourself: files/handycalc_library_155.zip
It's just a layout file to make it work:
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <org.mmin.handycalc.HandyFlipper xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:handy="http://schemas.android.com/apk/res/org.mmin.handycalc"
- handy:flipHorizontal="true"
- handy:flipVertical="true"
- handy:circle="true"
- handy:motionSpeed="60"
- handy:motionInterval="500"
- handy:motionDistance="60"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <!--
- motionSpeed is the minimum distance(in pixel) between the last ACTION_MOVE and ACTION_UP event
- motionInterval is the maximum milliseconds between ACTION_DOWN and ACTION_UP event
- motionDistance is the minimum distance(in pixel) between ACTION_DOWN and ACTION_UP event
- -->
- <TextView
- android:text="1 / 3nflip left|right, up|down"
- android:textSize="36sp"
- android:textAlign="center"
- android:background="#6FFF"
- android:layout_width="fill_parent"
- android:layout_height="300px"
- />
- <EditText
- android:text="2 / 3nthis is a EditText which you cannot flip in Spinner"
- android:textSize="36sp"
- android:textAlign="center"
- android:layout_width="fill_parent"
- android:layout_height="300px"
- />
- <Button
- android:text="3 / 3nthis is a Button"
- android:textSize="36sp"
- android:textAlign="center"
- android:layout_width="fill_parent"
- android:layout_height="300px"
- />
- </org.mmin.handycalc.HandyFlipper>
Parsed in 0.004 seconds, using GeSHi 1.0.8.4
Next section I'll show you how to make this custom widget.