@Override public void onSourceStateChanged() { isLoadingError = mediaSource.getSource().getState() == ViewSourceState.LOAD_MORE_ERROR; isLoading = mediaSource.getSource().getState() == ViewSourceState.IN_PROGRESS || isLoadingError; if (records.size() == 0) { goneView(gridView); if (isLoading) { showView(loading); goneView(empty); } else { goneView(loading); showView(empty); } } else { showView(gridView); goneView(loading); goneView(empty); } adapter.notifyDataSetChanged(); }
@Override public void onSourceDataChanged() { records = mediaSource.getSource().getCurrentWorkingSet(); adapter.notifyDataSetChanged(); }