Search in sources :

Example 1 with QuadInOut

use of no.agens.depth.lib.tween.interpolators.QuadInOut in project Depth-LIB-Android- by danielzeller.

the class TransitionHelper method introAnimate.

static ObjectAnimator introAnimate(final DepthLayout target, final float moveY, final float customElevation, long delay, int subtractDelay) {
    target.setPivotY(getDistanceToCenter(target));
    target.setPivotX(getDistanceToCenterX(target));
    target.setCameraDistance(10000 * target.getResources().getDisplayMetrics().density);
    ObjectAnimator translationY2 = ObjectAnimator.ofFloat(target, View.TRANSLATION_Y, target.getResources().getDisplayMetrics().heightPixels, -moveY * target.getResources().getDisplayMetrics().density).setDuration(800);
    translationY2.setInterpolator(new ExpoOut());
    translationY2.setStartDelay(700 + subtractDelay);
    translationY2.start();
    target.setTranslationY(target.getResources().getDisplayMetrics().heightPixels);
    ObjectAnimator translationX2 = ObjectAnimator.ofFloat(target, View.TRANSLATION_X, -target.getResources().getDisplayMetrics().widthPixels, 0).setDuration(800);
    translationX2.setInterpolator(new ExpoOut());
    translationX2.setStartDelay(700 + subtractDelay);
    translationX2.start();
    target.setTranslationX(-target.getResources().getDisplayMetrics().widthPixels);
    ObjectAnimator translationY = ObjectAnimator.ofFloat(target, View.TRANSLATION_Y, 0).setDuration(700);
    translationY.setInterpolator(new BackOut());
    translationY.setStartDelay(700 + 800);
    translationY.start();
    ObjectAnimator rotationX = ObjectAnimator.ofFloat(target, View.ROTATION_X, TARGET_ROTATION_X, 0).setDuration(1000);
    rotationX.setInterpolator(new QuintInOut());
    rotationX.setStartDelay(700 + FISRTDELAY + subtractDelay);
    rotationX.start();
    target.setRotationX(TARGET_ROTATION_X);
    ObjectAnimator elevation = ObjectAnimator.ofFloat(target, "CustomShadowElevation", customElevation * target.getResources().getDisplayMetrics().density, target.getCustomShadowElevation()).setDuration(1000);
    elevation.setInterpolator(new QuintInOut());
    elevation.setStartDelay(700 + FISRTDELAY + subtractDelay * 2);
    elevation.start();
    target.setCustomShadowElevation(customElevation * target.getResources().getDisplayMetrics().density);
    ObjectAnimator scaleX = ObjectAnimator.ofFloat(target, View.SCALE_X, TARGET_SCALE, target.getScaleX()).setDuration(1000);
    scaleX.setInterpolator(new CircInOut());
    scaleX.setStartDelay(700 + FISRTDELAY + subtractDelay);
    scaleX.start();
    target.setScaleX(TARGET_SCALE);
    ObjectAnimator scaleY = ObjectAnimator.ofFloat(target, View.SCALE_Y, TARGET_SCALE, target.getScaleY()).setDuration(1000);
    scaleY.setInterpolator(new CircInOut());
    scaleY.setStartDelay(700 + FISRTDELAY + subtractDelay);
    scaleY.start();
    target.setScaleY(TARGET_SCALE);
    ObjectAnimator rotation = ObjectAnimator.ofFloat(target, View.ROTATION, TARGET_ROTATION, 0).setDuration(1400);
    rotation.setInterpolator(new QuadInOut());
    rotation.setStartDelay(FISRTDELAY + subtractDelay);
    rotation.start();
    target.setRotation(TARGET_ROTATION);
    rotation.addListener(getShowStatusBarListener(target));
    return scaleY;
}
Also used : CircInOut(no.agens.depth.lib.tween.interpolators.CircInOut) BackOut(no.agens.depth.lib.tween.interpolators.BackOut) ObjectAnimator(android.animation.ObjectAnimator) QuintInOut(no.agens.depth.lib.tween.interpolators.QuintInOut) QuadInOut(no.agens.depth.lib.tween.interpolators.QuadInOut) ExpoOut(no.agens.depth.lib.tween.interpolators.ExpoOut)

Aggregations

ObjectAnimator (android.animation.ObjectAnimator)1 BackOut (no.agens.depth.lib.tween.interpolators.BackOut)1 CircInOut (no.agens.depth.lib.tween.interpolators.CircInOut)1 ExpoOut (no.agens.depth.lib.tween.interpolators.ExpoOut)1 QuadInOut (no.agens.depth.lib.tween.interpolators.QuadInOut)1 QuintInOut (no.agens.depth.lib.tween.interpolators.QuintInOut)1