Example usage for android.view.animation RotateAnimation RotateAnimation

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

Introduction

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

Prototype

public RotateAnimation(float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType,
        float pivotYValue) 

Source Link

Document

Constructor to use when building a RotateAnimation from code

Usage

From source file:Main.java

public static void btnRotateSelf(View view) {
    RotateAnimation ra = new RotateAnimation(0, 360, RotateAnimation.RELATIVE_TO_SELF, 0.5F,
            RotateAnimation.RELATIVE_TO_SELF, 0.5F);
    ra.setDuration(1000);/*from w w  w  . j a va  2s  .  co  m*/
    view.startAnimation(ra);
}

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);/*w  w w .j a  v  a2s .  c  om*/
    ra.setStartOffset(0);
    ra.setRepeatCount(Animation.INFINITE);
    return ra;
}

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);/*  w  w  w . ja  v  a 2s. c om*/
    mAnim.setRepeatCount(Animation.INFINITE);
    mAnim.setRepeatMode(Animation.RESTART);
    mAnim.setStartTime(Animation.START_ON_FIRST_FRAME);
    return mAnim;
}

From source file:Main.java

public static void rotateAnimation(View view, float fromDegree, float toDegree) {
    final RotateAnimation rotateAnim = new RotateAnimation(fromDegree, toDegree,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);

    rotateAnim.setDuration(200);//w  w  w.  ja va 2s .com
    rotateAnim.setFillAfter(true);
    view.startAnimation(rotateAnim);
}

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);/*  ww  w  .  j a  v a 2  s.c  om*/
    animation.setFillAfter(true);
    return animation;
}

From source file:Main.java

private static RotateAnimation generateNormalRotate(float fromDegrees, float toDegrees) {
    RotateAnimation anim = new RotateAnimation(fromDegrees, toDegrees, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    anim.setDuration(350);/*www .  j  a  v  a 2 s. c om*/
    anim.setFillAfter(true);
    return anim;
}

From source file:Main.java

public static Animation rotationAnimation() {
    final RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(600);//from w  w w.java2  s.  co  m
    rotate.setRepeatMode(Animation.RESTART);
    rotate.setRepeatCount(Animation.INFINITE);
    return rotate;

}

From source file:Main.java

public static Animation getRotateAnimation(float fromDegrees, float toDegrees, long durationMillis) {
    RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(durationMillis);// ww w. j  av a 2s .  com
    rotate.setFillAfter(true);
    return rotate;
}

From source file:Main.java

public static Animation getRotateAnimation() {
    final RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, .5f,
            Animation.RELATIVE_TO_SELF, .5f);
    rotateAnimation.setDuration(1500);/*from  ww w  .ja  va2 s  .c o  m*/
    rotateAnimation.setInterpolator(new LinearInterpolator());
    rotateAnimation.setRepeatCount(Animation.INFINITE);
    return rotateAnimation;
}

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);/*www . ja v a 2  s. c  o m*/
    rotate.setInterpolator(new LinearInterpolator());
    rotate.setFillAfter(true);
    view.startAnimation(rotate);
}