Example usage for android.view ViewGroup setTranslationY

List of usage examples for android.view ViewGroup setTranslationY

Introduction

In this page you can find the example usage for android.view ViewGroup setTranslationY.

Prototype

public void setTranslationY(float translationY) 

Source Link

Document

Sets the vertical location of this view relative to its #getTop() top position.

Usage

From source file:io.digibyte.tools.animation.BRAnimator.java

public static void animateSignalSlide(ViewGroup signalLayout, final boolean reverse,
        final OnSlideAnimationEnd listener) {
    float translationY = signalLayout.getTranslationY();
    float signalHeight = signalLayout.getHeight();
    signalLayout.setTranslationY(reverse ? translationY : translationY + signalHeight);

    signalLayout.animate().translationY(reverse ? BreadActivity.screenParametersPoint.y : translationY)
            .setDuration(SLIDE_ANIMATION_DURATION)
            .setInterpolator(reverse ? new DecelerateInterpolator() : new OvershootInterpolator(0.7f))
            .setListener(new AnimatorListenerAdapter() {
                @Override/*from  w ww .ja  v  a 2s. c om*/
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);
                    if (listener != null)
                        listener.onAnimationEnd();
                }
            });

}