From dcce7bbfe06463b74642f8785e8fcb1bfc982228 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 10 Sep 2012 02:08:45 +0200 Subject: [PATCH] Fix ui interpolation --- .../search/SearchBuildingByNameActivity.java | 10 +++++----- .../search/SearchByNameAbstractActivity.java | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java index d5935ec2f0..f388eb693b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java @@ -6,7 +6,6 @@ import java.util.List; import net.osmand.Algoritms; import net.osmand.ResultMatcher; import net.osmand.data.Building; -import net.osmand.data.Building.BuildingInterpolation; import net.osmand.data.City; import net.osmand.data.Street; import net.osmand.osm.LatLon; @@ -76,12 +75,13 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity 0 || obj.getInterpolationType() != null){ - String hno = getFilter().toString(); - if(obj.belongsToInterpolation(hno)) { - return hno + " [" + obj.getName(region.useEnglishNames())+"] "; + String hno = getCurrentFilter(); + if(hno.length() > 0 && obj.belongsToInterpolation(hno)) { + return hno + " [" + obj.getName(region.useEnglishNames())+"]"; } } return obj.getName(region.useEnglishNames()); @@ -93,7 +93,7 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity 0 || obj.getInterpolationType() != null){ - String hno = getFilter().toString(); + String hno = getCurrentFilter(); float interpolation = obj.interpolation(hno); if (interpolation >= 0) { text = hno; diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java index bd994dacdf..38839ed643 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java @@ -10,8 +10,6 @@ import java.util.List; import java.util.Locale; import java.util.Set; -import net.londatiga.android.ActionItem; -import net.londatiga.android.QuickAction; import net.osmand.CollatorStringMatcher; import net.osmand.CollatorStringMatcher.StringMatcherMode; import net.osmand.LogUtil; @@ -21,7 +19,6 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.CustomTitleBar; -import net.osmand.plus.activities.MapActivityActions; import net.osmand.plus.activities.OsmandListActivity; import org.apache.commons.logging.Log; @@ -40,7 +37,6 @@ import android.text.style.StyleSpan; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.WindowManager; import android.view.inputmethod.EditorInfo; @@ -180,6 +176,10 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity private int MAX_VISIBLE_NAME = 18; + + public String getCurrentFilter() { + return currentFilter; + } public void querySearch(final String filter) { String f = filter;