Code example for AccelerateDecelerateInterpolator

0
     * Used to inflate the Workspace from XML. 
     * 
     * @param context The application's context. 
     * @param attrs The attributes set containing the Workspace's customization values. 
     */ 
    public Search(Context context, AttributeSet attrs) {
        super(context, attrs);
 
        final float scale = context.getResources().getDisplayMetrics().density;
        mWidgetTopOffset = Math.round(WIDGET_TOP_OFFSET * scale);
         
        Interpolator interpolator = new AccelerateDecelerateInterpolator();
 
        mMorphAnimation = new ToParentOriginAnimation();
        // no need to apply transformation before the animation starts, 
        // since the gadget is already in its normal place. 
        mMorphAnimation.setFillBefore(false);
        // stay in the top position after the animation finishes 
        mMorphAnimation.setFillAfter(true);
        mMorphAnimation.setInterpolator(interpolator);
        mMorphAnimation.setAnimationListener(new Animation.AnimationListener() {