From 6b6ae6bdafcc1e4860c561a48c4df75f4fcfc240 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Thu, 30 Jun 2016 16:57:28 +0300 Subject: [PATCH] Fix typo --- .../src/net/osmand/search/example/core/SearchCore.java | 2 +- .../search/{objects => }/SearchObjectsHelper.java | 9 ++++++++- .../android/sample1/search/objects/PoiTypeObject.java | 7 +++++++ .../sample1/search/tokens/NameFilterSearchToken.java | 8 -------- .../android/sample1/search/tokens/NameFilterToken.java | 8 ++++++++ .../{ObjectSearchToken.java => ObjectToken.java} | 10 +++++----- 6 files changed, 29 insertions(+), 15 deletions(-) rename OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/{objects => }/SearchObjectsHelper.java (75%) create mode 100644 OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/PoiTypeObject.java delete mode 100644 OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterSearchToken.java create mode 100644 OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterToken.java rename OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/{ObjectSearchToken.java => ObjectToken.java} (54%) diff --git a/OsmAnd-java/src/net/osmand/search/example/core/SearchCore.java b/OsmAnd-java/src/net/osmand/search/example/core/SearchCore.java index 5314f2fa58..b667ffb33d 100644 --- a/OsmAnd-java/src/net/osmand/search/example/core/SearchCore.java +++ b/OsmAnd-java/src/net/osmand/search/example/core/SearchCore.java @@ -96,7 +96,7 @@ public class SearchCore { public List search(SearchPhrase phrase, int radiusLevel, SearchCallback callback, List existingSearchResults) { // (search streets in neighboor cities for radiusLevel > 2) - if((isLastWordPoi(phrase) || isNoSelectedType(phrase) || raidusLevel >= 2 + if((isLastWordPoi(phrase) || isNoSelectedType(phrase) || radiusLevel >= 2 ) && !(phrase.isEmpty())) { int typedLettersInStreet = 1; QuadRect bbox = getBBoxToSearch(20000 * typedLettersInStreet, radiusLevel, phrase.getLastTokenLocation()); diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/SearchObjectsHelper.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/SearchObjectsHelper.java similarity index 75% rename from OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/SearchObjectsHelper.java rename to OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/SearchObjectsHelper.java index 3016aedb82..3563ddce18 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/SearchObjectsHelper.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/SearchObjectsHelper.java @@ -1,4 +1,4 @@ -package net.osmand.core.samples.android.sample1.search.objects; +package net.osmand.core.samples.android.sample1.search; import net.osmand.core.jni.Address; import net.osmand.core.jni.Building; @@ -6,6 +6,13 @@ import net.osmand.core.jni.OsmAndCoreJNI; import net.osmand.core.jni.Street; import net.osmand.core.jni.StreetGroup; import net.osmand.core.jni.StreetIntersection; +import net.osmand.core.samples.android.sample1.search.objects.BuildingSearchObject; +import net.osmand.core.samples.android.sample1.search.objects.CitySearchObject; +import net.osmand.core.samples.android.sample1.search.objects.PostcodeSearchObject; +import net.osmand.core.samples.android.sample1.search.objects.SearchPositionObject; +import net.osmand.core.samples.android.sample1.search.objects.StreetIntersectionSearchObject; +import net.osmand.core.samples.android.sample1.search.objects.StreetSearchObject; +import net.osmand.core.samples.android.sample1.search.objects.VillageSearchObject; public class SearchObjectsHelper { diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/PoiTypeObject.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/PoiTypeObject.java new file mode 100644 index 0000000000..087f1ba334 --- /dev/null +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/objects/PoiTypeObject.java @@ -0,0 +1,7 @@ +package net.osmand.core.samples.android.sample1.search.objects; + +/** + * Created by Alexey Kulish on 30/06/16. + */ +public class PoiTypeObject { +} diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterSearchToken.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterSearchToken.java deleted file mode 100644 index fbd1c299dc..0000000000 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterSearchToken.java +++ /dev/null @@ -1,8 +0,0 @@ -package net.osmand.core.samples.android.sample1.search.tokens; - -public class NameFilterSearchToken extends SearchToken { - - public NameFilterSearchToken(int startIndex, String queryText) { - super(TokenType.NAME_FILTER, startIndex, queryText, null); - } -} diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterToken.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterToken.java new file mode 100644 index 0000000000..055ed982a8 --- /dev/null +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/NameFilterToken.java @@ -0,0 +1,8 @@ +package net.osmand.core.samples.android.sample1.search.tokens; + +public class NameFilterToken extends SearchToken { + + public NameFilterToken(int startIndex, String plainText) { + super(TokenType.NAME_FILTER, startIndex, plainText, null); + } +} diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/ObjectSearchToken.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/ObjectToken.java similarity index 54% rename from OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/ObjectSearchToken.java rename to OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/ObjectToken.java index 9007f7893d..9a6efa9bed 100644 --- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/ObjectSearchToken.java +++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/tokens/ObjectToken.java @@ -2,17 +2,17 @@ package net.osmand.core.samples.android.sample1.search.tokens; import net.osmand.core.samples.android.sample1.search.objects.SearchObject; -public class ObjectSearchToken extends SearchToken { +public class ObjectToken extends SearchToken { private boolean suggestion = true; - public ObjectSearchToken(SearchToken searchToken, SearchObject searchObject, boolean suggestion) { - super(TokenType.SEARCH_OBJECT, searchToken.getStartIndex(), searchToken.getQueryText(), searchObject); + public ObjectToken(SearchToken searchToken, SearchObject searchObject, boolean suggestion) { + super(TokenType.SEARCH_OBJECT, searchToken.getStartIndex(), searchToken.getPlainText(), searchObject); this.suggestion = suggestion; } - public ObjectSearchToken(int startIndex, String queryText, SearchObject searchObject, boolean suggestion) { - super(TokenType.SEARCH_OBJECT, startIndex, queryText, searchObject); + public ObjectToken(int startIndex, String plainText, SearchObject searchObject, boolean suggestion) { + super(TokenType.SEARCH_OBJECT, startIndex, plainText, searchObject); this.suggestion = suggestion; }