Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.view.View;

import android.view.animation.Animation;

import android.view.animation.TranslateAnimation;

public class Main {

    public static void startTranslationAnimation(View view) {
        TranslateAnimation translateAnimation = new TranslateAnimation(-50f, 50f, 0, 0);
        translateAnimation.setDuration(1000);
        translateAnimation.setRepeatCount(Animation.INFINITE);
        translateAnimation.setRepeatMode(Animation.REVERSE);
        view.setAnimation(translateAnimation);
        translateAnimation.start();
    }
}