Satellite menu is now a very popular "control", many Android programmers are flocking to preview as. The traditional satellite menu is implemented with animation, requires a lot of code, and the algorithm is very much, accidentally will be overnight debug. This post uses the property animation animator to implement the satellite menu.
An analysis of the property animation animator
Animator is a new feature released by Android3.0, with simple code and rich results. Property animation, as the name implies, as long as the properties can be get and set, we can use the Property animation processing. Properties and methods commonly used in property animations are as follows:
Valueanimator//A number generator that allows for many very flexible animation effectsObjectanimator//Valueanimator sub-class, the valueanimator is encapsulated, so that we can more easily use the property animation, we have to manipulate an object through Objectanimator, animation effectAnimatorlistener//Event listener for animation start, end, pause, repeat, etc. (requires rewriting four methods)Animatorlisteneradapter//an event listener for an action in the start, end, pause, or repeat of an animation (you only need to override one method depending on the action you choose)Animatorset//A collection of animations used to set the relationship between multiple animations (before, after, and so on)Propertyvaluesholder//A collection of animations, similar to AnimatorsetTypeevaluators//value Calculator, which introduces a custom Property object when using the Valueanimator.ofobject () methodInterpolators//interpolator, animating effects (speed gradient, bounce, etc.)
The development of the satellite menu is mainly used in the objectanimator. The properties commonly used in Objectanimator are as follows:
Translationx/translationy Level//RotationY Horizontal/ /ScaleY level//Y direct reach x/ Y-coordinate alpha transparency
Second, the realization of the satellite menu
To be Continued ...
The implementation of Android's satellite menu