Code example for AnimationSet

Methods: setAnimationsetAnimationListenerstartNowaddAnimationsetDuration

0
			anim.setDuration(500);
			anim.startNow();
		} else if (!visible && mStates[menu] != STATE_OUT) {
			mStates[menu] = STATE_OUT;
 
			AnimationSet anim = new AnimationSet(true);
			anim.addAnimation(new AlphaAnimation(1f, 0f));
			if (fadeRight) {
				anim.addAnimation(new TranslateAnimation(0f, 100f, 0f, 0f));
			} else { 
				anim.addAnimation(new TranslateAnimation(0f, -100f, 0f, 0f));
			} 
 
			mMenus[menu].setAnimation(anim);
			anim.setDuration(500);
			anim.setAnimationListener(new Animation.AnimationListener() {
				@Override 
				public void onAnimationEnd(Animation anim) {
					mMenus[menu].setVisibility(View.GONE);
				} 
 
				@Override 
				public void onAnimationRepeat(Animation anim) {
				} 
 
				@Override 
				public void onAnimationStart(Animation anim) {
				} 
			}); 
			anim.startNow();
			mMenus[menu].invalidate();
		} 
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java