private int calculateAnimationDuration(final int diff,final float animationSpeed){
  return Math.round(Math.abs(diff) / animationSpeed);
}

private int calculateAnimationDuration ( final int diff , final float animationSpeed ) { return Math . round ( Math . abs ( diff ) / animationSpeed ) ; }
calculates the duration of the animation , which is used to hide or show the view , depending on a specific distance and speed .
