diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java index b3ea45969a..fd72169a6f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/HistoryMenuController.java @@ -40,6 +40,11 @@ public class HistoryMenuController extends MenuController { return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN; } + @Override + public boolean displayStreetNameInTitle() { + return entry.getName().isLocation(); + } + @Override public boolean displayDistanceDirection() { return true; diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java index b920c68e2b..cfbbc5dfdd 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java @@ -160,13 +160,25 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment { break; case RECENT_OBJ: HistoryEntry entry = (HistoryEntry) object; - Amenity amenity = findAmenity(entry.getName().getName(), entry.getLat(), entry.getLon(), lang); - if (amenity != null) { - object = amenity; - pointDescription = new PointDescription(PointDescription.POINT_TYPE_POI, - OsmAndFormatter.getPoiStringWithoutType(amenity, lang)); - } else { - pointDescription = entry.getName(); + pointDescription = entry.getName(); + if (pointDescription.isPoi()) { + Amenity amenity = findAmenity(entry.getName().getName(), entry.getLat(), entry.getLon(), lang); + if (amenity != null) { + object = amenity; + pointDescription = new PointDescription(PointDescription.POINT_TYPE_POI, + OsmAndFormatter.getPoiStringWithoutType(amenity, lang)); + } + } else if (pointDescription.isFavorite()) { + LatLon entryLatLon = new LatLon(entry.getLat(), entry.getLon()); + List favs = app.getFavorites().getFavouritePoints(); + for (FavouritePoint f : favs) { + if (entryLatLon.equals(new LatLon(f.getLatitude(), f.getLongitude())) + && pointDescription.getName().equals(f.getName())) { + object = f; + pointDescription = f.getPointDescription(); + break; + } + } } break; case FAVORITE: