Revert renaming

This commit is contained in:
Vitaliy 2021-04-22 12:47:26 +03:00
parent ec03c40c1b
commit a2b6faf94a
56 changed files with 367 additions and 367 deletions

View file

@ -71,7 +71,7 @@ import net.osmand.plus.helpers.LockHelper;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.mapcontextmenu.other.IContextMenuButtonListener;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.myplaces.TrackBitmapDrawer;
import net.osmand.plus.quickaction.QuickAction;
@ -1061,7 +1061,7 @@ public class OsmandAidlApi {
boolean addMapMarker(String name, double latitude, double longitude) {
PointDescription pd = new PointDescription(
PointDescription.POINT_TYPE_MAP_MARKER, name != null ? name : "");
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
markersHelper.addMapMarker(new LatLon(latitude, longitude), pd);
refreshMap();
return true;
@ -1069,7 +1069,7 @@ public class OsmandAidlApi {
boolean removeMapMarker(String name, double latitude, double longitude, boolean ignoreCoordinates) {
LatLon latLon = new LatLon(latitude, longitude);
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
List<MapMarker> mapMarkers = markersHelper.getMapMarkers();
for (MapMarker m : mapMarkers) {
if (m.getOnlyName().equals(name)) {
@ -1085,7 +1085,7 @@ public class OsmandAidlApi {
boolean removeAllActiveMapMarkers() {
boolean refreshNeeded = false;
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
List<MapMarker> mapMarkers = markersHelper.getMapMarkers();
for (MapMarker m : mapMarkers) {
markersHelper.moveMapMarkerToHistory(m);
@ -1101,7 +1101,7 @@ public class OsmandAidlApi {
boolean updateMapMarker(String prevName, LatLon prevLatLon, String newName, LatLon newLatLon, boolean ignoreCoordinates) {
LatLon latLon = new LatLon(prevLatLon.getLatitude(), prevLatLon.getLongitude());
LatLon latLonNew = new LatLon(newLatLon.getLatitude(), newLatLon.getLongitude());
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
List<MapMarker> mapMarkers = markersHelper.getMapMarkers();
for (MapMarker m : mapMarkers) {
if (m.getOnlyName().equals(prevName)) {

View file

@ -42,7 +42,7 @@ import net.osmand.plus.helpers.WaypointHelper;
import net.osmand.plus.inapp.InAppPurchaseHelperImpl;
import net.osmand.plus.liveupdates.LiveUpdatesHelper;
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.monitoring.LiveMonitoringHelper;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.onlinerouting.OnlineRoutingHelper;
@ -458,7 +458,7 @@ public class AppInitializer implements IProgress {
app.geocodingLookupService = startupInit(new GeocodingLookupService(app), GeocodingLookupService.class);
app.targetPointsHelper = startupInit(new TargetPointsHelper(app), TargetPointsHelper.class);
app.mapMarkersDbHelper = startupInit(new MapMarkersDbHelper(app), MapMarkersDbHelper.class);
app.itineraryHelper = startupInit(new ItineraryHelper(app), ItineraryHelper.class);
app.mapMarkersHelper = startupInit(new MapMarkersHelper(app), MapMarkersHelper.class);
app.searchUICore = startupInit(new QuickSearchHelper(app), QuickSearchHelper.class);
app.mapViewTrackingUtilities = startupInit(new MapViewTrackingUtilities(app), MapViewTrackingUtilities.class);
@ -685,7 +685,7 @@ public class AppInitializer implements IProgress {
// restore backuped favorites to normal file
restoreBackupForFavoritesFiles();
notifyEvent(InitEvents.RESTORE_BACKUPS);
app.itineraryHelper.syncAllGroupsAsync();
app.mapMarkersHelper.syncAllGroupsAsync();
app.searchUICore.initSearchUICore();
checkLiveUpdatesAlerts();

View file

@ -19,8 +19,8 @@ import net.osmand.data.LatLon;
import net.osmand.plus.GeocodingLookupService.AddressLookupRequest;
import net.osmand.plus.api.SQLiteAPI.SQLiteConnection;
import net.osmand.plus.api.SQLiteAPI.SQLiteCursor;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.util.Algorithms;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
@ -281,16 +281,16 @@ public class FavouritesDbHelper {
}
private void runSyncWithMarkers(FavoriteGroup favGroup) {
ItineraryHelper helper = context.getItineraryHelper();
ItineraryGroup group = helper.getMarkersGroup(favGroup);
MapMarkersHelper helper = context.getMapMarkersHelper();
MapMarkersGroup group = helper.getMarkersGroup(favGroup);
if (group != null) {
helper.runSynchronization(group);
}
}
private boolean removeFromMarkers(FavoriteGroup favGroup) {
ItineraryHelper helper = context.getItineraryHelper();
ItineraryGroup group = helper.getMarkersGroup(favGroup);
MapMarkersHelper helper = context.getMapMarkersHelper();
MapMarkersGroup group = helper.getMarkersGroup(favGroup);
if (group != null) {
helper.removeMarkersGroup(group);
return true;
@ -299,7 +299,7 @@ public class FavouritesDbHelper {
}
private void addToMarkers(FavoriteGroup favGroup) {
ItineraryHelper helper = context.getItineraryHelper();
MapMarkersHelper helper = context.getMapMarkersHelper();
helper.addOrEnableGroup(favGroup);
}

View file

@ -30,8 +30,8 @@ import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetType;
import net.osmand.plus.helpers.GpxUiHelper.GPXInfo;
import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.helpers.enums.MetricsConstants;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.routing.GPXRouteParams.GPXRouteParamsBuilder;
import net.osmand.plus.track.GpxSplitType;
import net.osmand.util.Algorithms;
@ -798,7 +798,7 @@ public class GpxSelectionHelper {
boolean addToHistory) {
GpxDataItem dataItem = app.getGpxDbHelper().getItem(new File(gpx.path));
if (canAddToMarkers && show && dataItem != null && dataItem.isShowAsMarkers()) {
app.getItineraryHelper().addOrEnableGroup(gpx);
app.getMapMarkersHelper().addOrEnableGroup(gpx);
}
return selectGpxFile(gpx, dataItem, show, notShowNavigationDialog, syncGroup, selectedByUser, addToHistory);
}
@ -825,10 +825,10 @@ public class GpxSelectionHelper {
}
private void syncGpxWithMarkers(GPXFile gpxFile) {
ItineraryHelper itineraryHelper = app.getItineraryHelper();
ItineraryGroup group = itineraryHelper.getMarkersGroup(gpxFile);
MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper();
MapMarkersGroup group = mapMarkersHelper.getMarkersGroup(gpxFile);
if (group != null) {
itineraryHelper.runSynchronization(group);
mapMarkersHelper.runSynchronization(group);
}
}

View file

@ -68,7 +68,7 @@ import net.osmand.plus.helpers.enums.DrivingRegion;
import net.osmand.plus.helpers.enums.MetricsConstants;
import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.measurementtool.MeasurementEditingContext;
import net.osmand.plus.monitoring.LiveMonitoringHelper;
import net.osmand.plus.onlinerouting.OnlineRoutingHelper;
@ -147,7 +147,7 @@ public class OsmandApplication extends MultiDexApplication {
NotificationHelper notificationHelper;
LiveMonitoringHelper liveMonitoringHelper;
TargetPointsHelper targetPointsHelper;
ItineraryHelper itineraryHelper;
MapMarkersHelper mapMarkersHelper;
MapMarkersDbHelper mapMarkersDbHelper;
WaypointHelper waypointHelper;
RoutingOptionsHelper routingOptionsHelper;
@ -688,8 +688,8 @@ public class OsmandApplication extends MultiDexApplication {
return targetPointsHelper;
}
public ItineraryHelper getItineraryHelper() {
return itineraryHelper;
public MapMarkersHelper getMapMarkersHelper() {
return mapMarkersHelper;
}
public MapMarkersDbHelper getMapMarkersDbHelper() {

View file

@ -27,8 +27,8 @@ import androidx.fragment.app.FragmentManager;
import net.osmand.AndroidUtils;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
@ -177,9 +177,9 @@ public class EditFavoriteGroupDialogFragment extends MenuBottomSheetDialogFragme
if (group.getPoints().size() > 0) {
items.add(new DividerHalfItem(getContext()));
final ItineraryHelper markersHelper = app.getItineraryHelper();
final MapMarkersHelper markersHelper = app.getMapMarkersHelper();
final FavoriteGroup favGroup = this.group;
final ItineraryGroup markersGr = markersHelper.getMarkersGroup(this.group);
final MapMarkersGroup markersGr = markersHelper.getMarkersGroup(this.group);
final boolean synced = markersGr != null;
BaseBottomSheetItem markersGroupItem = new SimpleBottomSheetItem.Builder()

View file

@ -42,7 +42,7 @@ import net.osmand.data.PointDescription;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.FavouritesDbHelper.FavoritesListener;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.settings.backend.OsmandPreference;
import net.osmand.plus.settings.backend.OsmandSettings;
@ -520,7 +520,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
private void selectMapMarkersImpl() {
if (getSelectedFavoritesCount() > 0) {
ItineraryHelper markersHelper = getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = getMyApplication().getMapMarkersHelper();
List<LatLon> points = new ArrayList<>();
List<PointDescription> names = new ArrayList<>();
for (Map.Entry<String, Set<FavouritePoint>> entry : favoritesSelected.entrySet()) {

View file

@ -111,7 +111,7 @@ import net.osmand.plus.mapcontextmenu.builders.cards.dialogs.ContextMenuCardDial
import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu;
import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkerChangedListener;
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener;
import net.osmand.plus.mapmarkers.fragments.PlanRouteFragment;
import net.osmand.plus.measurementtool.GpxApproximationFragment;
import net.osmand.plus.measurementtool.GpxData;
@ -407,7 +407,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
@Override
protected void onSaveInstanceState(Bundle outState) {
if (removeFragment(PlanRouteFragment.TAG)) {
app.getItineraryHelper().getPlanRouteContext().setFragmentVisible(true);
app.getMapMarkersHelper().getPlanRouteContext().setFragmentVisible(true);
}
removeFragment(ImportGpxBottomSheetDialogFragment.TAG);
removeFragment(AdditionalActionsBottomSheetDialogFragment.TAG);
@ -450,7 +450,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
dashboardOnMap.updateLocation(true, true, false);
}
app.getTargetPointsHelper().lookupAddessAll();
app.getItineraryHelper().lookupAddressAll();
app.getMapMarkersHelper().lookupAddressAll();
}
if (event == InitEvents.FAVORITES_INITIALIZED) {
refreshMap();
@ -723,7 +723,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
long tm = System.currentTimeMillis();
if (app.getItineraryHelper().getPlanRouteContext().isFragmentVisible()) {
if (app.getMapMarkersHelper().getPlanRouteContext().isFragmentVisible()) {
PlanRouteFragment.showInstance(this);
}
@ -811,7 +811,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
routingHelper.addListener(this);
app.getItineraryHelper().addListener(this);
app.getMapMarkersHelper().addListener(this);
QuickSearchDialogFragment searchDialogFragment = getQuickSearchDialogFragment();
if (searchDialogFragment != null) {
@ -1402,7 +1402,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
pendingPause = false;
mapView.setOnDrawMapListener(null);
cancelSplashScreenTimer();
app.getItineraryHelper().removeListener(this);
app.getMapMarkersHelper().removeListener(this);
app.getRoutingHelper().removeListener(this);
app.getDownloadThread().resetUiActivity(this);
if (atlasMapRendererView != null) {

View file

@ -55,7 +55,7 @@ import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment
import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment.ContextMenuItemClickListener;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MarkersPlanRouteContext;
import net.osmand.plus.measurementtool.MeasurementToolFragment;
import net.osmand.plus.measurementtool.StartPlanRouteBottomSheet;
@ -181,7 +181,7 @@ public class MapActivityActions implements DialogProvider {
public void addMapMarker(double latitude, double longitude, PointDescription pd, @Nullable String mapObjectName) {
ItineraryHelper markersHelper = getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = getMyApplication().getMapMarkersHelper();
markersHelper.addMapMarker(new LatLon(latitude, longitude), pd, mapObjectName);
}
@ -613,7 +613,7 @@ public class MapActivityActions implements DialogProvider {
}
public ApplicationMode getRouteMode(LatLon from) {
MarkersPlanRouteContext planRouteContext = mapActivity.getMyApplication().getItineraryHelper().getPlanRouteContext();
MarkersPlanRouteContext planRouteContext = mapActivity.getMyApplication().getMapMarkersHelper().getPlanRouteContext();
if (planRouteContext.isNavigationFromMarkers() && planRouteContext.getSnappedMode() != ApplicationMode.DEFAULT) {
planRouteContext.setNavigationFromMarkers(false);
return planRouteContext.getSnappedMode();

View file

@ -24,7 +24,7 @@ import net.osmand.plus.helpers.enums.DrivingRegion;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkerChangedListener;
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.routing.RoutingHelperUtils;
import net.osmand.plus.settings.backend.ApplicationMode;
@ -90,7 +90,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
}
private void addMapMarkersListener(OsmandApplication app) {
app.getItineraryHelper().addListener(this);
app.getMapMarkersHelper().addListener(this);
}
@Override

View file

@ -40,7 +40,7 @@ import net.osmand.plus.activities.MapActivity.ShowQuickSearchMode;
import net.osmand.plus.audionotes.AudioVideoNotesPlugin;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionRegistry;
@ -515,7 +515,7 @@ public class ExternalApiHelper {
PointDescription pd = new PointDescription(
PointDescription.POINT_TYPE_MAP_MARKER, name != null ? name : "");
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
markersHelper.addMapMarker(new LatLon(lat, lon), pd);
MapMarker marker = markersHelper.getFirstMapMarker();

View file

@ -19,7 +19,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.PluginsFragment;
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapsource.EditMapSourceDialogFragment;
import net.osmand.plus.openplacereviews.OPRConstants;
import net.osmand.plus.openplacereviews.OprAuthHelper.OprAuthorizationListener;
@ -219,7 +219,7 @@ public class IntentHelper {
if (intent.hasExtra(MapMarkersDialogFragment.OPEN_MAP_MARKERS_GROUPS)) {
Bundle openMapMarkersGroupsExtra = intent.getBundleExtra(MapMarkersDialogFragment.OPEN_MAP_MARKERS_GROUPS);
if (openMapMarkersGroupsExtra != null) {
MapMarkersDialogFragment.showInstance(mapActivity, openMapMarkersGroupsExtra.getString(ItineraryGroup.MARKERS_SYNC_GROUP_ID));
MapMarkersDialogFragment.showInstance(mapActivity, openMapMarkersGroupsExtra.getString(MapMarkersGroup.MARKERS_SYNC_GROUP_ID));
}
mapActivity.setIntent(null);
}

View file

@ -47,7 +47,7 @@ import net.osmand.plus.mapcontextmenu.editors.WptPtEditor;
import net.osmand.plus.mapcontextmenu.other.MapMultiSelectionMenu;
import net.osmand.plus.mapcontextmenu.other.ShareMenu;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkerChangedListener;
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.settings.backend.ApplicationMode;
@ -414,7 +414,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
mapActivity.refreshMap();
if (object instanceof MapMarker) {
app.getItineraryHelper().addListener(this);
app.getMapMarkersHelper().addListener(this);
} else if (object instanceof TargetPoint) {
app.getTargetPointsHelper().addPointListener(this);
}
@ -518,7 +518,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
if (mapActivity != null) {
Object object = getObject();
if (object instanceof MapMarker) {
mapActivity.getMyApplication().getItineraryHelper().removeListener(this);
mapActivity.getMyApplication().getMapMarkersHelper().removeListener(this);
}
MenuController menuController = getMenuController();
if (menuController != null) {

View file

@ -60,7 +60,7 @@ public class AmenityMenuController extends MenuController {
}
String mapNameForMarker = amenity.getName() + "_" + amenity.getType().getKeyName();
marker = mapActivity.getMyApplication().getItineraryHelper().getMapMarker(mapNameForMarker, amenity.getLocation());
marker = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarker(mapNameForMarker, amenity.getLocation());
if (marker != null) {
MapMarkerMenuController markerMenuController =
new MapMarkerMenuController(mapActivity, marker.getPointDescription(mapActivity), marker);

View file

@ -14,7 +14,7 @@ import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.data.TransportStop;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -44,7 +44,7 @@ public class FavouritePointMenuController extends MenuController {
super(new FavouritePointMenuBuilder(mapActivity, fav), pointDescription, mapActivity);
this.fav = fav;
final ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper();
final MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
mapMarker = markersHelper.getMapMarker(fav);
if (mapMarker == null) {
mapMarker = markersHelper.getMapMarker(new LatLon(fav.getLatitude(), fav.getLongitude()));

View file

@ -11,7 +11,7 @@ import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import net.osmand.data.PointDescription;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.settings.backend.OsmandPreference;
import net.osmand.plus.R;
@ -36,7 +36,7 @@ public class MapMarkerMenuController extends MenuController {
public void buttonPressed() {
MapActivity activity = getMapActivity();
if (activity != null) {
ItineraryHelper markersHelper = activity.getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = activity.getMyApplication().getMapMarkersHelper();
MapMarker marker = getMapMarker();
if (marker.history) {
markersHelper.restoreMarkerFromHistory(marker, 0);
@ -62,7 +62,7 @@ public class MapMarkerMenuController extends MenuController {
indication.set(true);
activity.getMapLayers().getMapWidgetRegistry().updateMapMarkersMode(activity);
}
ItineraryHelper markersHelper = activity.getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = activity.getMyApplication().getMapMarkersHelper();
markersHelper.moveMarkerToTop(getMapMarker());
activity.getContextMenu().close();
}

View file

@ -19,7 +19,7 @@ import net.osmand.plus.mapcontextmenu.MenuBuilder;
import net.osmand.plus.mapcontextmenu.MenuController;
import net.osmand.plus.mapcontextmenu.controllers.SelectedGpxMenuController.SelectedGpxPoint;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.track.TrackMenuFragment;
import net.osmand.plus.wikivoyage.menu.WikivoyageWptPtMenuBuilder;
import net.osmand.util.Algorithms;
@ -36,7 +36,7 @@ public class WptPtMenuController extends MenuController {
@NonNull PointDescription pointDescription, @NonNull final WptPt wpt) {
super(menuBuilder, pointDescription, mapActivity);
this.wpt = wpt;
ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
mapMarker = markersHelper.getMapMarker(wpt);
if (mapMarker == null) {
mapMarker = markersHelper.getMapMarker(new LatLon(wpt.lat, wpt.lon));

View file

@ -54,7 +54,7 @@ public class MapMarkerEditorFragment extends PointEditorFragment {
marker.setOriginalPointDescription(new PointDescription(PointDescription.POINT_TYPE_MAP_MARKER, name));
OsmandApplication app = getMyApplication();
if (app != null) {
app.getItineraryHelper().updateMapMarker(marker, true);
app.getMapMarkersHelper().updateMapMarker(marker, true);
}
if (needDismiss) {
dismiss(true);
@ -76,7 +76,7 @@ public class MapMarkerEditorFragment extends PointEditorFragment {
public void onClick(DialogInterface dialog, int which) {
OsmandApplication app = getMyApplication();
if (app != null) {
app.getItineraryHelper().removeMarker(marker);
app.getMapMarkersHelper().removeMarker(marker);
}
if (needDismiss) {
dismiss(true);

View file

@ -17,8 +17,8 @@ import net.osmand.GPXUtilities.WptPt;
import net.osmand.data.LatLon;
import net.osmand.data.WptLocationPoint;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
@ -220,8 +220,8 @@ public class WptPtEditorFragment extends PointEditorFragment {
private void syncGpx(GPXFile gpxFile) {
OsmandApplication app = getMyApplication();
if (app != null) {
ItineraryHelper helper = app.getItineraryHelper();
ItineraryGroup group = helper.getMarkersGroup(gpxFile);
MapMarkersHelper helper = app.getMapMarkersHelper();
MapMarkersGroup group = helper.getMarkersGroup(gpxFile);
if (group != null) {
helper.runSynchronization(group);
}

View file

@ -20,8 +20,8 @@ import net.osmand.data.FavouritePoint.BackgroundType;
import net.osmand.data.LatLon;
import net.osmand.data.WptLocationPoint;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -238,8 +238,8 @@ public class WptPtEditorFragmentNew extends PointEditorFragmentNew {
private void syncGpx(GPXFile gpxFile) {
OsmandApplication app = getMyApplication();
if (app != null) {
ItineraryHelper helper = app.getItineraryHelper();
ItineraryGroup group = helper.getMarkersGroup(gpxFile);
MapMarkersHelper helper = app.getMapMarkersHelper();
MapMarkersGroup group = helper.getMarkersGroup(gpxFile);
if (group != null) {
helper.runSynchronization(group);
}

View file

@ -6,9 +6,9 @@ public class GroupHeader {
@DrawableRes
private int iconRes;
private ItineraryGroup group;
private MapMarkersGroup group;
public GroupHeader(int iconRes, ItineraryGroup group) {
public GroupHeader(int iconRes, MapMarkersGroup group) {
this.iconRes = iconRes;
this.group = group;
}
@ -18,7 +18,7 @@ public class GroupHeader {
return iconRes;
}
public ItineraryGroup getGroup() {
public MapMarkersGroup getGroup() {
return group;
}
}

View file

@ -36,9 +36,9 @@ import java.util.TimeZone;
import static net.osmand.GPXUtilities.writeNotNullText;
import static net.osmand.plus.FavouritesDbHelper.backup;
public class ItinerarySaveHelper {
public class ItineraryDataHelper {
private static final Log log = PlatformUtil.getLog(ItinerarySaveHelper.class);
private static final Log log = PlatformUtil.getLog(ItineraryDataHelper.class);
private static final String VISITED_DATE = "visited_date";
private static final String CREATION_DATE = "creation_date";
@ -58,11 +58,11 @@ public class ItinerarySaveHelper {
}
private OsmandApplication app;
private ItineraryHelper itineraryHelper;
private MapMarkersHelper mapMarkersHelper;
public ItinerarySaveHelper(OsmandApplication app, ItineraryHelper itineraryHelper) {
public ItineraryDataHelper(OsmandApplication app, MapMarkersHelper mapMarkersHelper) {
this.app = app;
this.itineraryHelper = itineraryHelper;
this.mapMarkersHelper = mapMarkersHelper;
}
private File getInternalFile() {
@ -88,7 +88,7 @@ public class ItinerarySaveHelper {
}
public Exception saveFile(File file) {
List<ItineraryGroup> groups = itineraryHelper.getItineraryGroups();
List<MapMarkersGroup> groups = mapMarkersHelper.getMapMarkersGroups();
GPXFile gpxFile = generateGpx(groups);
return GPXUtilities.writeGpxFile(file, gpxFile);
}
@ -132,7 +132,7 @@ public class ItinerarySaveHelper {
}
public GPXFile generateGpx() {
return generateGpx(itineraryHelper.getMapMarkers(), false);
return generateGpx(mapMarkersHelper.getMapMarkers(), false);
}
public GPXFile generateGpx(List<MapMarker> markers, boolean completeBackup) {
@ -153,10 +153,10 @@ public class ItinerarySaveHelper {
return gpxFile;
}
public GPXFile generateGpx(List<ItineraryGroup> itineraryGroups) {
public GPXFile generateGpx(List<MapMarkersGroup> mapMarkersGroups) {
GPXFile gpxFile = new GPXFile(Version.getFullVersion(app));
List<ItineraryGroupInfo> groups = new ArrayList<>();
for (ItineraryGroup group : itineraryGroups) {
for (MapMarkersGroup group : mapMarkersGroups) {
ItineraryGroupInfo groupInfo = ItineraryGroupInfo.createGroupInfo(app, group);
for (MapMarker marker : group.getMarkers()) {
@ -236,7 +236,7 @@ public class ItinerarySaveHelper {
public String path;
public String categories;
public static ItineraryGroupInfo createGroupInfo(OsmandApplication app, ItineraryGroup group) {
public static ItineraryGroupInfo createGroupInfo(OsmandApplication app, MapMarkersGroup group) {
ItineraryGroupInfo groupInfo = new ItineraryGroupInfo();
groupInfo.type = group.getType().getTypeName();
groupInfo.name = !Algorithms.isEmpty(group.getName()) ? group.getName() : null;

View file

@ -162,7 +162,7 @@ public class MapMarkersDbHelper {
}
}
public void addGroup(ItineraryGroup group) {
public void addGroup(MapMarkersGroup group) {
SQLiteConnection db = openConnection(false);
if (db != null) {
try {
@ -174,15 +174,15 @@ public class MapMarkersDbHelper {
}
}
public Map<String, ItineraryGroup> getAllGroupsMap() {
Map<String, ItineraryGroup> res = new LinkedHashMap<>();
public Map<String, MapMarkersGroup> getAllGroupsMap() {
Map<String, MapMarkersGroup> res = new LinkedHashMap<>();
SQLiteConnection db = openConnection(true);
if (db != null) {
try {
SQLiteCursor query = db.rawQuery(GROUPS_TABLE_SELECT, null);
if (query != null && query.moveToFirst()) {
do {
ItineraryGroup group = readGroup(query);
MapMarkersGroup group = readGroup(query);
res.put(group.getId(), group);
} while (query.moveToNext());
}
@ -196,14 +196,14 @@ public class MapMarkersDbHelper {
return res;
}
private ItineraryGroup readGroup(SQLiteCursor query) {
private MapMarkersGroup readGroup(SQLiteCursor query) {
String id = query.getString(0);
String name = query.getString(1);
int type = query.getInt(2);
boolean disabled = query.getInt(3) == 1;
String categories = query.getString(4);
ItineraryGroup res = new ItineraryGroup(id, name, ItineraryType.findTypeForId(type));
MapMarkersGroup res = new MapMarkersGroup(id, name, ItineraryType.findTypeForId(type));
res.setDisabled(disabled);
res.setWptCategories(categories == null ? null : Algorithms.decodeStringSet(categories));

View file

@ -10,7 +10,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class ItineraryGroup {
public class MapMarkersGroup {
public static final String MARKERS_SYNC_GROUP_ID = "markers_sync_group_id";
@ -30,11 +30,11 @@ public class ItineraryGroup {
private GroupHeader header;
private ShowHideHistoryButton showHideHistoryButton;
public ItineraryGroup() {
public MapMarkersGroup() {
}
public ItineraryGroup(@NonNull String id, @NonNull String name, @NonNull ItineraryType type) {
public MapMarkersGroup(@NonNull String id, @NonNull String name, @NonNull ItineraryType type) {
this.id = id;
this.name = name;
this.type = type;

View file

@ -44,7 +44,7 @@ import java.util.concurrent.Executors;
import static net.osmand.data.PointDescription.POINT_TYPE_MAP_MARKER;
public class ItineraryHelper {
public class MapMarkersHelper {
public static final int MAP_MARKERS_COLORS_COUNT = 7;
@ -55,7 +55,7 @@ public class ItineraryHelper {
public static final int BY_DATE_ADDED_ASC = 4;
private static final Log LOG = PlatformUtil.getLog(ItineraryHelper.class);
private static final Log LOG = PlatformUtil.getLog(MapMarkersHelper.class);
@Retention(RetentionPolicy.SOURCE)
@IntDef({BY_NAME, BY_DISTANCE_DESC, BY_DISTANCE_ASC, BY_DATE_ADDED_DESC, BY_DATE_ADDED_ASC})
@ -64,13 +64,13 @@ public class ItineraryHelper {
private OsmandApplication app;
private MapMarkersDbHelper markersDbHelper;
private ItinerarySaveHelper saveHelper;
private ItineraryDataHelper saveHelper;
private ExecutorService executorService = Executors.newSingleThreadExecutor();
private List<MapMarker> mapMarkers = new ArrayList<>();
private List<MapMarker> mapMarkersHistory = new ArrayList<>();
private List<ItineraryGroup> itineraryGroups = new ArrayList<>();
private List<MapMarkersGroup> mapMarkersGroups = new ArrayList<>();
private List<MapMarkerChangedListener> listeners = new ArrayList<>();
private Set<OnGroupSyncedListener> syncListeners = new HashSet<>();
@ -85,8 +85,8 @@ public class ItineraryHelper {
return mapMarkersHistory;
}
public List<ItineraryGroup> getItineraryGroups() {
return itineraryGroups;
public List<MapMarkersGroup> getMapMarkersGroups() {
return mapMarkersGroups;
}
public boolean isStartFromMyLocation() {
@ -101,13 +101,13 @@ public class ItineraryHelper {
return planRouteContext;
}
public ItinerarySaveHelper getSaveHelper() {
public ItineraryDataHelper getSaveHelper() {
return saveHelper;
}
public ItineraryHelper(OsmandApplication app) {
public MapMarkersHelper(OsmandApplication app) {
this.app = app;
saveHelper = new ItinerarySaveHelper(app, this);
saveHelper = new ItineraryDataHelper(app, this);
markersDbHelper = app.getMapMarkersDbHelper();
planRouteContext = new MarkersPlanRouteContext(app);
markersDbHelper.removeDisabledGroups();
@ -132,26 +132,26 @@ public class ItineraryHelper {
}
private void loadGroups() {
Map<String, ItineraryGroup> groupsMap = markersDbHelper.getAllGroupsMap();
Map<String, MapMarkersGroup> groupsMap = markersDbHelper.getAllGroupsMap();
List<MapMarker> allMarkers = new ArrayList<>(mapMarkers);
allMarkers.addAll(mapMarkersHistory);
Iterator<Map.Entry<String, ItineraryGroup>> iterator = groupsMap.entrySet().iterator();
Iterator<Map.Entry<String, MapMarkersGroup>> iterator = groupsMap.entrySet().iterator();
while (iterator.hasNext()) {
ItineraryGroup group = iterator.next().getValue();
MapMarkersGroup group = iterator.next().getValue();
if (group.getType() == ItineraryType.TRACK && !new File(group.getId()).exists()) {
markersDbHelper.removeMarkersGroup(group.getId());
iterator.remove();
}
}
ItineraryGroup noGroup = null;
MapMarkersGroup noGroup = null;
for (MapMarker marker : allMarkers) {
ItineraryGroup group = groupsMap.get(marker.groupKey);
MapMarkersGroup group = groupsMap.get(marker.groupKey);
if (group == null) {
if (noGroup == null) {
noGroup = new ItineraryGroup();
noGroup = new MapMarkersGroup();
noGroup.setCreationDate(Long.MAX_VALUE);
}
noGroup.getMarkers().add(marker);
@ -163,7 +163,7 @@ public class ItineraryHelper {
}
}
itineraryGroups = new ArrayList<>(groupsMap.values());
mapMarkersGroups = new ArrayList<>(groupsMap.values());
if (noGroup != null) {
sortMarkers(noGroup.getMarkers(), false, BY_DATE_ADDED_DESC);
addToGroupsList(noGroup);
@ -171,7 +171,7 @@ public class ItineraryHelper {
sortGroups();
for (ItineraryGroup group : itineraryGroups) {
for (MapMarkersGroup group : mapMarkersGroups) {
updateGroup(group);
}
}
@ -181,7 +181,7 @@ public class ItineraryHelper {
}
public void syncAllGroupsAsync() {
for (ItineraryGroup gr : itineraryGroups) {
for (MapMarkersGroup gr : mapMarkersGroups) {
if (gr.getId() != null && gr.getName() != null) {
runSynchronization(gr);
}
@ -300,7 +300,7 @@ public class ItineraryHelper {
});
}
public void runSynchronization(final @NonNull ItineraryGroup group) {
public void runSynchronization(final @NonNull MapMarkersGroup group) {
app.runInUIThread(new Runnable() {
@Override
public void run() {
@ -309,20 +309,20 @@ public class ItineraryHelper {
});
}
public ItineraryGroup getMarkersGroup(GPXFile gpx) {
public MapMarkersGroup getMarkersGroup(GPXFile gpx) {
if (gpx == null || gpx.path == null) {
return null;
}
return getMapMarkerGroupById(getMarkerGroupId(new File(gpx.path)), ItineraryType.TRACK);
}
public ItineraryGroup getMarkersGroup(FavoriteGroup favGroup) {
public MapMarkersGroup getMarkersGroup(FavoriteGroup favGroup) {
return getMapMarkerGroupById(getMarkerGroupId(favGroup), ItineraryType.FAVOURITES);
}
public ItineraryGroup addOrEnableGpxGroup(@NonNull File file) {
public MapMarkersGroup addOrEnableGpxGroup(@NonNull File file) {
updateGpxShowAsMarkers(file);
ItineraryGroup gr = getMapMarkerGroupById(getMarkerGroupId(file), ItineraryType.TRACK);
MapMarkersGroup gr = getMapMarkerGroupById(getMarkerGroupId(file), ItineraryType.TRACK);
if (gr == null) {
gr = createGPXMarkerGroup(file);
addGroupInternally(gr);
@ -331,9 +331,9 @@ public class ItineraryHelper {
return gr;
}
public ItineraryGroup addOrEnableGroup(@NonNull GPXFile file) {
public MapMarkersGroup addOrEnableGroup(@NonNull GPXFile file) {
updateGpxShowAsMarkers(new File(file.path));
ItineraryGroup gr = getMarkersGroup(file);
MapMarkersGroup gr = getMarkersGroup(file);
if (gr == null) {
gr = createGPXMarkerGroup(new File(file.path));
addGroupInternally(gr);
@ -342,8 +342,8 @@ public class ItineraryHelper {
return gr;
}
public ItineraryGroup addOrEnableGroup(@NonNull FavoriteGroup group) {
ItineraryGroup gr = getMarkersGroup(group);
public MapMarkersGroup addOrEnableGroup(@NonNull FavoriteGroup group) {
MapMarkersGroup gr = getMarkersGroup(group);
if (gr == null) {
gr = createFavMarkerGroup(group);
addGroupInternally(gr);
@ -352,9 +352,9 @@ public class ItineraryHelper {
return gr;
}
public void enableGroup(@NonNull ItineraryGroup gr) {
public void enableGroup(@NonNull MapMarkersGroup gr) {
// check if group doesn't exist internally
if (!itineraryGroups.contains(gr)) {
if (!mapMarkersGroups.contains(gr)) {
addGroupInternally(gr);
}
if (gr.isDisabled()) {
@ -363,7 +363,7 @@ public class ItineraryHelper {
runSynchronization(gr);
}
private void addGroupInternally(ItineraryGroup gr) {
private void addGroupInternally(MapMarkersGroup gr) {
markersDbHelper.addGroup(gr);
addHistoryMarkersToGroup(gr);
addToGroupsList(gr);
@ -377,7 +377,7 @@ public class ItineraryHelper {
}
}
private void addHistoryMarkersToGroup(@NonNull ItineraryGroup group) {
private void addHistoryMarkersToGroup(@NonNull MapMarkersGroup group) {
List<MapMarker> historyMarkers = new ArrayList<>(mapMarkersHistory);
for (MapMarker m : historyMarkers) {
if (m.groupKey != null && group.getId() != null && m.groupKey.equals(group.getId())) {
@ -386,7 +386,7 @@ public class ItineraryHelper {
}
}
public void removeMarkersGroup(ItineraryGroup group) {
public void removeMarkersGroup(MapMarkersGroup group) {
if (group != null) {
markersDbHelper.removeMarkersGroup(group.getId());
removeGroupActiveMarkers(group, false);
@ -394,7 +394,7 @@ public class ItineraryHelper {
}
}
public void updateGroupDisabled(@NonNull ItineraryGroup group, boolean disabled) {
public void updateGroupDisabled(@NonNull MapMarkersGroup group, boolean disabled) {
String id = group.getId();
if (id != null) {
markersDbHelper.updateGroupDisabled(id, disabled);
@ -402,7 +402,7 @@ public class ItineraryHelper {
}
}
public void updateGroupWptCategories(@NonNull ItineraryGroup group, Set<String> wptCategories) {
public void updateGroupWptCategories(@NonNull MapMarkersGroup group, Set<String> wptCategories) {
String id = group.getId();
if (id != null) {
group.setWptCategories(wptCategories);
@ -412,7 +412,7 @@ public class ItineraryHelper {
}
}
private void removeGroupActiveMarkers(ItineraryGroup group, boolean updateGroup) {
private void removeGroupActiveMarkers(MapMarkersGroup group, boolean updateGroup) {
if (group != null) {
markersDbHelper.removeActiveMarkersFromGroup(group.getId());
removeFromMapMarkersList(group.getActiveMarkers());
@ -426,26 +426,26 @@ public class ItineraryHelper {
}
public void updateGroups() {
for (ItineraryGroup group : itineraryGroups) {
for (MapMarkersGroup group : mapMarkersGroups) {
updateGroup(group);
}
}
public void updateGroup(ItineraryGroup itineraryGroup) {
if (itineraryGroup.getId() == null || itineraryGroup.getName() == null) {
public void updateGroup(MapMarkersGroup mapMarkersGroup) {
if (mapMarkersGroup.getId() == null || mapMarkersGroup.getName() == null) {
return;
}
createHeadersInGroup(itineraryGroup);
int historyMarkersCount = itineraryGroup.getHistoryMarkers().size();
ShowHideHistoryButton showHideHistoryButton = itineraryGroup.getShowHideHistoryButton();
createHeadersInGroup(mapMarkersGroup);
int historyMarkersCount = mapMarkersGroup.getHistoryMarkers().size();
ShowHideHistoryButton showHideHistoryButton = mapMarkersGroup.getShowHideHistoryButton();
if (showHideHistoryButton != null) {
if (historyMarkersCount == 0) {
itineraryGroup.setShowHideHistoryButton(null);
mapMarkersGroup.setShowHideHistoryButton(null);
}
} else if (historyMarkersCount > 0) {
showHideHistoryButton = new ShowHideHistoryButton();
showHideHistoryButton.showHistory = false;
itineraryGroup.setShowHideHistoryButton(showHideHistoryButton);
mapMarkersGroup.setShowHideHistoryButton(showHideHistoryButton);
}
}
@ -458,25 +458,25 @@ public class ItineraryHelper {
private void addMarkerToGroup(MapMarker marker) {
if (marker != null) {
ItineraryGroup itineraryGroup = getMapMarkerGroupById(marker.groupKey, marker.getType());
if (itineraryGroup != null) {
itineraryGroup.getMarkers().add(marker);
updateGroup(itineraryGroup);
if (itineraryGroup.getName() == null) {
sortMarkers(itineraryGroup.getMarkers(), false, BY_DATE_ADDED_DESC);
MapMarkersGroup mapMarkersGroup = getMapMarkerGroupById(marker.groupKey, marker.getType());
if (mapMarkersGroup != null) {
mapMarkersGroup.getMarkers().add(marker);
updateGroup(mapMarkersGroup);
if (mapMarkersGroup.getName() == null) {
sortMarkers(mapMarkersGroup.getMarkers(), false, BY_DATE_ADDED_DESC);
}
} else {
itineraryGroup = new ItineraryGroup(marker.groupKey, marker.groupName, ItineraryType.MARKERS);
itineraryGroup.setCreationDate(Long.MAX_VALUE);
itineraryGroup.getMarkers().add(marker);
addToGroupsList(itineraryGroup);
mapMarkersGroup = new MapMarkersGroup(marker.groupKey, marker.groupName, ItineraryType.MARKERS);
mapMarkersGroup.setCreationDate(Long.MAX_VALUE);
mapMarkersGroup.getMarkers().add(marker);
addToGroupsList(mapMarkersGroup);
sortGroups();
updateGroup(itineraryGroup);
updateGroup(mapMarkersGroup);
}
}
}
private void createHeadersInGroup(@NonNull ItineraryGroup group) {
private void createHeadersInGroup(@NonNull MapMarkersGroup group) {
ItineraryType type = group.getType();
int headerIconId = 0;
if (type != ItineraryType.MARKERS) {
@ -489,19 +489,19 @@ public class ItineraryHelper {
private void removeMarkerFromGroup(MapMarker marker) {
if (marker != null) {
ItineraryGroup itineraryGroup = getMapMarkerGroupById(marker.groupKey, marker.getType());
if (itineraryGroup != null) {
itineraryGroup.getMarkers().remove(marker);
updateGroup(itineraryGroup);
MapMarkersGroup mapMarkersGroup = getMapMarkerGroupById(marker.groupKey, marker.getType());
if (mapMarkersGroup != null) {
mapMarkersGroup.getMarkers().remove(marker);
updateGroup(mapMarkersGroup);
}
}
}
private void sortGroups() {
if (itineraryGroups.size() > 0) {
Collections.sort(itineraryGroups, new Comparator<ItineraryGroup>() {
if (mapMarkersGroups.size() > 0) {
Collections.sort(mapMarkersGroups, new Comparator<MapMarkersGroup>() {
@Override
public int compare(ItineraryGroup group1, ItineraryGroup group2) {
public int compare(MapMarkersGroup group1, MapMarkersGroup group2) {
long t1 = group1.getCreationDate();
long t2 = group2.getCreationDate();
return (t1 > t2) ? -1 : ((t1 == t2) ? 0 : 1);
@ -511,8 +511,8 @@ public class ItineraryHelper {
}
@Nullable
public ItineraryGroup getMapMarkerGroupById(String id, ItineraryType type) {
for (ItineraryGroup group : itineraryGroups) {
public MapMarkersGroup getMapMarkerGroupById(String id, ItineraryType type) {
for (MapMarkersGroup group : mapMarkersGroups) {
if ((id == null && group.getId() == null)
|| (group.getId() != null && group.getId().equals(id))) {
if (type == ItineraryType.MARKERS || type == group.getType()) {
@ -523,14 +523,14 @@ public class ItineraryHelper {
return null;
}
private ItineraryGroup createGPXMarkerGroup(File fl) {
return new ItineraryGroup(getMarkerGroupId(fl),
private MapMarkersGroup createGPXMarkerGroup(File fl) {
return new MapMarkersGroup(getMarkerGroupId(fl),
Algorithms.getFileNameWithoutExtension(fl.getName()),
ItineraryType.TRACK);
}
private ItineraryGroup createFavMarkerGroup(FavoriteGroup favGroup) {
return new ItineraryGroup(favGroup.getName(), favGroup.getName(), ItineraryType.FAVOURITES);
private MapMarkersGroup createFavMarkerGroup(FavoriteGroup favGroup) {
return new MapMarkersGroup(favGroup.getName(), favGroup.getName(), ItineraryType.FAVOURITES);
}
private String getMarkerGroupId(File gpx) {
@ -542,13 +542,13 @@ public class ItineraryHelper {
}
@NonNull
public List<ItineraryGroup> getGroupsForDisplayedGpx() {
List<ItineraryGroup> res = new ArrayList<>();
public List<MapMarkersGroup> getGroupsForDisplayedGpx() {
List<MapMarkersGroup> res = new ArrayList<>();
List<SelectedGpxFile> selectedGpxFiles = app.getSelectedGpxHelper().getSelectedGPXFiles();
for (SelectedGpxFile selected : selectedGpxFiles) {
ItineraryGroup search = getMarkersGroup(selected.getGpxFile());
MapMarkersGroup search = getMarkersGroup(selected.getGpxFile());
if (search == null && selected.getGpxFile() != null && selected.getGpxFile().path != null) {
ItineraryGroup group = createGPXMarkerGroup(new File(selected.getGpxFile().path));
MapMarkersGroup group = createGPXMarkerGroup(new File(selected.getGpxFile().path));
group.setDisabled(true);
createHeadersInGroup(group);
res.add(group);
@ -558,17 +558,17 @@ public class ItineraryHelper {
}
@NonNull
public List<ItineraryGroup> getGroupsForSavedArticlesTravelBook() {
List<ItineraryGroup> res = new ArrayList<>();
public List<MapMarkersGroup> getGroupsForSavedArticlesTravelBook() {
List<MapMarkersGroup> res = new ArrayList<>();
TravelHelper travelHelper = app.getTravelHelper();
if (travelHelper.isAnyTravelBookPresent()) {
List<TravelArticle> savedArticles = travelHelper.getBookmarksHelper().getSavedArticles();
for (TravelArticle art : savedArticles) {
String gpxName = travelHelper.getGPXName(art);
File path = app.getAppPath(IndexConstants.GPX_TRAVEL_DIR + gpxName);
ItineraryGroup search = getMapMarkerGroupById(getMarkerGroupId(path), ItineraryType.TRACK);
MapMarkersGroup search = getMapMarkerGroupById(getMarkerGroupId(path), ItineraryType.TRACK);
if (search == null) {
ItineraryGroup group = createGPXMarkerGroup(path);
MapMarkersGroup group = createGPXMarkerGroup(path);
group.setDisabled(true);
createHeadersInGroup(group);
res.add(group);
@ -629,7 +629,7 @@ public class ItineraryHelper {
return null;
}
private void addNewMarkerIfNeeded(@NonNull ItineraryGroup group,
private void addNewMarkerIfNeeded(@NonNull MapMarkersGroup group,
@NonNull List<MapMarker> groupMarkers,
@NonNull LatLon latLon,
@NonNull String name,
@ -866,13 +866,13 @@ public class ItineraryHelper {
public void addMapMarkers(@NonNull List<LatLon> points,
@NonNull List<PointDescription> historyNames,
@Nullable ItineraryGroup group) {
@Nullable MapMarkersGroup group) {
addMarkers(points, historyNames, group, null, null, null);
}
private void addMarkers(@NonNull List<LatLon> points,
@NonNull List<PointDescription> historyNames,
@Nullable ItineraryGroup group,
@Nullable MapMarkersGroup group,
@Nullable List<FavouritePoint> favouritePoints,
@Nullable List<WptPt> wptPts,
@Nullable List<String> mapObjNames) {
@ -1006,7 +1006,7 @@ public class ItineraryHelper {
public List<MapMarker> getMapMarkersFromDefaultGroups(boolean history) {
List<MapMarker> mapMarkers = new ArrayList<>();
for (ItineraryGroup group : itineraryGroups) {
for (MapMarkersGroup group : mapMarkersGroups) {
if (group.getType() == ItineraryType.MARKERS) {
for (MapMarker marker : group.getMarkers()) {
if (history && marker.history || !history && !marker.history) {
@ -1082,16 +1082,16 @@ public class ItineraryHelper {
// accessors to markers groups:
private void addToGroupsList(ItineraryGroup group) {
List<ItineraryGroup> copyList = new ArrayList<>(itineraryGroups);
private void addToGroupsList(MapMarkersGroup group) {
List<MapMarkersGroup> copyList = new ArrayList<>(mapMarkersGroups);
copyList.add(group);
itineraryGroups = copyList;
mapMarkersGroups = copyList;
}
private void removeFromGroupsList(ItineraryGroup group) {
List<ItineraryGroup> copyList = new ArrayList<>(itineraryGroups);
private void removeFromGroupsList(MapMarkersGroup group) {
List<MapMarkersGroup> copyList = new ArrayList<>(mapMarkersGroups);
copyList.remove(group);
itineraryGroups = copyList;
mapMarkersGroups = copyList;
}
// ---------------------------------------------------------------------------------------------
@ -1113,9 +1113,9 @@ public class ItineraryHelper {
private class SyncGroupTask extends AsyncTask<Void, Void, Void> {
private ItineraryGroup group;
private MapMarkersGroup group;
SyncGroupTask(ItineraryGroup group) {
SyncGroupTask(MapMarkersGroup group) {
this.group = group;
}

View file

@ -178,7 +178,7 @@ public class MarkersPlanRouteContext {
}
private List<WptPt> getPointsToCalculate() {
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
List<WptPt> points = new LinkedList<>();
Location myLoc = app.getLocationProvider().getLastStaleKnownLocation();
if (markersHelper.isStartFromMyLocation() && myLoc != null) {

View file

@ -18,7 +18,7 @@ import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.UiUtilities.UpdateLocationViewCache;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.ItineraryType;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.util.Algorithms;
@ -44,7 +44,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
this.mapActivity = mapActivity;
uiUtilities = mapActivity.getMyApplication().getUIUtilities();
updateLocationViewCache = uiUtilities.getUpdateLocationViewCache();
markers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers();
markers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers();
night = !mapActivity.getMyApplication().getSettings().isLightContent();
showDirectionEnabled = mapActivity.getMyApplication().getSettings().MARKERS_DISTANCE_INDICATION_ENABLED.get();
}
@ -152,7 +152,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
}
final MapMarker marker = markers.get(position);
mapActivity.getMyApplication().getItineraryHelper().moveMapMarkerToHistory(marker);
mapActivity.getMyApplication().getMapMarkersHelper().moveMapMarkerToHistory(marker);
changeMarkers();
notifyDataSetChanged();
@ -160,7 +160,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
@Override
public void onClick(View view) {
mapActivity.getMyApplication().getItineraryHelper().restoreMarkerFromHistory(marker, position);
mapActivity.getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory(marker, position);
changeMarkers();
notifyDataSetChanged();
}
@ -189,7 +189,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
}
public void changeMarkers() {
markers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers();
markers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers();
}
public void hideSnackbar() {
@ -214,11 +214,11 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
public void onItemSwiped(RecyclerView.ViewHolder holder) {
final int pos = holder.getAdapterPosition();
final MapMarker marker = getItem(pos);
mapActivity.getMyApplication().getItineraryHelper().moveMapMarkerToHistory(marker);
ItineraryGroup group = mapActivity.getMyApplication().getItineraryHelper().getMapMarkerGroupById(marker.groupKey,
mapActivity.getMyApplication().getMapMarkersHelper().moveMapMarkerToHistory(marker);
MapMarkersGroup group = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkerGroupById(marker.groupKey,
ItineraryType.MARKERS);
if (group != null) {
mapActivity.getMyApplication().getItineraryHelper().updateGroup(group);
mapActivity.getMyApplication().getMapMarkersHelper().updateGroup(group);
}
changeMarkers();
notifyDataSetChanged();
@ -226,7 +226,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
@Override
public void onClick(View view) {
mapActivity.getMyApplication().getItineraryHelper().restoreMarkerFromHistory(marker, pos);
mapActivity.getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory(marker, pos);
changeMarkers();
notifyDataSetChanged();
}

View file

@ -22,11 +22,11 @@ import net.osmand.IndexConstants;
import net.osmand.data.LatLon;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.GroupHeader;
import net.osmand.plus.mapmarkers.ItineraryType;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.ShowHideHistoryButton;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
@ -84,7 +84,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
private void updateShowDirectionMarkers() {
showDirectionEnabled = app.getSettings().MARKERS_DISTANCE_INDICATION_ENABLED.get();
List<MapMarker> mapMarkers = app.getItineraryHelper().getMapMarkers();
List<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkers();
int markersCount = mapMarkers.size();
showDirectionMarkers = new ArrayList<>(mapMarkers.subList(0, getToIndex(markersCount)));
}
@ -101,9 +101,9 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
private void createDisplayGroups() {
items = new ArrayList<>();
ItineraryHelper helper = app.getItineraryHelper();
MapMarkersHelper helper = app.getMapMarkersHelper();
helper.updateGroups();
List<ItineraryGroup> groups = new ArrayList<>(helper.getItineraryGroups());
List<MapMarkersGroup> groups = new ArrayList<>(helper.getMapMarkersGroups());
groups.addAll(helper.getGroupsForDisplayedGpx());
groups.addAll(helper.getGroupsForSavedArticlesTravelBook());
@ -134,7 +134,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
Calendar markerCalendar = Calendar.getInstance();
for (int i = 0; i < groups.size(); i++) {
ItineraryGroup group = groups.get(i);
MapMarkersGroup group = groups.get(i);
if (!group.isVisible()) {
continue;
}
@ -228,7 +228,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
return null;
}
private void populateAdapterWithGroupMarkers(ItineraryGroup group, int position) {
private void populateAdapterWithGroupMarkers(MapMarkersGroup group, int position) {
if (position != RecyclerView.NO_POSITION) {
ShowHideHistoryButton showHideHistoryButton = group.getShowHideHistoryButton();
if (!group.isDisabled()) {
@ -253,7 +253,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
public int getGroupHeaderPosition(String groupId) {
int pos = -1;
ItineraryGroup group = app.getItineraryHelper().getMapMarkerGroupById(groupId, ItineraryType.MARKERS);
MapMarkersGroup group = app.getMapMarkersHelper().getMapMarkerGroupById(groupId, ItineraryType.MARKERS);
if (group != null) {
pos = items.indexOf(group.getGroupHeader());
}
@ -376,9 +376,9 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
return;
}
if (markerInHistory) {
app.getItineraryHelper().restoreMarkerFromHistory(marker, 0);
app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
} else {
app.getItineraryHelper().moveMapMarkerToHistory(marker);
app.getMapMarkersHelper().moveMapMarkerToHistory(marker);
}
updateDisplayedData();
if (!markerInHistory) {
@ -386,7 +386,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
@Override
public void onClick(View view) {
mapActivity.getMyApplication().getItineraryHelper().restoreMarkerFromHistory(marker, 0);
mapActivity.getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
updateDisplayedData();
}
});
@ -421,7 +421,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
headerViewHolder.articleDescription.setVisibility(View.GONE);
} else if (header instanceof GroupHeader) {
final GroupHeader groupHeader = (GroupHeader) header;
final ItineraryGroup group = groupHeader.getGroup();
final MapMarkersGroup group = groupHeader.getGroup();
String groupName = group.getName();
if (groupName.isEmpty()) {
groupName = app.getString(R.string.shared_string_favorites);
@ -466,7 +466,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
CompoundButton.OnCheckedChangeListener checkedChangeListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean enabled) {
final ItineraryHelper itineraryHelper = app.getItineraryHelper();
final MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper();
final GPXFile[] gpxFile = new GPXFile[1];
boolean disabled = !enabled;
@ -482,7 +482,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
fragment.setUsedOnMap(false);
fragment.show(mapActivity.getSupportFragmentManager(), SelectWptCategoriesBottomSheetDialogFragment.TAG);
}
itineraryHelper.updateGroupDisabled(group, disabled);
mapMarkersHelper.updateGroupDisabled(group, disabled);
if (group.getType() == ItineraryType.TRACK) {
group.setVisibleUntilRestart(disabled);
String gpxPath = group.getGpxPath();
@ -496,9 +496,9 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
switchGpxVisibility(gpxFile[0], selectedGpxFile, !disabled);
}
if(!disabled) {
itineraryHelper.enableGroup(group);
mapMarkersHelper.enableGroup(group);
} else {
itineraryHelper.runSynchronization(group);
mapMarkersHelper.runSynchronization(group);
}
if (disabled) {
@ -509,7 +509,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
if (group.getType() == ItineraryType.TRACK && gpxFile[0] != null) {
switchGpxVisibility(gpxFile[0], null, true);
}
itineraryHelper.enableGroup(group);
mapMarkersHelper.enableGroup(group);
}
});
UiUtilities.setupSnackbar(snackbar, night);
@ -549,7 +549,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
final Object header = getItem(position);
if (header instanceof CategoriesSubHeader) {
final CategoriesSubHeader categoriesSubHeader = (CategoriesSubHeader) header;
final ItineraryGroup group = categoriesSubHeader.getGroup();
final MapMarkersGroup group = categoriesSubHeader.getGroup();
View.OnClickListener openChooseCategoriesDialog = new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -563,7 +563,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
fragment.setUsedOnMap(false);
fragment.show(mapActivity.getSupportFragmentManager(), SelectWptCategoriesBottomSheetDialogFragment.TAG);
} else {
mapActivity.getMyApplication().getItineraryHelper().addOrEnableGpxGroup(new File(group.getGpxPath()));
mapActivity.getMyApplication().getMapMarkersHelper().addOrEnableGpxGroup(new File(group.getGpxPath()));
}
}
};
@ -592,7 +592,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
}
}
private String getGroupWptCategoriesString(ItineraryGroup group) {
private String getGroupWptCategoriesString(MapMarkersGroup group) {
StringBuilder sb = new StringBuilder();
Set<String> categories = group.getWptCategories();
if (categories != null && !categories.isEmpty()) {
@ -664,13 +664,13 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
public class CategoriesSubHeader {
private ItineraryGroup group;
private MapMarkersGroup group;
public CategoriesSubHeader(ItineraryGroup group) {
public CategoriesSubHeader(MapMarkersGroup group) {
this.group = group;
}
public ItineraryGroup getGroup() {
public MapMarkersGroup getGroup() {
return group;
}
}

View file

@ -51,7 +51,7 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
public void createHeaders() {
items = new ArrayList<>();
markerGroups = new HashMap<>();
List<MapMarker> markersHistory = app.getItineraryHelper().getMapMarkersHistory();
List<MapMarker> markersHistory = app.getMapMarkersHelper().getMapMarkersHistory();
int previousHeader = -1;
int monthsDisplayed = 0;
@ -161,13 +161,13 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
if (position < 0) {
return;
}
app.getItineraryHelper().restoreMarkerFromHistory(marker, 0);
app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
snackbar = Snackbar.make(itemViewHolder.itemView, app.getString(R.string.marker_moved_to_active), Snackbar.LENGTH_LONG)
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
@Override
public void onClick(View view) {
app.getItineraryHelper().moveMapMarkerToHistory(marker);
app.getMapMarkersHelper().moveMapMarkerToHistory(marker);
}
});
UiUtilities.setupSnackbar(snackbar, night);
@ -216,14 +216,14 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
return;
}
for (MapMarker marker : group) {
app.getItineraryHelper().removeMarker((MapMarker) marker);
app.getMapMarkersHelper().removeMarker((MapMarker) marker);
}
snackbar = Snackbar.make(holder.itemView, app.getString(R.string.n_items_removed), Snackbar.LENGTH_LONG)
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
@Override
public void onClick(View view) {
for (MapMarker marker : group) {
app.getItineraryHelper().addMarker(marker);
app.getMapMarkersHelper().addMarker(marker);
}
}
});

View file

@ -97,7 +97,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
boolean firstSelectedMarker = pos == firstSelectedMarkerPos;
boolean roundTripFinishItem = finish && showRoundTripItem;
boolean useLocation = app.getItineraryHelper().isStartFromMyLocation() && showLocationItem;
boolean useLocation = app.getMapMarkersHelper().isStartFromMyLocation() && showLocationItem;
MapMarker marker = null;
Location location = null;
@ -168,7 +168,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
if (locationItem) {
holder.topDivider.setVisibility(View.VISIBLE);
holder.checkBox.setChecked(app.getItineraryHelper().isStartFromMyLocation());
holder.checkBox.setChecked(app.getMapMarkersHelper().isStartFromMyLocation());
holder.distance.setVisibility(View.GONE);
holder.description.setText(locDescription.getName());
} else if (roundTripFinishItem) {
@ -270,7 +270,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
return false;
}
int offset = showLocationItem ? 1 : 0;
Collections.swap(mapActivity.getMyApplication().getItineraryHelper().getMapMarkers(), from - offset, to - offset);
Collections.swap(mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers(), from - offset, to - offset);
Collections.swap(items, from, to);
notifyItemMoved(from, to);
return true;
@ -310,7 +310,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
lookupLocationAddress(app);
items.add(myLoc);
}
items.addAll(mapActivity.getMyApplication().getItineraryHelper().getMapMarkers());
items.addAll(mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers());
calculateStartAndFinishPos();
showRoundTripItem = inRoundTrip && !inDragAndDrop && startPos != -1;
if (showRoundTripItem) {
@ -343,7 +343,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
boolean startCalculated = false;
boolean finishCalculated = false;
boolean firstSelectedMarkerCalculated = false;
if (app.getItineraryHelper().isStartFromMyLocation() && showLocationItem) {
if (app.getMapMarkersHelper().isStartFromMyLocation() && showLocationItem) {
startPos = 0;
startCalculated = true;
if (inRoundTrip && !inDragAndDrop) {

View file

@ -56,7 +56,7 @@ public class AddFavouritesGroupBottomSheetDialogFragment extends AddGroupBottomS
if (!group.isVisible()) {
favouritesDbHelper.editFavouriteGroup(group, group.getName(), group.getColor(), true);
}
getMyApplication().getItineraryHelper().addOrEnableGroup(group);
getMyApplication().getMapMarkersHelper().addOrEnableGroup(group);
dismiss();
}
}

View file

@ -108,7 +108,7 @@ public class AddTracksGroupBottomSheetDialogFragment extends AddGroupBottomSheet
GPXFile res = GPXUtilities.loadGPXFile(gpx);
selectionHelper.selectGpxFile(res, true, false, false, false, false);
}
app.getItineraryHelper().addOrEnableGpxGroup(gpx);
app.getMapMarkersHelper().addOrEnableGpxGroup(gpx);
}
}
dismiss();

View file

@ -4,8 +4,8 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkersSortByDef;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersSortByDef;
import net.osmand.plus.R;
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
@ -38,7 +38,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
@Override
public void onClick(View v) {
if (listener != null) {
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_NAME);
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_NAME);
}
dismiss();
}
@ -56,7 +56,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
@Override
public void onClick(View v) {
if (listener != null) {
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DISTANCE_ASC);
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DISTANCE_ASC);
}
dismiss();
}
@ -72,7 +72,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
@Override
public void onClick(View v) {
if (listener != null) {
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DISTANCE_DESC);
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DISTANCE_DESC);
}
dismiss();
}
@ -90,7 +90,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
@Override
public void onClick(View v) {
if (listener != null) {
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DATE_ADDED_ASC);
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DATE_ADDED_ASC);
}
dismiss();
}
@ -106,7 +106,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
@Override
public void onClick(View v) {
if (listener != null) {
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DATE_ADDED_DESC);
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DATE_ADDED_DESC);
}
dismiss();
}

View file

@ -20,8 +20,8 @@ import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.ShortDescriptionItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import java.io.File;
import java.util.ArrayList;
@ -138,18 +138,18 @@ public class SelectWptCategoriesBottomSheetDialogFragment extends MenuBottomShee
private void updateAddOrEnableGroupWptCategories() {
OsmandApplication app = getMyApplication();
GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper();
ItineraryHelper itineraryHelper = app.getItineraryHelper();
MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper();
SelectedGpxFile selectedGpxFile = gpxSelectionHelper.getSelectedFileByPath(gpxFile.path);
if (selectedGpxFile == null) {
gpxSelectionHelper.selectGpxFile(gpxFile, true, false, false, false, false);
}
ItineraryGroup group = itineraryHelper.getMarkersGroup(gpxFile);
MapMarkersGroup group = mapMarkersHelper.getMarkersGroup(gpxFile);
if (group == null) {
group = itineraryHelper.addOrEnableGroup(gpxFile);
group = mapMarkersHelper.addOrEnableGroup(gpxFile);
}
itineraryHelper.updateGroupWptCategories(group, selectedCategories);
itineraryHelper.runSynchronization(group);
mapMarkersHelper.updateGroupWptCategories(group, selectedCategories);
mapMarkersHelper.runSynchronization(group);
}
private boolean isAllChecked() {

View file

@ -72,8 +72,8 @@ import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.TrackActivity;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.mapmarkers.CoordinateInputFormats;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.bottomsheets.CoordinateInputActionsBottomSheet;
import net.osmand.plus.mapmarkers.bottomsheets.CoordinateInputBottomSheetDialogFragment;
import net.osmand.plus.mapmarkers.bottomsheets.CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener;
@ -174,8 +174,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
}
private void syncGpx(GPXFile gpxFile) {
ItineraryHelper helper = getMyApplication().getItineraryHelper();
ItineraryGroup group = helper.getMarkersGroup(gpxFile);
MapMarkersHelper helper = getMyApplication().getMapMarkersHelper();
MapMarkersGroup group = helper.getMarkersGroup(gpxFile);
if (group != null) {
helper.runSynchronization(group);
}
@ -1095,7 +1095,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
public void saveGpx(final String fileName) {
new SaveGpxAsyncTask(app, getGpx(),fileName, false).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
hasUnsavedChanges = false;
app.getItineraryHelper().addOrEnableGroup(getGpx());
app.getMapMarkersHelper().addOrEnableGroup(getGpx());
if (listener != null) {
listener.onPointsSaved();
}

View file

@ -93,7 +93,7 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment {
ListView listView = (ListView) view.findViewById(android.R.id.list);
final ArrayAdapter<MapMarker> adapter = new MapMarkersListAdapter();
List<MapMarker> markers = getMyApplication().getItineraryHelper().getMapMarkers();
List<MapMarker> markers = getMyApplication().getMapMarkersHelper().getMapMarkers();
if (markers.size() > 0) {
for (MapMarker marker : markers) {
adapter.add(marker);

View file

@ -67,7 +67,7 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
MapMarker marker = adapter.getItem(pos);
OsmandApplication app = mapActivity.getMyApplication();
if (app.getSettings().SELECT_MARKER_ON_SINGLE_TAP.get()) {
app.getItineraryHelper().moveMarkerToTop(marker);
app.getMapMarkersHelper().moveMarkerToTop(marker);
updateAdapter();
} else {
FavouritePoint fav = marker.favouritePoint == null
@ -114,7 +114,7 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
toPosition = holder.getAdapterPosition();
if (toPosition >= 0 && fromPosition >= 0 && toPosition != fromPosition) {
hideSnackbar();
mapActivity.getMyApplication().getItineraryHelper().reorderActiveMarkersIfNeeded();
mapActivity.getMyApplication().getMapMarkersHelper().reorderActiveMarkersIfNeeded();
adapter.notifyDataSetChanged();
}
}

View file

@ -32,12 +32,12 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.fragments.CoordinateInputDialogFragment.OnPointsSavedListener;
import net.osmand.plus.mapmarkers.fragments.DirectionIndicationDialogFragment.DirectionIndicationFragmentListener;
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkersSortByDef;
import net.osmand.plus.mapmarkers.ItineraryHelper.OnGroupSyncedListener;
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersSortByDef;
import net.osmand.plus.mapmarkers.MapMarkersHelper.OnGroupSyncedListener;
import net.osmand.plus.mapmarkers.bottomsheets.OptionsBottomSheetDialogFragment;
import net.osmand.plus.mapmarkers.bottomsheets.OptionsBottomSheetDialogFragment.MarkerOptionsFragmentListener;
import net.osmand.plus.mapmarkers.bottomsheets.OrderByBottomSheetDialogFragment;
@ -223,13 +223,13 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
@Override
public void onResume() {
super.onResume();
getMyApplication().getItineraryHelper().addSyncListener(this);
getMyApplication().getMapMarkersHelper().addSyncListener(this);
}
@Override
public void onPause() {
super.onPause();
getMyApplication().getItineraryHelper().removeSyncListener(this);
getMyApplication().getMapMarkersHelper().removeSyncListener(this);
}
@Override
@ -408,7 +408,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
@Override
public void buildRouteOnClick() {
if (mapActivity != null) {
if (mapActivity.getMyApplication().getItineraryHelper().getMapMarkers().isEmpty()) {
if (mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers().isEmpty()) {
Toast.makeText(mapActivity, getString(R.string.plan_route_no_markers_toast), Toast.LENGTH_SHORT).show();
} else {
PlanRouteFragment.showInstance(mapActivity);
@ -420,7 +420,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
@Override
public void saveAsNewTrackOnClick() {
if (mapActivity != null) {
if (mapActivity.getMyApplication().getItineraryHelper().getMapMarkers().isEmpty()) {
if (mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers().isEmpty()) {
Toast.makeText(mapActivity, getString(R.string.plan_route_no_markers_toast), Toast.LENGTH_SHORT).show();
} else {
SaveAsTrackBottomSheetDialogFragment fragment = new SaveAsTrackBottomSheetDialogFragment();
@ -433,7 +433,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
@Override
public void moveAllToHistoryOnClick() {
if (mapActivity != null) {
final ItineraryHelper helper = mapActivity.getMyApplication().getItineraryHelper();
final MapMarkersHelper helper = mapActivity.getMyApplication().getMapMarkersHelper();
final List<MapMarker> markers = new ArrayList<>(helper.getMapMarkers());
helper.moveAllActiveMarkersToHistory();
if (viewPager.getCurrentItem() == ACTIVE_MARKERS_POSITION) {
@ -486,7 +486,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
@Override
public void saveGpx(final String fileName) {
final String gpxPath = mapActivity.getMyApplication().getItineraryHelper().getSaveHelper().saveMarkersToFile(fileName);
final String gpxPath = mapActivity.getMyApplication().getMapMarkersHelper().getSaveHelper().saveMarkersToFile(fileName);
snackbar = Snackbar.make(viewPager, String.format(getString(R.string.shared_string_file_is_saved), fileName) + ".", Snackbar.LENGTH_LONG)
.setAction(R.string.shared_string_show, new View.OnClickListener() {
@Override
@ -511,7 +511,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
boolean useCenter = !(mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation() && location != null);
LatLon loc = useCenter ? mapActivity.getMapLocation() : new LatLon(location.getLatitude(), location.getLongitude());
app.getItineraryHelper().sortMarkers(sortByMode, loc);
app.getMapMarkersHelper().sortMarkers(sortByMode, loc);
activeFragment.updateAdapter();
}
};

View file

@ -195,10 +195,10 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
final MapMarker marker = (MapMarker) item;
int snackbarStringRes;
if (direction == ItemTouchHelper.RIGHT) {
app.getItineraryHelper().moveMapMarkerToHistory((MapMarker) item);
app.getMapMarkersHelper().moveMapMarkerToHistory((MapMarker) item);
snackbarStringRes = R.string.marker_moved_to_history;
} else {
app.getItineraryHelper().removeMarker((MapMarker) item);
app.getMapMarkersHelper().removeMarker((MapMarker) item);
snackbarStringRes = R.string.item_removed;
}
updateAdapter();
@ -207,9 +207,9 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
@Override
public void onClick(View view) {
if (direction == ItemTouchHelper.RIGHT) {
app.getItineraryHelper().restoreMarkerFromHistory(marker, 0);
app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
} else {
app.getItineraryHelper().addMarker(marker);
app.getMapMarkersHelper().addMarker(marker);
}
updateAdapter();
}
@ -236,7 +236,7 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
OsmandApplication app = mapActivity.getMyApplication();
if (!marker.history) {
if (app.getSettings().SELECT_MARKER_ON_SINGLE_TAP.get()) {
app.getItineraryHelper().moveMarkerToTop(marker);
app.getMapMarkersHelper().moveMarkerToTop(marker);
updateAdapter();
} else {
FavouritePoint fav = marker.favouritePoint == null
@ -344,7 +344,7 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
Object item = adapter.getItem(pos);
if (item instanceof MapMarker) {
if (getMyApplication() != null) {
getMyApplication().getItineraryHelper().restoreMarkerFromHistory((MapMarker) item, 0);
getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory((MapMarker) item, 0);
}
updateAdapter();
}
@ -355,7 +355,7 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
Object item = adapter.getItem(pos);
if (item instanceof MapMarker) {
if (getMyApplication() != null) {
getMyApplication().getItineraryHelper().removeMarker((MapMarker) item);
getMyApplication().getMapMarkersHelper().removeMarker((MapMarker) item);
}
updateAdapter();
}

View file

@ -24,7 +24,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkerChangedListener;
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.adapters.MapMarkerHeaderViewHolder;
import net.osmand.plus.mapmarkers.adapters.MapMarkerItemViewHolder;
@ -152,10 +152,10 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChan
final MapMarker marker = (MapMarker) item;
int snackbarStringRes;
if (direction == ItemTouchHelper.LEFT) {
app.getItineraryHelper().restoreMarkerFromHistory((MapMarker) item, 0);
app.getMapMarkersHelper().restoreMarkerFromHistory((MapMarker) item, 0);
snackbarStringRes = R.string.marker_moved_to_active;
} else {
app.getItineraryHelper().removeMarker((MapMarker) item);
app.getMapMarkersHelper().removeMarker((MapMarker) item);
snackbarStringRes = R.string.item_removed;
}
snackbar = Snackbar.make(viewHolder.itemView, snackbarStringRes, Snackbar.LENGTH_LONG)
@ -163,9 +163,9 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChan
@Override
public void onClick(View view) {
if (direction == ItemTouchHelper.LEFT) {
app.getItineraryHelper().moveMapMarkerToHistory(marker);
app.getMapMarkersHelper().moveMapMarkerToHistory(marker);
} else {
app.getItineraryHelper().addMarker(marker);
app.getMapMarkersHelper().addMarker(marker);
}
}
});
@ -211,7 +211,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChan
recyclerView.setEmptyView(emptyView);
recyclerView.setAdapter(adapter);
app.getItineraryHelper().addListener(this);
app.getMapMarkersHelper().addListener(this);
return mainView;
}
@ -231,7 +231,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChan
public void onMakeMarkerActive(int pos) {
Object item = adapter.getItem(pos);
if (item instanceof MapMarker) {
app.getItineraryHelper().restoreMarkerFromHistory((MapMarker) item, 0);
app.getMapMarkersHelper().restoreMarkerFromHistory((MapMarker) item, 0);
}
}
@ -239,7 +239,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChan
public void onDeleteMarker(int pos) {
Object item = adapter.getItem(pos);
if (item instanceof MapMarker) {
app.getItineraryHelper().removeMarker((MapMarker) item);
app.getMapMarkersHelper().removeMarker((MapMarker) item);
}
}
};
@ -247,7 +247,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChan
@Override
public void onDestroy() {
app.getItineraryHelper().removeListener(this);
app.getMapMarkersHelper().removeListener(this);
super.onDestroy();
}

View file

@ -48,7 +48,7 @@ import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.BaseOsmAndFragment;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.MarkersPlanRouteContext;
import net.osmand.plus.mapmarkers.bottomsheets.PlanRouteOptionsBottomSheetDialogFragment;
@ -77,7 +77,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
public static final String TAG = "PlanRouteFragment";
private static final int MIN_DISTANCE_FOR_RECALCULATE = 50; // in meters
private ItineraryHelper markersHelper;
private MapMarkersHelper markersHelper;
private MarkersPlanRouteContext planRouteContext;
private MapMarkersListAdapter adapter;
@ -116,7 +116,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final MapActivity mapActivity = getMapActivity();
markersHelper = mapActivity.getMyApplication().getItineraryHelper();
markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
planRouteContext = markersHelper.getPlanRouteContext();
planRouteContext.setListener(new MarkersPlanRouteContext.PlanRouteProgressListener() {
@Override
@ -351,7 +351,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
public void onDragEnded(RecyclerView.ViewHolder holder) {
toPosition = holder.getAdapterPosition();
if (toPosition >= 0 && fromPosition >= 0) {
mapActivity.getMyApplication().getItineraryHelper().reorderActiveMarkersIfNeeded();
mapActivity.getMyApplication().getMapMarkersHelper().reorderActiveMarkersIfNeeded();
mapActivity.refreshMap();
adapter.reloadData();
try {
@ -572,7 +572,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
if (mapActivity != null) {
OsmandApplication app = mapActivity.getMyApplication();
Location myLoc = app.getLocationProvider().getLastStaleKnownLocation();
boolean startFromLocation = app.getItineraryHelper().isStartFromMyLocation() && myLoc != null;
boolean startFromLocation = app.getMapMarkersHelper().isStartFromMyLocation() && myLoc != null;
if (selectedCount > (startFromLocation ? 0 : 1)) {
sortSelectedMarkersDoorToDoor(mapActivity, startFromLocation, myLoc);
}
@ -668,7 +668,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
previousMapPosition = tileView.getMapPosition();
tileView.setMapPosition(portrait ? MIDDLE_TOP_CONSTANT : LANDSCAPE_MIDDLE_RIGHT_CONSTANT);
selectedCount = mapActivity.getMyApplication().getItineraryHelper().getSelectedMarkersCount();
selectedCount = mapActivity.getMyApplication().getMapMarkersHelper().getSelectedMarkersCount();
planRouteContext.recreateSnapTrkSegment(planRouteContext.isAdjustMapOnStart());
planRouteContext.setAdjustMapOnStart(true);
mapActivity.refreshMap();
@ -825,7 +825,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
double left = 0, right = 0;
double top = 0, bottom = 0;
Location myLocation = mapActivity.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
if (mapActivity.getMyApplication().getItineraryHelper().isStartFromMyLocation() && myLocation != null) {
if (mapActivity.getMyApplication().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) {
left = myLocation.getLongitude();
right = myLocation.getLongitude();
top = myLocation.getLatitude();
@ -879,7 +879,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
public static boolean showInstance(MapActivity mapActivity) {
try {
boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
boolean fullscreen = portrait && mapActivity.getMyApplication().getItineraryHelper().getPlanRouteContext().isMarkersListOpened();
boolean fullscreen = portrait && mapActivity.getMyApplication().getMapMarkersHelper().getPlanRouteContext().isMarkersListOpened();
int containerRes = portrait ? (fullscreen ? R.id.fragmentContainer : R.id.bottomFragmentContainer) : R.id.topFragmentContainer;
FragmentManager fm = mapActivity.getSupportFragmentManager();
fm.beginTransaction()
@ -909,7 +909,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
@Override
protected List<MapMarker> doInBackground(Void... voids) {
ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
List<MapMarker> selectedMarkers = markersHelper.getSelectedMarkers();
List<LatLon> selectedLatLon = markersHelper.getSelectedMarkersLatLon();
@ -945,7 +945,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
}
}
mapActivity.getMyApplication().getItineraryHelper().addSelectedMarkersToTop(res);
mapActivity.getMyApplication().getMapMarkersHelper().addSelectedMarkersToTop(res);
adapter.reloadData();
adapter.notifyDataSetChanged();
planRouteContext.recreateSnapTrkSegment(false);

View file

@ -8,8 +8,8 @@ import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItemType;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import java.io.File;
import java.lang.ref.WeakReference;
@ -65,8 +65,8 @@ public class DeletePointsTask extends AsyncTask<Void, Void, Void> {
}
private void syncGpx(GPXFile gpxFile) {
ItineraryHelper helper = app.getItineraryHelper();
ItineraryGroup group = helper.getMarkersGroup(gpxFile);
MapMarkersHelper helper = app.getMapMarkersHelper();
MapMarkersGroup group = helper.getMarkersGroup(gpxFile);
if (group != null) {
helper.runSynchronization(group);
}

View file

@ -49,8 +49,8 @@ import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.measurementtool.OptionsDividerItem;
import net.osmand.plus.myplaces.DeletePointsTask.OnPointsDeleteListener;
import net.osmand.plus.settings.backend.ApplicationMode;
@ -72,7 +72,7 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
private OsmandApplication app;
private GpxSelectionHelper selectedGpxHelper;
private ItineraryHelper itineraryHelper;
private MapMarkersHelper mapMarkersHelper;
private GpxDisplayGroup group;
@ -83,7 +83,7 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
}
app = requiredMyApplication();
selectedGpxHelper = app.getSelectedGpxHelper();
itineraryHelper = app.getItineraryHelper();
mapMarkersHelper = app.getMapMarkersHelper();
items.add(new TitleItem(getCategoryName(app, group.getName())));
GPXFile gpxFile = group.getGpx();
@ -192,7 +192,7 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
}
private BaseBottomSheetItem createCopyToMarkersItem(final GPXFile gpxFile) {
ItineraryGroup markersGroup = itineraryHelper.getMarkersGroup(gpxFile);
MapMarkersGroup markersGroup = mapMarkersHelper.getMarkersGroup(gpxFile);
final boolean synced = markersGroup != null && (Algorithms.isEmpty(markersGroup.getWptCategories())
|| markersGroup.getWptCategories().contains(group.getName()));
@ -216,10 +216,10 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
selectedGpxHelper.selectGpxFile(gpxFile, true, false, false, false, false);
}
boolean groupCreated = false;
ItineraryGroup markersGroup = itineraryHelper.getMarkersGroup(gpxFile);
MapMarkersGroup markersGroup = mapMarkersHelper.getMarkersGroup(gpxFile);
if (markersGroup == null) {
groupCreated = true;
markersGroup = itineraryHelper.addOrEnableGroup(gpxFile);
markersGroup = mapMarkersHelper.addOrEnableGroup(gpxFile);
}
Set<String> categories = markersGroup.getWptCategories();
Set<String> selectedCategories = new HashSet<>();
@ -232,11 +232,11 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
selectedCategories.add(group.getName());
}
if (Algorithms.isEmpty(selectedCategories)) {
itineraryHelper.removeMarkersGroup(markersGroup);
mapMarkersHelper.removeMarkersGroup(markersGroup);
} else {
itineraryHelper.updateGroupWptCategories(markersGroup, selectedCategories);
mapMarkersHelper.updateGroupWptCategories(markersGroup, selectedCategories);
if (!groupCreated) {
itineraryHelper.runSynchronization(markersGroup);
mapMarkersHelper.runSynchronization(markersGroup);
}
}
}
@ -524,8 +524,8 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
}
private void syncGpx(GPXFile gpxFile) {
ItineraryHelper markersHelper = app.getItineraryHelper();
ItineraryGroup group = markersHelper.getMarkersGroup(gpxFile);
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
MapMarkersGroup group = markersHelper.getMarkersGroup(gpxFile);
if (group != null) {
markersHelper.runSynchronization(group);
}

View file

@ -63,8 +63,8 @@ import net.osmand.plus.base.OsmandExpandableListFragment;
import net.osmand.plus.base.PointImageDrawable;
import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.mapmarkers.fragments.CoordinateInputDialogFragment;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.myplaces.DeletePointsTask.OnPointsDeleteListener;
import net.osmand.plus.myplaces.TrackBitmapDrawer.TrackBitmapDrawerListener;
import net.osmand.plus.settings.backend.OsmandSettings;
@ -399,7 +399,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
createMenuItem(menu, SHARE_ID, R.string.shared_string_share, R.drawable.ic_action_gshare_dark, MenuItem.SHOW_AS_ACTION_NEVER, true);
GPXFile gpxFile = getGpx();
if (gpxFile != null && gpxFile.path != null) {
final ItineraryHelper markersHelper = app.getItineraryHelper();
final MapMarkersHelper markersHelper = app.getMapMarkersHelper();
final boolean synced = markersHelper.getMarkersGroup(getGpx()) != null;
createMenuItem(menu, SELECT_MAP_MARKERS_ID, synced ? R.string.remove_from_map_markers
: R.string.shared_string_add_to_map_markers, R.drawable.ic_action_flag, MenuItem.SHOW_AS_ACTION_NEVER);
@ -494,15 +494,15 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
}
private void addOrRemoveMapMarkersSyncGroup() {
final ItineraryHelper markersHelper = app.getItineraryHelper();
final MapMarkersHelper markersHelper = app.getMapMarkersHelper();
FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
final GPXFile gpxFile = getGpx();
ItineraryGroup markersSearch = markersHelper.getMarkersGroup(gpxFile);
final ItineraryGroup markersGr;
MapMarkersGroup markersSearch = markersHelper.getMarkersGroup(gpxFile);
final MapMarkersGroup markersGr;
final boolean markersRemoved;
if (markersSearch != null) {
markersGr = markersSearch;
@ -538,7 +538,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements
markersHelper.addOrEnableGroup(gpxFile);
}
} else {
ItineraryGroup group = markersHelper.getMarkersGroup(gpxFile);
MapMarkersGroup group = markersHelper.getMarkersGroup(gpxFile);
if (group != null) {
markersHelper.removeMarkersGroup(group);
}

View file

@ -45,7 +45,7 @@ import net.osmand.plus.helpers.MapMarkerDialogHelper;
import net.osmand.plus.helpers.WaypointDialogHelper;
import net.osmand.plus.mapcontextmenu.other.FavouritesBottomSheetMenuFragment;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu.PointType;
import net.osmand.plus.search.QuickSearchDialogFragment;
import net.osmand.plus.widgets.style.CustomTypefaceSpan;
@ -306,7 +306,7 @@ public class AddPointBottomSheetDialog extends MenuBottomSheetDialogFragment {
List<Object> items = new ArrayList<>();
MarkersItemsAdapter adapter = new MarkersItemsAdapter(app, items);
adapter.setItemClickListener(getAdapterOnClickListener(items));
ItineraryHelper helper = app.getItineraryHelper();
MapMarkersHelper helper = app.getMapMarkersHelper();
items.add(MARKERS);
items.addAll(helper.getMapMarkers());
BaseBottomSheetItem scrollItem = new HorizontalRecyclerBottomSheetItem.Builder()

View file

@ -715,7 +715,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
}
// Map markers card
List<MapMarker> mapMarkers = app.getItineraryHelper().getMapMarkers();
List<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkers();
if (mapMarkers.size() > 0) {
MapMarkersCard mapMarkersCard = new MapMarkersCard(mapActivity, mapMarkers);
menuCards.add(mapMarkersCard);
@ -2054,7 +2054,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
MapMarker m = null;
List<MapMarker> mapMarkers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers();
List<MapMarker> mapMarkers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers();
if (index != -1 && mapMarkers.size() > index) {
m = mapMarkers.get(index);
}

View file

@ -13,8 +13,8 @@ import net.osmand.plus.R;
import net.osmand.plus.mapmarkers.ItineraryType;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.settings.backend.ExportSettingsType;
import net.osmand.util.Algorithms;
@ -29,7 +29,7 @@ import static net.osmand.IndexConstants.GPX_FILE_EXT;
public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
private ItineraryHelper markersHelper;
private MapMarkersHelper markersHelper;
public HistoryMarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List<MapMarker> items) {
super(app, null, items);
@ -46,7 +46,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
@Override
protected void init() {
super.init();
markersHelper = app.getItineraryHelper();
markersHelper = app.getMapMarkersHelper();
existingItems = new ArrayList<>(markersHelper.getMapMarkersFromDefaultGroups(true));
}
@ -123,10 +123,10 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
}
}
public ItineraryGroup getMarkersGroup() {
public MapMarkersGroup getMarkersGroup() {
String name = app.getString(R.string.markers_history);
String groupId = ExportSettingsType.HISTORY_MARKERS.name();
ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS);
MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, ItineraryType.MARKERS);
markersGroup.setMarkers(items);
return markersGroup;
}

View file

@ -13,8 +13,8 @@ import net.osmand.plus.R;
import net.osmand.plus.mapmarkers.ItineraryType;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.settings.backend.ExportSettingsType;
import net.osmand.util.Algorithms;
@ -29,7 +29,7 @@ import static net.osmand.IndexConstants.GPX_FILE_EXT;
public class MarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
private ItineraryHelper markersHelper;
private MapMarkersHelper markersHelper;
public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List<MapMarker> items) {
super(app, null, items);
@ -46,7 +46,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
@Override
protected void init() {
super.init();
markersHelper = app.getItineraryHelper();
markersHelper = app.getMapMarkersHelper();
existingItems = new ArrayList<>(markersHelper.getMapMarkersFromDefaultGroups(false));
}
@ -123,10 +123,10 @@ public class MarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
}
}
public ItineraryGroup getMarkersGroup() {
public MapMarkersGroup getMarkersGroup() {
String name = app.getString(R.string.map_markers);
String groupId = ExportSettingsType.ACTIVE_MARKERS.name();
ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS);
MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, ItineraryType.MARKERS);
markersGroup.setMarkers(items);
return markersGroup;
}

View file

@ -32,7 +32,7 @@ import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.helpers.GpxUiHelper.GPXInfo;
import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.ItineraryType;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.onlinerouting.engine.OnlineRoutingEngine;
@ -606,19 +606,19 @@ public class SettingsHelper {
myPlacesItems.put(ExportSettingsType.MULTIMEDIA_NOTES, files);
}
}
List<MapMarker> mapMarkers = app.getItineraryHelper().getMapMarkersFromDefaultGroups(false);
List<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(false);
if (!mapMarkers.isEmpty()) {
String name = app.getString(R.string.map_markers);
String groupId = ExportSettingsType.ACTIVE_MARKERS.name();
ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS);
MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, ItineraryType.MARKERS);
markersGroup.setMarkers(mapMarkers);
myPlacesItems.put(ExportSettingsType.ACTIVE_MARKERS, Collections.singletonList(markersGroup));
}
List<MapMarker> markersHistory = app.getItineraryHelper().getMapMarkersFromDefaultGroups(true);
List<MapMarker> markersHistory = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(true);
if (!markersHistory.isEmpty()) {
String name = app.getString(R.string.shared_string_history);
String groupId = ExportSettingsType.HISTORY_MARKERS.name();
ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS);
MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, ItineraryType.MARKERS);
markersGroup.setMarkers(markersHistory);
myPlacesItems.put(ExportSettingsType.HISTORY_MARKERS, Collections.singletonList(markersGroup));
}
@ -721,8 +721,8 @@ public class SettingsHelper {
List<FavoriteGroup> favoriteGroups = new ArrayList<>();
List<OsmNotesPoint> osmNotesPointList = new ArrayList<>();
List<OpenstreetmapPoint> osmEditsPointList = new ArrayList<>();
List<ItineraryGroup> markersGroups = new ArrayList<>();
List<ItineraryGroup> markersHistoryGroups = new ArrayList<>();
List<MapMarkersGroup> markersGroups = new ArrayList<>();
List<MapMarkersGroup> markersHistoryGroups = new ArrayList<>();
List<HistoryEntry> historyEntries = new ArrayList<>();
List<OnlineRoutingEngine> onlineRoutingEngines = new ArrayList<>();
@ -756,12 +756,12 @@ public class SettingsHelper {
osmEditsPointList.add((OpenstreetmapPoint) object);
} else if (object instanceof FavoriteGroup) {
favoriteGroups.add((FavoriteGroup) object);
} else if (object instanceof ItineraryGroup) {
ItineraryGroup markersGroup = (ItineraryGroup) object;
} else if (object instanceof MapMarkersGroup) {
MapMarkersGroup markersGroup = (MapMarkersGroup) object;
if (ExportSettingsType.ACTIVE_MARKERS.name().equals(markersGroup.getId())) {
markersGroups.add((ItineraryGroup) object);
markersGroups.add((MapMarkersGroup) object);
} else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) {
markersHistoryGroups.add((ItineraryGroup) object);
markersHistoryGroups.add((MapMarkersGroup) object);
}
} else if (object instanceof HistoryEntry) {
historyEntries.add((HistoryEntry) object);
@ -813,7 +813,7 @@ public class SettingsHelper {
}
if (!markersGroups.isEmpty()) {
List<MapMarker> mapMarkers = new ArrayList<>();
for (ItineraryGroup group : markersGroups) {
for (MapMarkersGroup group : markersGroups) {
mapMarkers.addAll(group.getMarkers());
}
MarkersSettingsItem baseItem = getBaseItem(SettingsItemType.ACTIVE_MARKERS, MarkersSettingsItem.class, settingsItems);
@ -821,7 +821,7 @@ public class SettingsHelper {
}
if (!markersHistoryGroups.isEmpty()) {
List<MapMarker> mapMarkers = new ArrayList<>();
for (ItineraryGroup group : markersHistoryGroups) {
for (MapMarkersGroup group : markersHistoryGroups) {
mapMarkers.addAll(group.getMarkers());
}
HistoryMarkersSettingsItem baseItem = getBaseItem(SettingsItemType.HISTORY_MARKERS, HistoryMarkersSettingsItem.class, settingsItems);
@ -911,8 +911,8 @@ public class SettingsHelper {
List<OsmNotesPoint> notesPointList = new ArrayList<>();
List<OpenstreetmapPoint> editsPointList = new ArrayList<>();
List<FavoriteGroup> favoriteGroups = new ArrayList<>();
List<ItineraryGroup> markersGroups = new ArrayList<>();
List<ItineraryGroup> markersHistoryGroups = new ArrayList<>();
List<MapMarkersGroup> markersGroups = new ArrayList<>();
List<MapMarkersGroup> markersHistoryGroups = new ArrayList<>();
List<HistoryEntry> historyEntries = new ArrayList<>();
List<OnlineRoutingEngine> onlineRoutingEngines = new ArrayList<>();

View file

@ -41,7 +41,7 @@ import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo;
import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.onlinerouting.engine.OnlineRoutingEngine;
import net.osmand.plus.osmedit.OpenstreetmapPoint;
import net.osmand.plus.osmedit.OsmEditingPlugin;
@ -377,8 +377,8 @@ public class ExportItemsBottomSheet extends MenuBottomSheetDialogFragment {
GlobalSettingsItem globalSettingsItem = (GlobalSettingsItem) object;
item.setTitle(globalSettingsItem.getPublicName(app));
item.setIcon(uiUtilities.getIcon(R.drawable.ic_action_settings, getItemIconColor(object)));
} else if (object instanceof ItineraryGroup) {
ItineraryGroup markersGroup = (ItineraryGroup) object;
} else if (object instanceof MapMarkersGroup) {
MapMarkersGroup markersGroup = (MapMarkersGroup) object;
if (ExportSettingsType.ACTIVE_MARKERS.name().equals(markersGroup.getId())) {
item.setTitle(getString(R.string.map_markers));
item.setIcon(uiUtilities.getIcon(R.drawable.ic_action_flag, getItemIconColor(object)));

View file

@ -18,7 +18,7 @@ import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.settings.backend.ExportSettingsCategory;
import net.osmand.plus.settings.backend.ExportSettingsType;
import net.osmand.plus.settings.backend.backup.FileSettingsItem;
@ -311,8 +311,8 @@ public class ExportSettingsAdapter extends OsmandBaseExpandableListAdapter {
itemsSize += ((FileSettingsItem) object).getSize();
} else if (object instanceof File) {
itemsSize += ((File) object).length();
} else if (object instanceof ItineraryGroup) {
int selectedMarkers = ((ItineraryGroup) object).getMarkers().size();
} else if (object instanceof MapMarkersGroup) {
int selectedMarkers = ((MapMarkersGroup) object).getMarkers().size();
String itemsDescr = app.getString(R.string.shared_string_items);
return app.getString(R.string.ltr_or_rtl_combine_via_colon, itemsDescr, selectedMarkers);
}

View file

@ -20,7 +20,7 @@ import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.R;
import net.osmand.plus.base.PointImageDrawable;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.views.OsmandMapLayer;
import net.osmand.plus.views.OsmandMapTileView;
@ -39,7 +39,7 @@ public class FavouritesLayer extends OsmandMapLayer implements IContextMenuProvi
protected OsmandMapTileView view;
private FavouritesDbHelper favouritesDbHelper;
private ItineraryHelper itineraryHelper;
private MapMarkersHelper mapMarkersHelper;
protected List<FavouritePoint> cache = new ArrayList<>();
private MapTextLayer textLayer;
@ColorInt
@ -57,7 +57,7 @@ public class FavouritesLayer extends OsmandMapLayer implements IContextMenuProvi
this.view = view;
settings = view.getApplication().getSettings();
favouritesDbHelper = view.getApplication().getFavorites();
itineraryHelper = view.getApplication().getItineraryHelper();
mapMarkersHelper = view.getApplication().getMapMarkersHelper();
textLayer = view.getLayerByClass(MapTextLayer.class);
defaultColor = ContextCompat.getColor(view.getContext(), R.color.color_favorite);
grayColor = ContextCompat.getColor(view.getContext(), R.color.color_favorite_gray);
@ -85,7 +85,7 @@ public class FavouritesLayer extends OsmandMapLayer implements IContextMenuProvi
if (contextMenuLayer.getMoveableObject() instanceof FavouritePoint) {
FavouritePoint objectInMotion = (FavouritePoint) contextMenuLayer.getMoveableObject();
PointF pf = contextMenuLayer.getMovableCenterPoint(tileBox);
MapMarker mapMarker = itineraryHelper.getMapMarker(objectInMotion);
MapMarker mapMarker = mapMarkersHelper.getMapMarker(objectInMotion);
float textScale = this.settings.TEXT_SCALE.get();
drawBigPoint(canvas, objectInMotion, pf.x, pf.y, mapMarker, textScale);
}
@ -106,7 +106,7 @@ public class FavouritesLayer extends OsmandMapLayer implements IContextMenuProvi
List<LatLon> smallObjectsLatLon = new ArrayList<>();
for (FavoriteGroup group : favouritesDbHelper.getFavoriteGroups()) {
List<Pair<FavouritePoint, MapMarker>> fullObjects = new ArrayList<>();
boolean synced = itineraryHelper.getMarkersGroup(group) != null;
boolean synced = mapMarkersHelper.getMarkersGroup(group) != null;
for (FavouritePoint favoritePoint : group.getPoints()) {
double lat = favoritePoint.getLatitude();
double lon = favoritePoint.getLongitude();
@ -115,7 +115,7 @@ public class FavouritesLayer extends OsmandMapLayer implements IContextMenuProvi
&& lon >= latLonBounds.left && lon <= latLonBounds.right) {
MapMarker marker = null;
if (synced) {
if ((marker = itineraryHelper.getMapMarker(favoritePoint)) == null) {
if ((marker = mapMarkersHelper.getMapMarker(favoritePoint)) == null) {
continue;
}
}

View file

@ -47,8 +47,8 @@ import net.osmand.plus.base.PointImageDrawable;
import net.osmand.plus.mapcontextmenu.controllers.SelectedGpxMenuController.SelectedGpxPoint;
import net.osmand.plus.mapcontextmenu.other.TrackChartPoints;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.ItineraryGroup;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersGroup;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.render.OsmandRenderer;
import net.osmand.plus.render.OsmandRenderer.RenderingContext;
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
@ -118,7 +118,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
private TrackChartPoints trackChartPoints;
private GpxDbHelper gpxDbHelper;
private ItineraryHelper itineraryHelper;
private MapMarkersHelper mapMarkersHelper;
private GpxSelectionHelper selectedGpxHelper;
private final Map<String, CachedTrack> segmentsCache = new HashMap<>();
@ -165,7 +165,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
this.view = view;
gpxDbHelper = view.getApplication().getGpxDbHelper();
selectedGpxHelper = view.getApplication().getSelectedGpxHelper();
itineraryHelper = view.getApplication().getItineraryHelper();
mapMarkersHelper = view.getApplication().getMapMarkersHelper();
osmandRenderer = view.getApplication().getResourceManager().getRenderer().getRenderer();
currentTrackColorPref = view.getSettings().CURRENT_TRACK_COLOR;
@ -259,7 +259,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
SelectedGpxFile gpxFile = pointFileMap.get(objectInMotion);
if (gpxFile != null) {
PointF pf = contextMenuLayer.getMovableCenterPoint(tileBox);
MapMarker mapMarker = itineraryHelper.getMapMarker(objectInMotion);
MapMarker mapMarker = mapMarkersHelper.getMapMarker(objectInMotion);
float textScale = view.getSettings().TEXT_SCALE.get();
drawBigPoint(canvas, objectInMotion, getFileColor(gpxFile), pf.x, pf.y, mapMarker, textScale);
}
@ -543,7 +543,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
for (SelectedGpxFile g : selectedGPXFiles) {
List<Pair<WptPt, MapMarker>> fullObjects = new ArrayList<>();
int fileColor = getFileColor(g);
boolean synced = itineraryHelper.getMarkersGroup(g.getGpxFile()) != null;
boolean synced = mapMarkersHelper.getMarkersGroup(g.getGpxFile()) != null;
for (WptPt wpt : getListStarPoints(g)) {
if (wpt.lat >= latLonBounds.bottom && wpt.lat <= latLonBounds.top
&& wpt.lon >= latLonBounds.left && wpt.lon <= latLonBounds.right
@ -551,7 +551,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
pointFileMap.put(wpt, g);
MapMarker marker = null;
if (synced) {
if ((marker = itineraryHelper.getMapMarker(wpt)) == null) {
if ((marker = mapMarkersHelper.getMapMarker(wpt)) == null) {
continue;
}
}
@ -1226,9 +1226,9 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
}
private void syncGpx(GPXFile gpxFile) {
ItineraryGroup group = view.getApplication().getItineraryHelper().getMarkersGroup(gpxFile);
MapMarkersGroup group = view.getApplication().getMapMarkersHelper().getMarkersGroup(gpxFile);
if (group != null) {
itineraryHelper.runSynchronization(group);
mapMarkersHelper.runSynchronization(group);
}
}

View file

@ -31,7 +31,7 @@ import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.data.QuadPoint;
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.OsmAndConstants;
import net.osmand.plus.OsmAndFormatter;
@ -251,7 +251,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
} else {
myLoc = app.getLocationProvider().getLastStaleKnownLocation();
}
ItineraryHelper markersHelper = app.getItineraryHelper();
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
List<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
int displayedWidgets = settings.DISPLAYED_MARKERS_WIDGETS_COUNT.get();
@ -340,7 +340,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
int displayedWidgets = settings.DISPLAYED_MARKERS_WIDGETS_COUNT.get();
ItineraryHelper markersHelper = map.getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
for (MapMarker marker : markersHelper.getMapMarkers()) {
if (isLocationVisible(tileBox, marker) && !overlappedByWaypoint(marker)
@ -516,7 +516,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|| !settings.SHOW_MAP_MARKERS.get()) {
return false;
}
final ItineraryHelper helper = map.getMyApplication().getItineraryHelper();
final MapMarkersHelper helper = map.getMyApplication().getMapMarkersHelper();
final MapMarker old = helper.getMapMarkers().get(0);
helper.moveMarkerToTop((MapMarker) o);
String title = map.getString(R.string.marker_activated, helper.getMapMarkers().get(0).getName(map));
@ -546,7 +546,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
int r = getDefaultRadiusPoi(tileBox);
boolean selectMarkerOnSingleTap = app.getSettings().SELECT_MARKER_ON_SINGLE_TAP.get();
for (MapMarker marker : app.getItineraryHelper().getMapMarkers()) {
for (MapMarker marker : app.getMapMarkersHelper().getMapMarkers()) {
if ((!unknownLocation && selectMarkerOnSingleTap) || !isSynced(marker)) {
LatLon latLon = marker.point;
if (latLon != null) {
@ -639,7 +639,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
boolean result = false;
MapMarker newObject = null;
if (o instanceof MapMarker) {
ItineraryHelper markersHelper = map.getMyApplication().getItineraryHelper();
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
MapMarker marker = (MapMarker) o;
PointDescription originalDescription = marker.getOriginalPointDescription();

View file

@ -15,7 +15,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.mapmarkers.MapMarker;
import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment;
import net.osmand.plus.mapmarkers.ItineraryHelper;
import net.osmand.plus.mapmarkers.MapMarkersHelper;
import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.DirectionDrawable;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
@ -32,7 +32,7 @@ public class MapMarkersWidgetsFactory {
public static final int MIN_DIST_2ND_ROW_SHOW = 150; // meters
private final MapActivity map;
private ItineraryHelper helper;
private MapMarkersHelper helper;
private boolean portraitMode;
private View topBar;
@ -56,7 +56,7 @@ public class MapMarkersWidgetsFactory {
public MapMarkersWidgetsFactory(final MapActivity map) {
this.map = map;
helper = map.getMyApplication().getItineraryHelper();
helper = map.getMyApplication().getMapMarkersHelper();
portraitMode = AndroidUiHelper.isOrientationPortrait(map);
topBar = map.findViewById(R.id.map_markers_top_bar);
@ -288,7 +288,7 @@ public class MapMarkersWidgetsFactory {
private boolean firstMarker;
private final OsmandMapTileView view;
private MapActivity map;
private ItineraryHelper helper;
private MapMarkersHelper helper;
private float[] calculations = new float[1];
private int cachedMeters;
private int cachedMarkerColorIndex = -1;
@ -299,7 +299,7 @@ public class MapMarkersWidgetsFactory {
this.map = map;
this.firstMarker = firstMarker;
this.view = map.getMapView();
helper = map.getMyApplication().getItineraryHelper();
helper = map.getMyApplication().getMapMarkersHelper();
setText(null, null);
setOnClickListener(new View.OnClickListener() {

View file

@ -495,7 +495,7 @@ public class RouteInfoWidgetsFactory {
Location myLocation = getApplication().getLocationProvider().getLastKnownLocation();
LatLon l = getNextTargetPoint();
if (l == null) {
List<MapMarker> markers = getApplication().getItineraryHelper().getMapMarkers();
List<MapMarker> markers = getApplication().getMapMarkersHelper().getMapMarkers();
if (markers.size() > 0) {
l = markers.get(0).point;
}