code: private List<String> processAllListeners(View rootView) {
          List<String> refinementAttributes = new ArrayList<>();
  
          // Register any AlgoliaResultsListener (unless it has a different variant than searcher)
          final List<AlgoliaResultsListener> resultListeners = LayoutViews.findByClass((ViewGroup) rootView, AlgoliaResultsListener.class);
          if (resultListeners.isEmpty()) {
              throw new IllegalStateException(Errors.LAYOUT_MISSING_RESULT_LISTENER);
          }
          for (AlgoliaResultsListener listener : resultListeners) {
              if (!this.resultListeners.contains(listener)) {
                  final String variant = BindingHelper.getVariantForView((View) listener);
                  if (variant == null || searcher.variant.equals(variant)) {
                      this.resultListeners.add(listener);
                      searcher.registerResultListener(listener);
                      prepareWidget(listener, refinementAttributes);
                  }
              }
          }
  
          // Register any AlgoliaErrorListener (unless it has a different variant than searcher)
          final List<AlgoliaErrorListener> errorListeners = LayoutViews.findByClass((ViewGroup) rootView, AlgoliaErrorListener.class);
          for (AlgoliaErrorListener listener : errorListeners) {
              if (!this.errorListeners.contains(listener)) {
                  final String variant = BindingHelper.getVariantForView((View) listener);
                  if (variant == null || searcher.variant.equals(variant)) {
                      this.errorListeners.add(listener);
                  }
              }
              searcher.registerErrorListener(listener);
              prepareWidget(listener, refinementAttributes);
          }
  
          // Register any AlgoliaSearcherListener (unless it has a different variant than searcher)
          final List<AlgoliaSearcherListener> searcherListeners = LayoutViews.findByClass((ViewGroup) rootView, AlgoliaSearcherListener.class);
          for (AlgoliaSearcherListener listener : searcherListeners) {
              final String variant = BindingHelper.getVariantForView((View) listener);
              if (variant == null || searcher.variant.equals(variant)) {
                  listener.initWithSearcher(searcher);
                  prepareWidget(listener, refinementAttributes);
              }
          }
  
          return refinementAttributes;
      }
docs: Finds and sets up the Listeners in the given rootView.
  
  @param rootView a View to traverse looking for listeners.
  @return the list of refinement attributes found on listeners.