@Override
 public void onScrollStateChanged(AbsListView view, int scrollState) {
   // 滚动到底部且 listview 的状态是空闲
   if (isBottom && scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
     // 加载新的数据
     showFooterLoadingView();
     mCallbacks.onLoadMore();
   }
 }
Exemplo n.º 2
0
  public void dispatchEvent(DataChangeEvent event) {
    if (eventsEnabled) {
      // dispatch events only for connected datas
      for (DataChangeListener listener : listeners) {
        if (listener == null) {
          logger.error("One of the DataChangeListeners listeners was null.");
        } else {
          logger.debug("Notifying DataChangeListener " + listener.toString());
        }
        try {
          listener.dataChanged(event);

        } catch (RuntimeException e) {
          // we will not let GUI problems to stop important DataBean manipulation operations
          // and possibly lead to DataBean model corruption
          logger.error("DataChangeEvent dispatch failed", e);
        }
      }
    }
  }
Exemplo n.º 3
0
 public void fireDataChange() {
   for (DataChangeListener dcl : listenerDataChanged) {
     dcl.dataChanged(this);
   }
 }
Exemplo n.º 4
0
 public static void clearHistory() {
   history = new ArrayList<>();
   if (dataChangeListener != null) dataChangeListener.onHistoryCleared();
 }
Exemplo n.º 5
0
 public static void addHistoryFile(String i) {
   history.add(i);
   if (dataChangeListener != null) dataChangeListener.onHistoryAdded(i);
 }
Exemplo n.º 6
0
 public static void removeHiddenFile(String i) {
   hiddenfiles.remove(i);
   if (dataChangeListener != null) dataChangeListener.onHiddenFileRemoved(i);
 }
Exemplo n.º 7
0
 public static void addHiddenFile(String i) {
   hiddenfiles.add(i);
   if (dataChangeListener != null) dataChangeListener.onHiddenFileAdded(i);
 }
Exemplo n.º 8
0
 public static void addBook(String[] i, boolean refreshdrawer) {
   if (refreshdrawer && dataChangeListener != null) dataChangeListener.onBookAdded(i, true);
   books.add(i);
 }