code: public boolean addOnPageSelectedListener(OnPageSelectedListener listener) {
          final boolean added;
          synchronized (mListeners) {
              added = mListeners.add(listener);
          }
          if (added) {
              listener.onPageSelected(mCurrentPage);
          }
          return added;
      }
docs: Add {@link OnPageSelectedListener Page selection listener}
  @param listener
  @return true if listener has been added successfully