Code example for Animation

Methods: getDuration

0
                // 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. 
                getHandler().postDelayed(
                        mShowSearchDialogRunnable,
                        Math.max(mMorphAnimation.getDuration() - TIME_BEFORE_ANIMATION_END, 0));
            } 
        }); 
 
        mUnmorphAnimation = new FromParentOriginAnimation();
        // stay in the top position until the animation starts 
        mUnmorphAnimation.setFillBefore(true);
        // no need to apply transformation after the animation finishes, 
        // since the gadget is now back in its normal place. 
        mUnmorphAnimation.setFillAfter(false);
        mUnmorphAnimation.setInterpolator(interpolator);
        mUnmorphAnimation.setAnimationListener(new Animation.AnimationListener(){
            public void onAnimationEnd(Animation animation) {
                clearAnimation(); 
            } 
            public void onAnimationRepeat(Animation animation) { }