diff options
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/ui/screen/SearchFragment.java | 9 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/ui/view/EmptyViewHandler.java | 4 |
2 files changed, 8 insertions, 5 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/SearchFragment.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/SearchFragment.java index ec782001a..98d308d76 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/screen/SearchFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/SearchFragment.java @@ -176,8 +176,7 @@ public class SearchFragment extends Fragment implements EpisodeItemListAdapter.O emptyViewHandler = new EmptyViewHandler(getContext()); emptyViewHandler.attachToRecyclerView(recyclerView); emptyViewHandler.setIcon(R.drawable.ic_search); - emptyViewHandler.setTitle(R.string.search_status_no_results); - emptyViewHandler.setMessage(R.string.type_to_search); + emptyViewHandler.setTitle(R.string.type_to_search); EventBus.getDefault().register(this); chip = layout.findViewById(R.id.feed_title_chip); @@ -376,7 +375,7 @@ public class SearchFragment extends Fragment implements EpisodeItemListAdapter.O String query = searchView.getQuery().toString(); if (query.isEmpty()) { - emptyViewHandler.setMessage(R.string.type_to_search); + emptyViewHandler.setTitle(R.string.type_to_search); return; } if (feed != 0) { @@ -389,7 +388,7 @@ public class SearchFragment extends Fragment implements EpisodeItemListAdapter.O .subscribe(results -> { progressBar.setVisibility(View.GONE); adapterFeeds.updateData(results); - emptyViewHandler.setMessage(getString(R.string.no_results_for_query, query)); + emptyViewHandler.setTitle(getString(R.string.no_results_for_query, query)); }, error -> Log.e(TAG, Log.getStackTraceString(error))); } disposableEpisodes = Observable.fromCallable(() -> DBReader.searchFeedItems(feed, query)) @@ -399,7 +398,7 @@ public class SearchFragment extends Fragment implements EpisodeItemListAdapter.O progressBar.setVisibility(View.GONE); this.results = results; adapter.updateItems(results); - emptyViewHandler.setMessage(getString(R.string.no_results_for_query, searchView.getQuery())); + emptyViewHandler.setTitle(getString(R.string.no_results_for_query, searchView.getQuery())); }, error -> Log.e(TAG, Log.getStackTraceString(error))); } diff --git a/app/src/main/java/de/danoeh/antennapod/ui/view/EmptyViewHandler.java b/app/src/main/java/de/danoeh/antennapod/ui/view/EmptyViewHandler.java index b467f6f0e..406465053 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/view/EmptyViewHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/view/EmptyViewHandler.java @@ -38,6 +38,10 @@ public class EmptyViewHandler { tvTitle.setText(title);
}
+ public void setTitle(String title) {
+ tvTitle.setText(title);
+ }
+
public void setMessage(int message) {
tvMessage.setText(message);
}
|