Fix ui interpolation

This commit is contained in:
Victor Shcherb 2012-09-10 02:08:45 +02:00
parent e79bae2e74
commit dcce7bbfe0
2 changed files with 9 additions and 9 deletions

View file

@ -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<B
};
}
@Override
public String getText(Building obj) {
if(obj.getInterpolationInterval() > 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<B
String text = getText(obj);
LatLon loc = obj.getLocation();
if(obj.getInterpolationInterval() > 0 || obj.getInterpolationType() != null){
String hno = getFilter().toString();
String hno = getCurrentFilter();
float interpolation = obj.interpolation(hno);
if (interpolation >= 0) {
text = hno;

View file

@ -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<T> extends OsmandListActivity
private int MAX_VISIBLE_NAME = 18;
public String getCurrentFilter() {
return currentFilter;
}
public void querySearch(final String filter) {
String f = filter;