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;
import android.view.animation.Interpolator;

public class Main {
    public static ObjectAnimator translateToastByX(View view, float x, int duration, Interpolator interpolator) {
        ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationX", x);
        objectAnimator.setDuration(duration);
        objectAnimator.setInterpolator(interpolator);
        objectAnimator.start();
        return objectAnimator;
    }
}