Code example for LinearLayout

Methods: getHeight, getTop

0
	} 
 
	private void bounceBackHeader(){ 
		int yTranslate = state == State.REFRESHING ?
				header.getHeight() - headerContainer.getHeight() :
					-headerContainer.getHeight() - headerContainer.getTop();
 
				bounceAnimation = new TranslateAnimation(
						TranslateAnimation.ABSOLUTE, 0,
						TranslateAnimation.ABSOLUTE, 0,
						TranslateAnimation.ABSOLUTE, 0,
						TranslateAnimation.ABSOLUTE, yTranslate);
 
				bounceAnimation.setDuration(BOUNCE_ANIMATION_DURATION);
				bounceAnimation.setFillEnabled(true);
				bounceAnimation.setFillAfter(false);
				bounceAnimation.setFillBefore(true);
				//bounceAnimation.setInterpolator(new OvershootInterpolator(BOUNCE_OVERSHOOT_TENSION)); 
				bounceAnimation.setAnimationListener(new HeaderAnimationListener(yTranslate));
				startAnimation(bounceAnimation);
	}