Code example for AnimationSet

Methods: addAnimation, setAnimationListener, setInterpolator, setRepeatCount, setRepeatMode

0
			public void resume() { 
				mPaused = false;
			} 
		} 
		try { 
			AnimationSet set = new AnimationSet(true);
			set.setInterpolator(new LinearInterpolator());
			final AnimationSet set2 = new AnimationSet(true);
			set.setInterpolator(new LinearInterpolator());
			AnimationSet set3 = new AnimationSet(true);
			set.setInterpolator(new LinearInterpolator());
			AnimationSet set4 = new AnimationSet(true);
			set.setInterpolator(new LinearInterpolator());
 
			TranslateAnim ta1 = new TranslateAnim(0, 0, -140, 300);
			ta1.setDuration(2000);
			TranslateAnim ta2 = new TranslateAnim(0, 0, -140, 300);
			ta2.setDuration(2000);
			ta2.setStartOffset(500);
			TranslateAnim ta3 = new TranslateAnim(0, 0, -140, 300);
			ta3.setDuration(2000);
			ta3.setStartOffset(500);
			TranslateAnim ta4 = new TranslateAnim(0, 0, -140, 300);
			ta4.setDuration(2000);
			ta4.setStartOffset(500);
 
			set.addAnimation(ta1);
			set2.addAnimation(ta2);
			set3.addAnimation(ta3);
			set4.addAnimation(ta4);
			// set.setFillAfter(false); 
			// set2.setFillAfter(false); 
			// set3.setFillAfter(false); 
			// set4.setFillAfter(false); 
			set.setRepeatCount(Animation.INFINITE);
			set2.setRepeatCount(Animation.INFINITE);
			set3.setRepeatCount(Animation.INFINITE);
			set4.setRepeatCount(Animation.INFINITE);
			set.setRepeatMode(Animation.RESTART);
			set2.setRepeatMode(Animation.RESTART);
			set3.setRepeatMode(Animation.RESTART);
			set4.setRepeatMode(Animation.RESTART);
 
			set.setAnimationListener(new AnimationListener() {
 
				@Override 
				public void onAnimationEnd(Animation arg0) {
					// TODO Auto-generated method stub 
					set2.startNow();