I’m happy to announce the first release of FlipView, an Android UI component which help add flipping animation in your application. Please download and install the pre-built demo APK file to check out it in action:
I’m also glad to use some pictures captured during my trip to build one of the demos:
Adapteris supported for adding multiple pages into a sequence of flipping animation.
Touch events are correctly dispatched to views in each page, which allows using buttons or other controls in pages.
Bouncing effect is added for the first and last pages.
Less flicker when starting and ending the animation.
Less CPU resource is used when the animation is idle.
The general routine of setting up
FlipViewController is straightforward:
- Creates an instance of
- Provides an adapter as the data source. It’s very similar to the setup logic for a
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Adds the instance of
FlipViewControllerinto your view hierarchy.
FlipViewControllercorrespondingly in your activity’s life-cycle methods.
1 2 3 4 5 6 7 8 9 10 11
Please also refer to the demo project for more details:
There are some facts about the component which you should pay special attention to:
It’s recommended to use only ONE instance per activity. As the animation is implemented in a
GLSurfaceView, using multiple instances in one activity may cause serious compatible problems on some Android devices.
Vertical scroll in sub-views may not work as the touch events are consumed by the animation.
I don’t have enough resources to test its compatibility across all Android OS versions and devices. Please verify it after integrating it in your project.
Please use Github issues to report any problems and request more features. Thanks in advance.