Code example for TranslateAnimation

Methods: setAnimationListener, setDuration, setFillAfter

0
		invalidate();
		return params.leftMargin;
	} 
 
	public void slideview(final float p1, final float p2) {
		TranslateAnimation anim = new TranslateAnimation(p1, p2, 0, 0);
		anim.setDuration(425);
		anim.setFillAfter(true);
		anim.setAnimationListener(new AnimationListener() {
 
			@Override 
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub 
 
			} 
 
			@Override 
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub 
 
			}