[Quick search] produce Favs from history, fix context menu of history locationobject
This commit is contained in:
parent
d1a8ad087b
commit
bb6ddf6e13
2 changed files with 24 additions and 7 deletions
|
@ -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;
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue