Java tutorial
//package com.java2s; import android.animation.ObjectAnimator; import android.view.View; import android.view.animation.Interpolator; public class Main { public static ObjectAnimator translateToastByY(View view, float y, int duration, Interpolator interpolator) { ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationY", y); objectAnimator.setDuration(duration); objectAnimator.setInterpolator(interpolator); objectAnimator.start(); return objectAnimator; } }