Search in sources :

Example 1 with DepthLayout

use of no.agens.depth.lib.DepthLayout in project Depth-LIB-Android- by danielzeller.

the class TransitionHelper method startRevertFromMenu.

public static void startRevertFromMenu(View root, AnimatorListenerAdapter animatorListenerAdapter) {
    revertFromMenu((DepthLayout) root.findViewById(R.id.root_dl), 30f, 10, 0);
    revertFromMenu((DepthLayout) root.findViewById(R.id.appbar), 20f, 0, 0);
    revertFromMenu((DepthLayout) root.findViewById(R.id.fab_container), 20f, 20, 6);
    revertFromMenu((DepthLayout) root.findViewById(R.id.dl2), 20f, 30, 1);
    revertFromMenu((DepthLayout) root.findViewById(R.id.dl3), 20f, 40, 2).addListener(animatorListenerAdapter);
    ObjectAnimator translationY = ObjectAnimator.ofFloat(root, View.TRANSLATION_Y, 0).setDuration(DURATION);
    translationY.setInterpolator(new QuintInOut());
    translationY.start();
}
Also used : DepthLayout(no.agens.depth.lib.DepthLayout) ObjectAnimator(android.animation.ObjectAnimator) QuintInOut(no.agens.depth.lib.tween.interpolators.QuintInOut)

Example 2 with DepthLayout

use of no.agens.depth.lib.DepthLayout in project Depth-LIB-Android- by danielzeller.

the class TransitionHelper method animateToMenuState.

public static void animateToMenuState(View root, AnimatorListenerAdapter onMenuAnimFinished) {
    hideStatusBar(root);
    exitAnimate((DepthLayout) root.findViewById(R.id.root_dl), 0, 30f, 15, 190, false);
    exitAnimate((DepthLayout) root.findViewById(R.id.appbar), MOVE_Y_STEP, 20f, 30, 170, false);
    exitAnimate((DepthLayout) root.findViewById(R.id.fab_container), MOVE_Y_STEP * 2f, 20f, 45, 210, false);
    exitAnimate((DepthLayout) root.findViewById(R.id.dl2), MOVE_Y_STEP, 20f, 60, 230, false);
    exitAnimate((DepthLayout) root.findViewById(R.id.dl3), MOVE_Y_STEP * 2, 20f, 75, 250, false).addListener(onMenuAnimFinished);
    ObjectAnimator translationY = ObjectAnimator.ofFloat(root, View.TRANSLATION_Y, -90f * root.getResources().getDisplayMetrics().density).setDuration(DURATION);
    translationY.setInterpolator(VALUEinterpolator);
    translationY.start();
}
Also used : DepthLayout(no.agens.depth.lib.DepthLayout) ObjectAnimator(android.animation.ObjectAnimator)

Aggregations

ObjectAnimator (android.animation.ObjectAnimator)2 DepthLayout (no.agens.depth.lib.DepthLayout)2 QuintInOut (no.agens.depth.lib.tween.interpolators.QuintInOut)1