Code example for AnimationSet

Methods: addAnimation, setDuration, setFillBefore, setInterpolator

0
			txt.startAnimation(animSet);
		} 
	} 
	private AnimationSet getAnimationSet(int[] xy, int xCenter, int yCenter,
			int type) {
		AnimationSet animSet = new AnimationSet(true);
		animSet.setInterpolator(interpolator);
		if(type == OUTSIDE_TO_LOCATION){
			animSet.addAnimation(animAlpha2Opaque);
			animSet.addAnimation(animScaleLarge2Normal);
			TranslateAnimation translate = new TranslateAnimation(
					(xy[IDX_X] +(xy[IDX_TXT_LENGTH]>>1)-xCenter)<<1, 0, (xy[IDX_Y] -yCenter)<<1, 0);
			animSet.addAnimation(translate);
		}else if (type == LOCATION_TO_OUTSIDE){
			animSet.addAnimation(animAlpha2Transparent);
			animSet.addAnimation(animScaleNormal2Large);
			TranslateAnimation translate = new TranslateAnimation(
					0, (xy[IDX_X] +(xy[IDX_TXT_LENGTH]>>1)-xCenter)<<1, 0, (xy[IDX_Y] -yCenter)<<1);
			animSet.addAnimation(translate);
		}else if (type == LOCATION_TO_CENTER){
			animSet.addAnimation(animAlpha2Transparent);
			animSet.addAnimation(animScaleNormal2Zero);
			TranslateAnimation translate = new TranslateAnimation(
					0, xCenter - xy[IDX_X], 0, yCenter - xy[IDX_Y]);
			animSet.addAnimation(translate);
		}else if (type == CENTER_TO_LOCATION){
			animSet.addAnimation(animAlpha2Opaque);
			animSet.addAnimation(animScaleZero2Normal);
			TranslateAnimation tranlate = new TranslateAnimation(
					xCenter - xy[IDX_X], 0, yCenter - xy[IDX_Y], 0);
			animSet.addAnimation(tranlate);
		} 
		animSet.setDuration(animDuration);
		animSet.setFillBefore(true);
		return animSet;
	} 
	private void sortXYList(LinkedList<TextView> listTxt, int endIdx) {
		for (int i = 0; i < endIdx; i++) {
			for (int k = i+1; k < endIdx; k++) {