private ValueAnimator getAnimator(float from, float to) {

        ValueAnimator animator = ValueAnimator.ofFloat(from, to);

        animator.setDuration((long) (DEFAULT_DURATION * Math.abs(to - from)));
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                float scale = (Float) animation.getAnimatedValue();
                if (mCurrentScale != scale) {
                    mCurrentScale = scale;
                    doSetScale();
                }
            }
        });
        return animator;
    }
@param from scale
@param to   scale
@return
app/src/main/java/home/smart/fly/animations/customview/gallery/DragViewLayout.java