Code example for AccelerateDecelerateInterpolator

     * 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. 
        // stay in the top position after the animation finishes 
Experience pair programming with AI  Get Codota for Java