Code example for AlphaAnimation

Methods: setAnimationListenersetDurationsetStartOffset

0
	} 
	 
	protected void initAnimations() { 
		fadeIn = new AlphaAnimation(0, 1);
		fadeIn.setDuration(fadeInTime);
		fadeOut = new AlphaAnimation(1, 0);
		fadeOut.setStartOffset(stickTime);
		fadeOut.setDuration(fadeOutTime);
		 
		fadeIn.setAnimationListener(new AnimationListener() {
			 
			@Override 
			public void onAnimationStart(Animation animation) {
				View view = getCurrentView();
				view.setVisibility(View.VISIBLE);
			} 
			 
			@Override 
			public void onAnimationRepeat(Animation animation) {}
			 
			@Override 
			public void onAnimationEnd(Animation animation) {
				View view = getCurrentView();
				view.startAnimation(fadeOut);
			} 
		}); 
		 
		fadeOut.setAnimationListener(new AnimationListener() {
			 
			@Override 
			public void onAnimationStart(Animation animation) {}
			 
			@Override 
Stop searching for code, let great code find you!  Add Codota to your java IDE