Code example for RelativeLayout

Methods: getLeftstartAnimation

0
	 */ 
	protected void closeAnimated(final float startingOffset, final long duration, final StateChangedListener completedListener) {
		animating = true;
		ThreadingUtils.runOnUIThread(this, new Runnable() {
			public void run() { 
				final float currPosition = childLayout.getLeft();
				final float destinationOffset = -currPosition;
				TranslateAnimation translateAnimation = new TranslateAnimation(startingOffset - currPosition, destinationOffset, 0, 0);
				translateAnimation.setDuration(duration);
				translateAnimation.setFillAfter(false);
				translateAnimation.setAnimationListener(new AnimationListener() {
					public void onAnimationStart(Animation animation) { }
 
					public void onAnimationRepeat(Animation animation) {						
					} 
 
					public void onAnimationEnd(Animation animation) {
						animating = false;
						close(); 
						if (completedListener != null) completedListener.onStateChanged(false);			
					} 
				}); 
				childLayout.startAnimation(translateAnimation);
			} 
		}); 
	}	 
	 
	/** 
Connect your IDE to all the code out there  Get Codota for Java