From 0cb24ed0db41b7c69dde07879e8b7e46ee306a9a Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Thu, 26 Oct 2017 12:09:35 +0300 Subject: [PATCH] Make the method universal --- OsmAnd-java/src/net/osmand/search/core/SearchSettings.java | 6 +++--- .../src/net/osmand/plus/search/QuickSearchListAdapter.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/search/core/SearchSettings.java b/OsmAnd-java/src/net/osmand/search/core/SearchSettings.java index e5655214f7..c6c877a923 100644 --- a/OsmAnd-java/src/net/osmand/search/core/SearchSettings.java +++ b/OsmAnd-java/src/net/osmand/search/core/SearchSettings.java @@ -143,10 +143,10 @@ public class SearchSettings { return s; } - public boolean alreadyInOnlineSearch() { + public boolean hasCustomSearchType(ObjectType type) { if (searchTypes != null) { - for (ObjectType type : searchTypes) { - if (type == ObjectType.ONLINE_SEARCH) { + for (ObjectType t : searchTypes) { + if (t == type) { return true; } } diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java index 3e5667064b..3a4ccb6976 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java @@ -29,6 +29,7 @@ import net.osmand.plus.search.listitems.QuickSearchListItem; import net.osmand.plus.search.listitems.QuickSearchListItemType; import net.osmand.plus.search.listitems.QuickSearchMoreListItem; import net.osmand.plus.search.listitems.QuickSearchSelectAllListItem; +import net.osmand.search.core.ObjectType; import net.osmand.search.core.SearchPhrase; import net.osmand.util.Algorithms; import net.osmand.util.OpeningHoursParser; @@ -241,7 +242,7 @@ public class QuickSearchListAdapter extends ArrayAdapter { ((QuickSearchMoreListItem) listItem).increaseRadiusOnClick(); } }); - if (!app.getSearchUICore().getCore().getSearchSettings().alreadyInOnlineSearch() + if (!app.getSearchUICore().getCore().getSearchSettings().hasCustomSearchType(ObjectType.ONLINE_SEARCH) && OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null) { view.findViewById(R.id.online_search_row).setVisibility(View.VISIBLE); view.findViewById(R.id.online_search_row).setOnClickListener(new View.OnClickListener() {