code: private ObjectAnimator createAnimator(final boolean hide) {
          if (initialPosition == -1.0f) {
              initialPosition = animatedView.getY();
          }
  
          float targetPosition = hide ? initialPosition - animatedView.getHeight() : initialPosition;
  
          if (direction == Direction.DOWN) {
              targetPosition = hide ? initialPosition + animatedView.getHeight() : initialPosition;
          }
  
          ObjectAnimator animation =
                  ObjectAnimator.ofFloat(animatedView, "y", animatedView.getY(), targetPosition);
          animation.setInterpolator(new AccelerateDecelerateInterpolator());
          animation.setDuration(animationDuration);
          return animation;
      }
docs: Creates and returns an animator, which allows to translate the animated view to become shown
  or hidden.
  
  @param hide
  True, if the view should become hidden, false otherwise
  @return The animator, which has been created, as an instance of the class {@link
  ObjectAnimator}