Code example for RotateAnimation

Methods: setDurationsetFillAfterstart

0
		anim.setFillAfter(true);
		return anim;
	} 
 
	private Animation getRotateAnim(final float degrees) {
		Animation anim = new RotateAnimation(0f, degrees,
				Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
				1.0f); 
		anim.setDuration(DURATION_ROTATE);
		anim.setFillAfter(true);
		anim.start();
		return anim;
	} 
 
	private Animation getTranslateAnim(final float degrees) {
		double dis = Math.tan(degrees * Math.PI / 180) * 100;
		Animation anim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f,
				Animation.ABSOLUTE, (float) dis, Animation.RELATIVE_TO_PARENT,
				0f, Animation.ABSOLUTE, -70);
		anim.start();
Contextual code suggestions in your IDE  Get Codota for Java