Code example for AnimationSet

Methods: addAnimationsetFillAftersetFillBefore

0
		return animeSet;
	} 
 
	public static AnimationSet leftAnimation(View v, int duration,
			boolean reverse) {
		AnimationSet animeSet = new AnimationSet(true);
 
		ScaleAnimation scale = new ScaleAnimation(1.4f, 1.4f, 1.4f, 1.4f,
				ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
				ScaleAnimation.RELATIVE_TO_SELF, 0.2f);
		scale.setDuration(0);
		animeSet.addAnimation(scale);
 
		TranslateAnimation tr = new TranslateAnimation(0, 0, 10, 10);
		tr.setDuration(0);
		animeSet.addAnimation(tr);
 
		AlphaAnimation alpha = new AlphaAnimation(1.0f, 1.0f);
		alpha.setDuration(0);
		animeSet.addAnimation(alpha);
 
		Rotate3dAnimation rotation;
		if (reverse) {
			rotation = new Rotate3dAnimation(100, 0, v.getWidth(), v
					.getHeight() / 2, 0f, true);
		} else { 
			rotation = new Rotate3dAnimation(0, 100, v.getWidth(), v
					.getHeight() / 2, 0f, true);
		} 
		rotation.setDuration(duration);
		animeSet.addAnimation(rotation);
 
		animeSet.setFillAfter(true);
		animeSet.setFillBefore(true);
 
		return animeSet;
	} 
 
	public static AnimationSet rightAnimation(View v, int duration, int mode) {
Stop searching for code, let great code find you!  Add Codota to your java IDE