diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchCore.java b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchCore.java index 4be870c6bb..87ac794104 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchCore.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchCore.java @@ -55,7 +55,7 @@ public class WikivoyageSearchCore { void onSearchStarted(); - void onSearchFinished(@Nullable List results, boolean lastTask, boolean cancelled); + void onSearchFinished(@Nullable List results, boolean lastTask); } private class SearchAsyncTask extends AsyncTask> { @@ -94,9 +94,8 @@ public class WikivoyageSearchCore { @Override protected void onPostExecute(List results) { super.onPostExecute(results); - boolean cancelled = isCancelled(); for (SearchListener listener : listeners) { - listener.onSearchFinished(results, workQueue.isEmpty(), cancelled); + listener.onSearchFinished(results, workQueue.isEmpty()); } } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java index 7a38a79ca5..a1b5833e91 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/search/WikivoyageSearchDialogFragment.java @@ -76,6 +76,7 @@ public class WikivoyageSearchDialogFragment extends BaseOsmAndDialogFragment imp String newQuery = s.toString(); if (newQuery.isEmpty()) { searchCore.cancelSearch(); + switchProgressBarVisibility(false); adapter.setItems(null); } else if (!searchQuery.equalsIgnoreCase(newQuery)) { searchQuery = newQuery; @@ -118,6 +119,7 @@ public class WikivoyageSearchDialogFragment extends BaseOsmAndDialogFragment imp if (searchCore != null) { searchCore.registerListener(this); } + searchEt.requestFocus(); } @Override @@ -135,10 +137,8 @@ public class WikivoyageSearchDialogFragment extends BaseOsmAndDialogFragment imp } @Override - public void onSearchFinished(@Nullable List results, boolean lastTask, boolean cancelled) { - if (!cancelled) { - adapter.setItems(results); - } + public void onSearchFinished(@Nullable List results, boolean lastTask) { + adapter.setItems(results); if (lastTask) { switchProgressBarVisibility(false); }