From 788428591cd274388c540eb0d8776ea9c9295ee7 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 15 Jun 2015 21:32:35 +0200 Subject: [PATCH] Fix wiki names --- .../src/net/osmand/CollatorStringMatcher.java | 7 +++++-- OsmAnd/src/net/osmand/plus/views/POIMapLayer.java | 15 +++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/CollatorStringMatcher.java b/OsmAnd-java/src/net/osmand/CollatorStringMatcher.java index 1fa8ce9088..8ae8e3cf92 100644 --- a/OsmAnd-java/src/net/osmand/CollatorStringMatcher.java +++ b/OsmAnd-java/src/net/osmand/CollatorStringMatcher.java @@ -1,5 +1,7 @@ package net.osmand; +import java.util.Locale; + /** @@ -23,7 +25,7 @@ public class CollatorStringMatcher implements StringMatcher { public CollatorStringMatcher(String part, StringMatcherMode mode) { this.collator = OsmAndCollator.primaryCollator(); - this.part = part; + this.part = part.toLowerCase(Locale.getDefault()); this.mode = mode; } @@ -94,8 +96,9 @@ public class CollatorStringMatcher implements StringMatcher { * @param theStart * @return true if searchIn starts with token */ - public static boolean cstartsWith(Collator collator, String searchIn, String theStart, + public static boolean cstartsWith(Collator collator, String searchInParam, String theStart, boolean checkBeginning, boolean checkSpaces) { + String searchIn = searchInParam.toLowerCase(Locale.getDefault()); int startLength = theStart.length(); int searchInLength = searchIn.length(); if (startLength == 0) { diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index d7397041e6..e15a48ce96 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -23,9 +23,7 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; -import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.helpers.FileNameTranslationHelper; -import net.osmand.plus.osmo.OsMoService; import net.osmand.plus.poi.PoiFiltersHelper; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.render.RenderingIcons; @@ -34,21 +32,18 @@ import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.RoutingHelper.IRouteInformationListener; import net.osmand.plus.views.MapTextLayer.MapTextProvider; import net.osmand.util.Algorithms; -import android.app.Activity; import android.app.AlertDialog; -import android.app.Dialog; import android.app.AlertDialog.Builder; +import android.app.Dialog; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; -import android.content.DialogInterface.OnCancelListener; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; -import android.graphics.drawable.Drawable; import android.graphics.PointF; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.support.v4.view.MenuItemCompat; import android.support.v7.widget.PopupMenu; @@ -64,7 +59,6 @@ import android.view.MotionEvent; import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; -import android.webkit.WebViewClient; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.LinearLayout; @@ -492,7 +486,8 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon @Override public PointDescription getObjectName(Object o) { if (o instanceof Amenity) { - return new PointDescription(PointDescription.POINT_TYPE_POI, ((Amenity) o).getName()); + return new PointDescription(PointDescription.POINT_TYPE_POI, ((Amenity) o).getName( + view.getSettings().MAP_PREFERRED_LOCALE.get())); } return null; } @@ -522,7 +517,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon @Override public String getText(Amenity o) { - return o.getName(view.getSettings().usingEnglishNames()); + return o.getName(view.getSettings().MAP_PREFERRED_LOCALE.get()); } @Override