public void addSwipeListener(OnSwipeListener listener){
  if (mListeners == null) {
    mListeners=new ArrayList<>();
  }
  mListeners.add(listener);
}

public void addSwipeListener ( OnSwipeListener listener ) { if ( mListeners == null ) { mListeners = new ArrayList < > ( ) ; } mListeners . add ( listener ) ; }
add a callback to be invoked when a swipe event is sent to this view .
