Example usage for android.view.animation TranslateAnimation TranslateAnimation

List of usage examples for android.view.animation TranslateAnimation TranslateAnimation

Introduction

In this page you can find the example usage for android.view.animation TranslateAnimation TranslateAnimation.

Prototype

public TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta) 

Source Link

Document

Constructor to use when building a TranslateAnimation from code

Usage

From source file:Main.java

public static void btnTranslate(View view) {
    TranslateAnimation ta = new TranslateAnimation(0, 200, 0, 300);
    ta.setDuration(1000);//from www  .jav  a2  s.c o m
    view.startAnimation(ta);
}

From source file:Main.java

public static Animation picInAnimation() {
    Animation animation = new TranslateAnimation(10, 200, 10, 400);
    animation.setDuration(2000);//from w ww.  j  a  v  a2  s .co  m
    animation.setRepeatCount(1);
    return animation;
}

From source file:Main.java

public static void animSlideOutFromTop(final View view) {
    TranslateAnimation animate = new TranslateAnimation(0, 0, 0, view.getHeight());
    animate.setDuration(400);//from   w  w w  .j  a  va  2s .  co  m
    animate.setFillAfter(true);
    view.startAnimation(animate);
    view.setVisibility(View.GONE);
}

From source file:Main.java

public static void animSlideOutFromBottom(final View view) {
    TranslateAnimation animate = new TranslateAnimation(0, 0, 0, -view.getHeight());
    animate.setDuration(500);/*from   w w w . ja v  a 2  s. c om*/
    animate.setFillAfter(true);
    view.startAnimation(animate);
    view.setVisibility(View.GONE);
}

From source file:Main.java

public static Animation inFromBottomToTopAnimation() {
    Animation surfaceGrowingAnimation = new TranslateAnimation(0, 0, 100, Animation.ZORDER_TOP);
    surfaceGrowingAnimation.setDuration(500);
    return surfaceGrowingAnimation;
}

From source file:Main.java

public static TranslateAnimation translate(int startX, int endX, int startY, int endY, int time) {
    TranslateAnimation translateAnimation = new TranslateAnimation(startX, endX, startY, endY);
    translateAnimation.setDuration(time);
    return translateAnimation;
}

From source file:Main.java

public static void moveFrontBg(View v, int startX, int toX, int startY, int toY) {
    TranslateAnimation anim = new TranslateAnimation(startX, toX, startY, toY);
    anim.setDuration(250);/*from   w  w  w  . j a  v  a2 s. c o m*/
    anim.setFillAfter(true);
    v.startAnimation(anim);
}

From source file:Main.java

public static void SetImageSlide(View v, int startX, int toX, int startY, int toY) {
    TranslateAnimation anim = new TranslateAnimation(startX, toX, startY, toY);
    anim.setDuration(200);// ww w  .ja v  a  2  s  . c  o m
    anim.setFillAfter(true);
    v.startAnimation(anim);
}

From source file:Main.java

public static void twoPoint(ImageView imageview, float f, float f1, int i, int j) {
    TranslateAnimation translateanimation = new TranslateAnimation(0.0F, f, 0.0F, f1);
    translateanimation.setFillAfter(true);
    translateanimation.setDuration(j);/*from  ww w.  ja  va 2s .co  m*/
    imageview.startAnimation(translateanimation);
}

From source file:Main.java

public static void setImageSlide(View v, int startX, int toX, int startY, int toY) {
    TranslateAnimation anim = new TranslateAnimation(startX, toX, startY, toY);
    anim.setDuration(100);/*from  ww  w  .  ja va 2  s.  c o m*/
    anim.setFillAfter(true);
    v.startAnimation(anim);
}