Remove parking from favourites after clearing prefs

This commit is contained in:
Vitaliy 2020-05-15 15:12:48 +03:00
parent 4e43dba7f4
commit 3dde2ab020
2 changed files with 6 additions and 3 deletions

View file

@ -132,6 +132,10 @@ public class ParkingPositionPlugin extends OsmandPlugin {
parkingEvent.resetToDefault();
parkingStartTime.resetToDefault();
parkingPosition = null;
FavouritePoint pnt = app.getFavorites().getSpecialPoint(SpecialPointType.PARKING);
if (pnt != null) {
app.getFavorites().deleteFavourite(pnt);
}
return true;
}
@ -372,7 +376,6 @@ public class ParkingPositionPlugin extends OsmandPlugin {
} else {
addOrRemoveParkingEvent(false);
}
app.getFavorites().setSpecialPoint(getParkingPosition(), SpecialPointType.PARKING, null);
showContextMenuIfNeeded(mapActivity, false);
}
});

View file

@ -72,10 +72,10 @@ public class ParkingTypeBottomSheetDialogFragment extends MenuBottomSheetDialogF
plugin.setParkingPosition(latitude, longitude, false);
plugin.showContextMenuIfNeeded(mapActivity, true);
mapActivity.getMyApplication().getFavorites().setSpecialPoint(
plugin.getParkingPosition(), SpecialPointType.PARKING, null);
mapActivity.refreshMap();
}
mapActivity.getMyApplication().getFavorites().setSpecialPoint(
plugin.getParkingPosition(), SpecialPointType.PARKING, null);
}
dismiss();
}