Code example for Animation

Methods: getDuration

            public void onAnimationEnd(Animation animation) { }
            public void onAnimationRepeat(Animation animation) { }
            public void onAnimationStart(Animation animation) {
                // Make the search dialog show up ideally *just* as the animation reaches 
                // the top, to aid the illusion that the widget becomes the search dialog. 
                // Otherwise, there is a short delay when the widget reaches the top before 
                // the search dialog shows. We do this roughly 80ms before the animation ends. 
                        Math.max(mMorphAnimation.getDuration() - TIME_BEFORE_ANIMATION_END, 0));
        mUnmorphAnimation = new FromParentOriginAnimation();
        // stay in the top position until the animation starts 
        // no need to apply transformation after the animation finishes, 
        // since the gadget is now back in its normal place.