Code example for Animation

Methods: startAnimationsetAnimationListenersetDurationsetFillAftersetFillEnabled

0
	public void toggleSidebar () { 
		if (this.getHostView().getAnimation() != null) return;
 
		if (this.sidebarOpen) {
			this.animation = new TranslateAnimation(0, this.sidebarWidth, 0, 0);
			this.animation.setAnimationListener(this.closeListener);
		} 
		else { 
			this.animation = new TranslateAnimation(0, -this.sidebarWidth, 0, 0);
			this.animation.setAnimationListener(this.openListener);
		} 
		this.animation.setDuration(SLIDE_DURATION);
		this.animation.setFillAfter(true);
		this.animation.setFillEnabled(true);
		this.getHostView().startAnimation(this.animation);
	} 
 
	public boolean openSidebar () { 
		if (!this.sidebarOpen) {
			toggleSidebar(); 
Stop searching for code, let great code find you!  Add Codota to your java IDE