We need the ListView to be able to modify it's OnTouchListener

@param listView the ListView to which the adapter will be attached
@return A reference to the current instance so that commands can be chained
555646
public SwipeActionAdapter setListView(ListView listView){
        this.mListView = listView;
        mTouchListener = new SwipeActionTouchListener(listView,this);
        this.mListView.setOnTouchListener(mTouchListener);
        this.mListView.setOnScrollListener(mTouchListener.makeScrollListener());
        this.mListView.setClipChildren(false);
        mTouchListener.setFadeOut(mFadeOut);
        mTouchListener.setDimBackgrounds(mDimBackgrounds);
        mTouchListener.setFixedBackgrounds(mFixedBackgrounds);
        mTouchListener.setNormalSwipeFraction(mNormalSwipeFraction);
        mTouchListener.setFarSwipeFraction(mFarSwipeFraction);
        return this;
    }
1270726
public static <T> MatrixCursor getCursor(final List<T> list) {
        if (list == null || list.isEmpty())
            return new MatrixCursor(new String[] { "_id" });

        final String[] titles = getFieldTitlesFromObject(list.get(0));

        final MatrixCursor cursor = new MatrixCursor(titles);

        try {
            addFieldValuesFromList(cursor, list);
        } catch (final IllegalAccessException e) {
            Logger.ex(e);
        }

        return cursor;
    }
1035480
private void setClickListener(View view) {
    if (view.getId() == INVALID) {
      return;
    }
    //adapterview does not support click listener
    if (view instanceof AdapterView) {
      return;
    }

    view.setOnClickListener(new View.OnClickListener() {
      @Override public void onClick(View v) {
        if (onClickListener == null) {
          return;
        }
        onClickListener.onClick(DialogPlus.this, v);
      }
    });
  }
503624
private boolean findListView(@NonNull final View view) {
        if (view instanceof AbsListView) {
            this.listView = (AbsListView) view;
            this.listView.setOnScrollListener(createListViewScrollListener());
            return true;
        } else if (view instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) view;

            for (int i = 0; i < viewGroup.getChildCount(); i++) {
                if (findListView(viewGroup.getChildAt(i))) {
                    return true;
                }
            }
        }

        return false;
    }
1277155
public T itemClicked(AdapterView.OnItemClickListener listener) {

        if (view instanceof AdapterView) {

            AdapterView<?> alv = (AdapterView<?>) view;
            alv.setOnItemClickListener(listener);

        }

        return self();

    }
727835
public void setOnHeadViewBindViewHolderListener(FamiliarRecyclerView.OnHeadViewBindViewHolderListener onHeadViewBindViewHolderListener) {
        if (null != mWrapFamiliarRecyclerViewAdapter) {
            mWrapFamiliarRecyclerViewAdapter.setOnHeadViewBindViewHolderListener(onHeadViewBindViewHolderListener);
        } else {
            mTempOnHeadViewBindViewHolderListener = onHeadViewBindViewHolderListener;
        }
    }
813503
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    public static void detach(Activity activity, ViewTreeObserver.OnGlobalLayoutListener l) {
        ViewGroup contentView = activity.findViewById(android.R.id.content);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            contentView.getViewTreeObserver().removeOnGlobalLayoutListener(l);
        } else {
            //noinspection deprecation
            contentView.getViewTreeObserver().removeGlobalOnLayoutListener(l);
        }
    }
1140790
public LinearLayoutManager asVerticalListView() {
        this.presentation = PeasyPresentation.VerticalList;
        resetItemDecorations();
        resetItemAnimator();
        final LinearLayoutManager layoutManager = PeasyRecyclerView.VerticalList.newLayoutManager(getContext());
        getRecyclerView().setLayoutManager(layoutManager);
        getRecyclerView().addItemDecoration(new DividerItemDecoration(getContext(), layoutManager.getOrientation()));
        getRecyclerView().setItemAnimator(new DefaultItemAnimator());
        return layoutManager;
    }
749871
public final synchronized void addListener(EventListener l) {
        if(l ==null) {
            throw new IllegalArgumentException("Listener " + l +
                                               " is null");
        }
        if(listeners == EMPTY_LISTENERS) {
            listeners = new EventListener[1];
            listeners[0] = l;
        }
        else {
            int i = listeners.length;
            EventListener[] tmp = new EventListener[i+1];
            System.arraycopy(listeners, 0, tmp, 0, i);

            tmp[i] = l;
            listeners = tmp;
        }
    }
1116270
public DrawerBuilder withAdapter(@NonNull FastAdapter<IDrawerItem> adapter) {
        this.mAdapter = adapter;
        //we have to rewrap as a different FastAdapter was provided
        adapter.addAdapter(0, mHeaderAdapter);
        adapter.addAdapter(1, mItemAdapter);
        adapter.addAdapter(2, mFooterAdapter);
        adapter.addExtension(mExpandableExtension);
        return this;
    }
155984
public T doubleTap(final GestureDetector.OnDoubleTapListener listener) {
        if (view != null) {
            final GestureDetector detector = new GestureDetector(view.getContext(),
                    new GestureDetector.SimpleOnGestureListener());
            detector.setOnDoubleTapListener(listener);
            view.setOnTouchListener(new View.OnTouchListener() {

                @Override
                public boolean onTouch(View v, MotionEvent event) {
                    return detector.onTouchEvent(event);
                }
            });
        }
        return self();
    }
926966
private View createView(LayoutInflater inflater, @Nullable View headerView, boolean fixedHeader,
                          @Nullable View footerView, boolean fixedFooter, BaseAdapter adapter) {
    View view = holder.getView(inflater, rootView);

    if (holder instanceof ViewHolder) {
      assignClickListenerRecursively(view);
    }

    if (headerView != null) {
      assignClickListenerRecursively(headerView);
      holder.addHeader(headerView, fixedHeader);
    }

    if (footerView != null) {
      assignClickListenerRecursively(footerView);
      holder.addFooter(footerView, fixedFooter);
    }

    if (adapter != null && holder instanceof HolderAdapter) {
      HolderAdapter holderAdapter = (HolderAdapter) holder;
      holderAdapter.setAdapter(adapter);
      holderAdapter.setOnItemClickListener(new OnHolderListener() {
        @Override public void onItemClick(@NonNull Object item, @NonNull View view, int position) {
          if (onItemClickListener == null) {
            return;
          }
          onItemClickListener.onItemClick(DialogPlus.this, item, view, position);
        }
      });
    }
    return view;
  }
487589
public RadioBoxList<V> addListener(Listener listener) {
        if(listener != null && !listeners.contains(listener)) {
            listeners.add(listener);
        }
        return this;
    }
898866
public View.OnLongClickListener getOnLongClickListener(boolean adapterHasListener) {
        if (isLongClickable() && adapterHasListener) {
            if (mViewHolderLongClickListener == null) {
                mViewHolderLongClickListener = new ViewHolderLongClickListener<>(this);
            }
        } else {
            mViewHolderLongClickListener = null;
        }
        return mViewHolderLongClickListener;
    }
1319303
public static <Item extends IItem> void attachToView(final EventHook<Item> event, final RecyclerView.ViewHolder viewHolder, View view) {
        if (event instanceof ClickEventHook) {
            view.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    //get the adapter for this view
                    Object tagAdapter = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
                    if (tagAdapter instanceof FastAdapter) {
                        FastAdapter<Item> adapter = (FastAdapter<Item>) tagAdapter;
                        //we get the adapterPosition from the viewHolder
                        int pos = adapter.getHolderAdapterPosition(viewHolder);
                        //make sure the click was done on a valid item
                        if (pos != RecyclerView.NO_POSITION) {
                            Item item = adapter.getItem(pos);
                            if (item != null) {
                                //we update our item with the changed property
                                ((ClickEventHook<Item>) event).onClick(v, pos, adapter, item);
                            }
                        }
                    }
                }
            });
        } else if (event instanceof LongClickEventHook) {
            view.setOnLongClickListener(new View.OnLongClickListener() {
                @Override
                public boolean onLongClick(View v) {
                    //get the adapter for this view
                    Object tagAdapter = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
                    if (tagAdapter instanceof FastAdapter) {
                        FastAdapter<Item> adapter = (FastAdapter<Item>) tagAdapter;
                        //we get the adapterPosition from the viewHolder
                        int pos = adapter.getHolderAdapterPosition(viewHolder);
                        //make sure the click was done on a valid item
                        if (pos != RecyclerView.NO_POSITION) {
                            Item item = adapter.getItem(pos);
                            if (item != null) {
                                //we update our item with the changed property
                                return ((LongClickEventHook<Item>) event).onLongClick(v, pos, adapter, item);
                            }
                        }
                    }
                    return false;
                }
            });
        } else if (event instanceof TouchEventHook) {
            view.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent e) {
                    //get the adapter for this view
                    Object tagAdapter = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
                    if (tagAdapter instanceof FastAdapter) {
                        FastAdapter<Item> adapter = (FastAdapter<Item>) tagAdapter;
                        //we get the adapterPosition from the viewHolder
                        int pos = adapter.getHolderAdapterPosition(viewHolder);
                        //make sure the click was done on a valid item
                        if (pos != RecyclerView.NO_POSITION) {
                            Item item = adapter.getItem(pos);
                            if (item != null) {
                                //we update our item with the changed property
                                return ((TouchEventHook<Item>) event).onTouch(v, e, pos, adapter, item);
                            }
                        }
                    }
                    return false;
                }
            });
        } else if (event instanceof CustomEventHook) {
            //we trigger the event binding
            ((CustomEventHook<Item>) event).attachEvent(view, viewHolder);
        }
    }
1162776
public void setAdapter(@NonNull ListAdapter adapter) {
    this.adapter = new MaterialSpinnerAdapterWrapper(getContext(), adapter)
        .setPopupPadding(popupPaddingLeft, popupPaddingTop, popupPaddingRight, popupPaddingBottom)
        .setBackgroundSelector(backgroundSelector)
        .setTextColor(textColor);
    setAdapterInternal(this.adapter);
  }
1228729
public boolean scrollListToBottom(AbsListView list) {
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "scrollListToBottom("+list+")");
		}
		
		return scroller.scrollList(list, Scroller.DOWN, true);
	}