code: private RecyclerView.OnScrollListener createScrollListener() {
          return new RecyclerView.OnScrollListener() {
  
              /**
               * True, if the view is currently scrolling up, false otherwise.
               */
              private boolean scrollingUp;
  
              @Override
              public void onScrollStateChanged(final RecyclerView recyclerView, final int newState) {
  
              }
  
              @Override
              public void onScrolled(final RecyclerView recyclerView, final int dx, final int dy) {
                  boolean isScrollingUp = dy < 0;
  
                  if (scrollingUp != isScrollingUp) {
                      scrollingUp = isScrollingUp;
  
                      if (scrollingUp) {
                          floatingActionButton.show();
                      } else {
                          floatingActionButton.hide();
                      }
                  }
              }
  
          };
      }
docs: Creates and returns a listener, which allows to hide or show the activity's floating action
  button, when the preferences, which are shown by the activity's fragment, are scrolled.
  
  @return The listener, which has been created, as an instance of the type {@link
  RecyclerView.OnScrollListener}