public boolean onScrollChanged(int scrollY){
  boolean isPullingDownNow=scrollY < lastScrollY;
  latestPullingDown.offer(isPullingDownNow);
  if (latestPullingDown.size() > PULLING_DOWN_TIME_MAX) {
    latestPullingDown.poll();
  }
  lastScrollY=scrollY;
  return getPullingDownTime() >= PULLING_DOWN_TIME_THRESHOLD;
}

public boolean onScrollChanged ( int scrollY ) { boolean isPullingDownNow = scrollY < lastScrollY ; latestPullingDown . offer ( isPullingDownNow ) ; if ( latestPullingDown . size ( ) > PULLING_DOWN_TIME_MAX ) { latestPullingDown . poll ( ) ; } lastScrollY = scrollY ; return getPullingDownTime ( ) >= PULLING_DOWN_TIME_THRESHOLD ; }
call this when scroll changed
