Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2016-07-29 09:59:29 +02:00
commit 51d7b07667
2 changed files with 24 additions and 7 deletions

View file

@ -40,6 +40,11 @@ public class HistoryMenuController extends MenuController {
return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN; return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN;
} }
@Override
public boolean displayStreetNameInTitle() {
return entry.getName().isLocation();
}
@Override @Override
public boolean displayDistanceDirection() { public boolean displayDistanceDirection() {
return true; return true;

View file

@ -160,13 +160,25 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
break; break;
case RECENT_OBJ: case RECENT_OBJ:
HistoryEntry entry = (HistoryEntry) object; HistoryEntry entry = (HistoryEntry) object;
Amenity amenity = findAmenity(entry.getName().getName(), entry.getLat(), entry.getLon(), lang); pointDescription = entry.getName();
if (amenity != null) { if (pointDescription.isPoi()) {
object = amenity; Amenity amenity = findAmenity(entry.getName().getName(), entry.getLat(), entry.getLon(), lang);
pointDescription = new PointDescription(PointDescription.POINT_TYPE_POI, if (amenity != null) {
OsmAndFormatter.getPoiStringWithoutType(amenity, lang)); object = amenity;
} else { pointDescription = new PointDescription(PointDescription.POINT_TYPE_POI,
pointDescription = entry.getName(); OsmAndFormatter.getPoiStringWithoutType(amenity, lang));
}
} else if (pointDescription.isFavorite()) {
LatLon entryLatLon = new LatLon(entry.getLat(), entry.getLon());
List<FavouritePoint> 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; break;
case FAVORITE: case FAVORITE: