void createVerticalSnapAnimation(boolean visible){
  float translationY=visible ? 0.0f : mTotalHeight;
  float yDifference=Math.abs(translationY - getTranslationY()) / mTotalHeight;
  long duration=(long)(MS_ANIMATION_DURATION * yDifference);
  createAnimation(1.0f,0,translationY,duration);
}

void createVerticalSnapAnimation ( boolean visible ) { float translationY = visible ? 0.0f : mTotalHeight ; float yDifference = Math . abs ( translationY - getTranslationY ( ) ) / mTotalHeight ; long duration = ( long ) ( MS_ANIMATION_DURATION * yDifference ) ; createAnimation ( 1.0f , 0 , translationY , duration ) ; }
create an animation that snaps the view into position vertically .
