Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.animation.ObjectAnimator;
import android.view.View;

public class Main {
    private static final String TRANSLATION_Y = "translationY";

    public static ObjectAnimator tranY(View view, int duration, float pos) {
        float currentY = view.getTranslationY();
        ObjectAnimator animator = ObjectAnimator.ofFloat(view, TRANSLATION_Y, pos, currentY);
        return animator.setDuration(duration);
    }
}