Android: how to use ValueAnimator

If you really, really, really want to use ValueAnimator for animating translation of the View you can do it this way (finishing your example, assuming you meant translationX; bare in mind that you’re animating translation from 0px to 3px, so you probably won’t see much difference):

public static void move(final TextView view){
    ValueAnimator va = ValueAnimator.ofFloat(0f, 3f);
    int mDuration = 3000; //in millis
    va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        public void onAnimationUpdate(ValueAnimator animation) {

ValueAnimator is a great tool for making animations. Usually we have two steps:

Step 1- Create your ValueAnimator class by

ValueAnimator animator = ValueAnimator.ofFloat(start value, end value);

Step 2- Adding one update listener and overriding at least onAnimationUpdate() function

animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            float value = (float) animator.getAnimatedValue();

            //this value should be used to update properties of views.
            //just don't forget to run invalidate function of your views 
              // to redraw them.