From 89a5c6b8798661876ffea9a547956407a009d0f4 Mon Sep 17 00:00:00 2001 From: Eoin Mcloughlin Date: Sun, 13 Jul 2014 20:05:42 +0100 Subject: [PATCH] Display message when search returned no hits --- .../antennapod/fragment/gpodnet/PodcastListFragment.java | 9 +++++++-- 1 file 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 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); - } }