diff options
author | Eoin Mcloughlin <eoinmcl@netsoc.tcd.ie> | 2014-07-13 20:05:42 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-07-26 12:49:49 +0200 |
commit | 89a5c6b8798661876ffea9a547956407a009d0f4 (patch) | |
tree | ad46f56b352b71257f40635a62aa7b4b14a39232 /src/de/danoeh/antennapod/fragment | |
parent | c1fbc59f1cc6f754b925082584106aa741ea0c39 (diff) | |
download | AntennaPod-89a5c6b8798661876ffea9a547956407a009d0f4.zip |
Display message when search returned no hits
Diffstat (limited to 'src/de/danoeh/antennapod/fragment')
-rw-r--r-- | src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index 5db5edd79..1b4616207 100644 --- a/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -126,7 +126,7 @@ public abstract class PodcastListFragment extends Fragment { protected void onPostExecute(List<GpodnetPodcast> gpodnetPodcasts) { super.onPostExecute(gpodnetPodcasts); final Context context = getActivity(); - if (context != null && gpodnetPodcasts != null) { + if (context != null && gpodnetPodcasts != null && gpodnetPodcasts.size() > 0) { PodcastListAdapter listAdapter = new PodcastListAdapter(context, 0, gpodnetPodcasts); gridView.setAdapter(listAdapter); listAdapter.notifyDataSetChanged(); @@ -135,13 +135,18 @@ public abstract class PodcastListFragment extends Fragment { gridView.setVisibility(View.VISIBLE); txtvError.setVisibility(View.GONE); butRetry.setVisibility(View.GONE); + } else if (context != null && gpodnetPodcasts != null) { + gridView.setVisibility(View.GONE); + progressBar.setVisibility(View.GONE); + txtvError.setText(getString(R.string.search_status_no_results)); + txtvError.setVisibility(View.VISIBLE); + butRetry.setVisibility(View.GONE); } else if (context != null) { gridView.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); txtvError.setText(getString(R.string.error_msg_prefix) + exception.getMessage()); txtvError.setVisibility(View.VISIBLE); butRetry.setVisibility(View.VISIBLE); - } } |