Code example for TranslateAnimation

Methods: start

0
		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();
		return anim;
	} 
 
	private Animation getAlphaAnim() {
		Animation anim = new AlphaAnimation(1.0f, 0.2f);
		anim.setDuration(DURATION_ALPHA);
		return anim;
	} 
 
	private float randomDegrees() { 
		Random random = new Random();
		return MAX_DEGREES - random.nextFloat() * MAX_DEGREES * 2;