Java tutorial
//package com.java2s; import android.animation.Animator; import android.animation.ObjectAnimator; import android.support.annotation.NonNull; import android.view.View; public class Main { public static Animator slide(@NonNull View view, int fromY, int toY, int time) { ObjectAnimator animatorY = ObjectAnimator.ofFloat(view, "translationY", fromY, toY); animatorY.setDuration(time); animatorY.start(); return animatorY; } }