Search in sources :

Example 1 with SpecialPointType

use of net.osmand.data.FavouritePoint.SpecialPointType in project Osmand by osmandapp.

the class FavouritesHelper method setParkingPoint.

public void setParkingPoint(@NonNull LatLon latLon, @Nullable String address, long pickupTimestamp, boolean addToCalendar) {
    SpecialPointType specialType = SpecialPointType.PARKING;
    FavouritePoint point = getSpecialPoint(specialType);
    if (point != null) {
        point.setIconId(specialType.getIconId(app));
        point.setTimestamp(pickupTimestamp);
        point.setCalendarEvent(addToCalendar);
        editFavourite(point, latLon.getLatitude(), latLon.getLongitude(), address);
        lookupAddress(point);
    } else {
        point = new FavouritePoint(latLon.getLatitude(), latLon.getLongitude(), specialType.getName(), specialType.getCategory());
        point.setAddress(address);
        point.setCreationDate(System.currentTimeMillis());
        point.setTimestamp(pickupTimestamp);
        point.setCalendarEvent(addToCalendar);
        point.setIconId(specialType.getIconId(app));
        addFavourite(point);
    }
}
Also used : FavouritePoint(net.osmand.data.FavouritePoint) SpecialPointType(net.osmand.data.FavouritePoint.SpecialPointType)

Aggregations

FavouritePoint (net.osmand.data.FavouritePoint)1 SpecialPointType (net.osmand.data.FavouritePoint.SpecialPointType)1