Animation setFillAfter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Animation setFillAfter method.

This code example shows how to use the following methods:setDuration, setFillAfter, setFillEnabled, setInterpolator
			if(olddegree == 0 && newdegree == 270){
				newdegree = -90;
			} else if(olddegree == 270 && newdegree == 0){
				newdegree = 360;
			} 
			retval = new RotateAnimation(olddegree,
					newdegree,
					Animation.RELATIVE_TO_SELF,
					0.5f, 
					Animation.RELATIVE_TO_SELF,
					0.5f); 
 
			retval.setDuration(500);
			retval.setFillEnabled(true);
			retval.setFillAfter(true);
			retval.setInterpolator(new DecelerateInterpolator());
		} 
 
		return retval;
	} 
	 
8
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter, setInterpolator, setStartOffset
This code example shows how to use the following methods:setDuration, setFillAfter
			return null; 
		} 
 
		int dx = getLeft() - old_x;
		int dy = getTop() - old_y;
		Animation a = new TranslateAnimation(-dx, 0, -dy, 0);
		a.setFillAfter(true);
		a.setDuration(durationMillis);
 
		old_x = getLeft();
		old_y = getTop();
 
		return a;
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter, setStartOffset
    float sign = left ? 1f : -1f;
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.setRepeatCount(Animation.INFINITE);
    animationSet.setRepeatMode(Animation.RESTART);
 
    TranslateAnimation move = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, sign * 0.70f,
        Animation.RELATIVE_TO_PARENT, sign * -0.70f, Animation.RELATIVE_TO_PARENT, 0,
        Animation.RELATIVE_TO_PARENT, 0);
    move.setStartOffset(0);
    move.setDuration(speed);
    move.setFillAfter(true);
    animationSet.addAnimation(move);
    view.startAnimation(animationSet);
  } 
 
  /** 
   * Animates a component (using pre-defined animation kinds). 
   * 
   * @param view  component to animate 
   * @param animation  animation kind 
7
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter
	 * @param durationMillis 
	 *            �D���� 
	 */ 
	public static Animation getRotateAnimation(float fromDegrees,
			float toDegrees, int durationMillis) {
		RotateAnimation rotate = new RotateAnimation(fromDegrees, toDegrees,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
				0.5f); 
		rotate.setDuration(durationMillis);
		rotate.setFillAfter(true);
		return rotate;
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter, setFillEnabled, setRepeatCount
			} 
		} 
	} 
 
	public void startAnimation(int previous, int current) {
		Animation animation = new RotateAnimation(previous, current,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
		animation.setDuration(250);
		animation.setRepeatCount(0);
		animation.setFillAfter(true);
		animation.setFillEnabled(true);
 
		mRecordButton.startAnimation(animation);
		mPlayButton.startAnimation(animation);
	} 
	 
	public static interface AudioRecorderPlayerListener { 
		public void onAudioStatusChanged(int stated);
	} 
} 
7
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter
			return null; 
		} 
 
		int dx = getLeft() - old_x;
		int dy = getTop() - old_y;
		Animation a = new TranslateAnimation(-dx, 0, -dy, 0);
		a.setFillAfter(true);
		a.setDuration(durationMillis);
 
		old_x = getLeft();
		old_y = getTop();
 
		return a;
	} 
} 
6
CodeRank
This code example shows how to use the following methods:setDuration, setFillAfter, setStartOffset
    float sign = left ? 1f : -1f;
    AnimationSet animationSet = new AnimationSet(true);
    animationSet.setRepeatCount(Animation.INFINITE);
    animationSet.setRepeatMode(Animation.RESTART);
 
    TranslateAnimation move = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, sign * 0.70f,
        Animation.RELATIVE_TO_PARENT, sign * -0.70f, Animation.RELATIVE_TO_PARENT, 0,
        Animation.RELATIVE_TO_PARENT, 0);
    move.setStartOffset(0);
    move.setDuration(speed);
    move.setFillAfter(true);
    animationSet.addAnimation(move);
    view.startAnimation(animationSet);
  } 
 
  /** 
   * Animates a component (using pre-defined animation kinds). 
   * 
   * @param view  component to animate 
   * @param animation  animation kind 
6
CodeRank
This code example shows how to use the following methods:setAnimationListener, setDuration, setFillAfter, setInterpolator
This code example shows how to use the following methods:setDuration, setFillAfter, setInterpolator, setStartOffset
import android.view.animation.TranslateAnimation; 
 
public class Anim { 
	 
    static public Animation trans( int w, long t, double f, long offset ){
        Animation anim = new TranslateAnimation((float)w, 0, 0, 0);
        anim.setDuration(t);
        anim.setInterpolator( new DecelerateInterpolator((float)f) );
        anim.setFillAfter(true);
        anim.setStartOffset(offset);
        return anim;
    } 
     
     
    static public Animation alpha(double from, long t, double f, long offset){
    	Animation anim = new AlphaAnimation((float)from,1.0f);
    	anim.setDuration(t);
    	anim.setInterpolator( new AccelerateInterpolator((float)f) );
    	anim.setFillAfter(true);
        anim.setStartOffset(offset);
7
CodeRank

Related Animation setFillAfter Questions & Answers:

setFillAfter Method Overview
If fillAfter is true, the transformation that this animation performed will persist when it is finished.
See Code Examples for other Android Animation Methods: