Example usage for android.view.animation RotateAnimation setDuration

List of usage examples for android.view.animation RotateAnimation setDuration

Introduction

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

Prototype

public void setDuration(long durationMillis) 

Source Link

Document

How long this animation should last.

Usage

From source file:Main.java

public static void btnRotate(View view) {
    RotateAnimation ra = new RotateAnimation(0, 360, 100, 100);
    ra.setDuration(1000);
    view.startAnimation(ra);/*from ww  w . j a va 2 s  .  com*/
}

From source file:Main.java

public static void counterClockwiseRotation90ByCenter(View v) {
    float w = v.getWidth();
    float h = v.getHeight();
    RotateAnimation anim = new RotateAnimation(0, 90, w / 2, h / 2);
    anim.setDuration(10 * 1);
    anim.setFillAfter(true);/*w ww .j a  va2s .c  o m*/
    v.startAnimation(anim);
}

From source file:Main.java

public static void startAnimIn(RelativeLayout view) {
    RotateAnimation ra = new RotateAnimation(180, 360, view.getWidth() / 2, view.getHeight());
    ra.setDuration(500);
    ra.setFillAfter(true);/*from   w w w .jav  a 2 s  .  c o  m*/
    view.startAnimation(ra);
}

From source file:Main.java

public static void viewShow(RelativeLayout view) {

    RotateAnimation animation = new RotateAnimation(180, 360, view.getWidth() / 2, view.getHeight());
    animation.setDuration(300);
    animation.setFillAfter(true);/*from   www . jav  a 2 s.c om*/
    view.startAnimation(animation);

}

From source file:Main.java

public static RotateAnimation getDialogRotateAnimation2() {
    RotateAnimation mAnim = new RotateAnimation(0, 360, Animation.RESTART, 0.5f, Animation.RESTART, 0.5f);
    mAnim.setDuration(2000);
    mAnim.setRepeatCount(Animation.INFINITE);
    mAnim.setRepeatMode(Animation.RESTART);
    mAnim.setStartTime(Animation.START_ON_FIRST_FRAME);
    return mAnim;
}

From source file:Main.java

public static RotateAnimation getRotateAnimation() {
    RotateAnimation ra = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    ra.setDuration(1000);
    ra.setStartOffset(0);/* w w w.ja v  a  2  s.c o  m*/
    ra.setRepeatCount(Animation.INFINITE);
    return ra;
}

From source file:Main.java

public static void rotateOutAnimation(RelativeLayout level, long i) {
    RotateAnimation animation = new RotateAnimation(0, 180, level.getWidth() / 2, level.getHeight());
    animation.setFillAfter(true);//from  ww w. ja  v  a  2 s.c  o  m
    animation.setDuration(500);
    animation.setStartOffset(i);
    level.startAnimation(animation);
}

From source file:Main.java

public static void rotateInAnimation(RelativeLayout level, long i) {
    RotateAnimation animation = new RotateAnimation(180, 360, level.getWidth() / 2, level.getHeight());
    animation.setFillAfter(true);//from ww w.  ja  va2  s  .c  o m
    animation.setDuration(500);
    animation.setStartOffset(i);
    level.startAnimation(animation);
}

From source file:Main.java

public static Animation getRotateAnimation(float from, float to, int duration) {
    RotateAnimation animation = new RotateAnimation(from, to, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setDuration(duration);
    animation.setFillAfter(true);//from   www. j a  v a  2s. co  m
    return animation;
}

From source file:Main.java

public static void rotate0to180(View view) {
    RotateAnimation rotate = new RotateAnimation(0, 180, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(ANIM);
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setFillAfter(true);/*from w  w w .jav a2s  .com*/
    view.startAnimation(rotate);
}