Fixed: Pull-to-refresh was not working when there were no new episodes

This commit is contained in:
daniel oeh 2014-05-18 23:58:48 +02:00
parent 583361b19f
commit f5cbd52fdc
1 changed files with 11 additions and 0 deletions

View File

@ -261,6 +261,7 @@ public class NewEpisodesFragment extends Fragment {
listAdapter.notifyDataSetChanged();
getActivity().supportInvalidateOptionsMenu();
updateProgressBarVisibility();
updateShowOnlyEpisodesListViewState();
}
private DownloadObserver.Callback downloadObserverCallback = new DownloadObserver.Callback() {
@ -368,6 +369,16 @@ public class NewEpisodesFragment extends Fragment {
if (itemsLoaded && viewsCreated) {
listAdapter.notifyDataSetChanged();
activity.get().supportInvalidateOptionsMenu();
updateShowOnlyEpisodesListViewState();
}
}
private void updateShowOnlyEpisodesListViewState() {
if (showOnlyNewEpisodes) {
listView.setEmptyView(null);
txtvEmpty.setVisibility(View.GONE);
} else {
listView.setEmptyView(txtvEmpty);
}
}