diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index e82907a9e4..68aa38db7e 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 : ""); - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); 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); - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); List mapMarkers = markersHelper.getMapMarkers(); for (MapMarker m : mapMarkers) { if (m.getOnlyName().equals(name)) { @@ -1085,7 +1085,7 @@ public class OsmandAidlApi { boolean removeAllActiveMapMarkers() { boolean refreshNeeded = false; - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); List 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()); - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); List mapMarkers = markersHelper.getMapMarkers(); for (MapMarker m : mapMarkers) { if (m.getOnlyName().equals(prevName)) { diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 07bb9084e8..e9a1b6c979 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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.mapMarkersHelper = startupInit(new MapMarkersHelper(app), MapMarkersHelper.class); + app.itineraryHelper = startupInit(new ItineraryHelper(app), ItineraryHelper.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.mapMarkersHelper.syncAllGroupsAsync(); + app.itineraryHelper.syncAllGroupsAsync(); app.searchUICore.initSearchUICore(); checkLiveUpdatesAlerts(); diff --git a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java index 0eba1b2b1a..65d79cad5b 100644 --- a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java +++ b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java @@ -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.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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.getMapMarkersHelper().addOrEnableGroup(gpx); + app.getItineraryHelper().addOrEnableGroup(gpx); } return selectGpxFile(gpx, dataItem, show, notShowNavigationDialog, syncGroup, selectedByUser, addToHistory); } @@ -825,10 +825,10 @@ public class GpxSelectionHelper { } private void syncGpxWithMarkers(GPXFile gpxFile) { - MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper(); - MapMarkersGroup group = mapMarkersHelper.getMarkersGroup(gpxFile); + ItineraryHelper itineraryHelper = app.getItineraryHelper(); + ItineraryGroup group = itineraryHelper.getMarkersGroup(gpxFile); if (group != null) { - mapMarkersHelper.runSynchronization(group); + itineraryHelper.runSynchronization(group); } } diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index cd3fa4b5ad..0b43a714bb 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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; - MapMarkersHelper mapMarkersHelper; + ItineraryHelper itineraryHelper; MapMarkersDbHelper mapMarkersDbHelper; WaypointHelper waypointHelper; RoutingOptionsHelper routingOptionsHelper; @@ -688,8 +688,8 @@ public class OsmandApplication extends MultiDexApplication { return targetPointsHelper; } - public MapMarkersHelper getMapMarkersHelper() { - return mapMarkersHelper; + public ItineraryHelper getItineraryHelper() { + return itineraryHelper; } public MapMarkersDbHelper getMapMarkersDbHelper() { diff --git a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java index 001868e7b4..484e328d5b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java @@ -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.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; 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 MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + final ItineraryHelper markersHelper = app.getItineraryHelper(); final FavoriteGroup favGroup = this.group; - final MapMarkersGroup markersGr = markersHelper.getMarkersGroup(this.group); + final ItineraryGroup markersGr = markersHelper.getMarkersGroup(this.group); final boolean synced = markersGr != null; BaseBottomSheetItem markersGroupItem = new SimpleBottomSheetItem.Builder() diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index a24859fa30..12aa536a4e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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) { - MapMarkersHelper markersHelper = getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = getMyApplication().getItineraryHelper(); List points = new ArrayList<>(); List names = new ArrayList<>(); for (Map.Entry> entry : favoritesSelected.entrySet()) { diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 50d7ea0b18..b5f26d857f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -111,8 +111,8 @@ 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.MapMarkersHelper.MapMarkerChangedListener; -import net.osmand.plus.mapmarkers.PlanRouteFragment; +import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkerChangedListener; +import net.osmand.plus.mapmarkers.fragments.PlanRouteFragment; import net.osmand.plus.measurementtool.GpxApproximationFragment; import net.osmand.plus.measurementtool.GpxData; import net.osmand.plus.measurementtool.LoginBottomSheetFragment; @@ -407,7 +407,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven @Override protected void onSaveInstanceState(Bundle outState) { if (removeFragment(PlanRouteFragment.TAG)) { - app.getMapMarkersHelper().getPlanRouteContext().setFragmentVisible(true); + app.getItineraryHelper().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.getMapMarkersHelper().lookupAddressAll(); + app.getItineraryHelper().lookupAddressAll(); } if (event == InitEvents.FAVORITES_INITIALIZED) { refreshMap(); @@ -723,7 +723,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven long tm = System.currentTimeMillis(); - if (app.getMapMarkersHelper().getPlanRouteContext().isFragmentVisible()) { + if (app.getItineraryHelper().getPlanRouteContext().isFragmentVisible()) { PlanRouteFragment.showInstance(this); } @@ -811,7 +811,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven } routingHelper.addListener(this); - app.getMapMarkersHelper().addListener(this); + app.getItineraryHelper().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.getMapMarkersHelper().removeListener(this); + app.getItineraryHelper().removeListener(this); app.getRoutingHelper().removeListener(this); app.getDownloadThread().resetUiActivity(this); if (atlasMapRendererView != null) { diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 35d88627c2..47c2b1cb2f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -46,18 +46,16 @@ import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.UiUtilities; -import net.osmand.plus.Version; import net.osmand.plus.activities.actions.OsmAndDialogs; import net.osmand.plus.dashboard.DashboardOnMap.DashboardType; import net.osmand.plus.dialogs.FavoriteDialogs; import net.osmand.plus.dialogs.SpeedCamerasBottomSheet; import net.osmand.plus.download.IndexItem; -import net.osmand.plus.liveupdates.OsmLiveActivity; import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment; import net.osmand.plus.mapcontextmenu.AdditionalActionsBottomSheetDialogFragment.ContextMenuItemClickListener; import net.osmand.plus.mapmarkers.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkersDialogFragment; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment; +import net.osmand.plus.mapmarkers.ItineraryHelper; import net.osmand.plus.mapmarkers.MarkersPlanRouteContext; import net.osmand.plus.measurementtool.MeasurementToolFragment; import net.osmand.plus.measurementtool.StartPlanRouteBottomSheet; @@ -107,7 +105,6 @@ import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_HELP_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_MAP_MARKERS_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_MEASURE_DISTANCE_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_MY_PLACES_ID; -import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_OSMAND_LIVE_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_PLUGINS_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SEARCH_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SETTINGS_ID; @@ -184,7 +181,7 @@ public class MapActivityActions implements DialogProvider { public void addMapMarker(double latitude, double longitude, PointDescription pd, @Nullable String mapObjectName) { - MapMarkersHelper markersHelper = getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = getMyApplication().getItineraryHelper(); markersHelper.addMapMarker(new LatLon(latitude, longitude), pd, mapObjectName); } @@ -616,7 +613,7 @@ public class MapActivityActions implements DialogProvider { } public ApplicationMode getRouteMode(LatLon from) { - MarkersPlanRouteContext planRouteContext = mapActivity.getMyApplication().getMapMarkersHelper().getPlanRouteContext(); + MarkersPlanRouteContext planRouteContext = mapActivity.getMyApplication().getItineraryHelper().getPlanRouteContext(); if (planRouteContext.isNavigationFromMarkers() && planRouteContext.getSnappedMode() != ApplicationMode.DEFAULT) { planRouteContext.setNavigationFromMarkers(false); return planRouteContext.getSnappedMode(); diff --git a/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java b/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java index e249fc2770..c044626f20 100644 --- a/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java @@ -34,7 +34,7 @@ import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.LockableViewPager; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.mapmarkers.CoordinateInputDialogFragment; +import net.osmand.plus.mapmarkers.fragments.CoordinateInputDialogFragment; import net.osmand.plus.measurementtool.GpxData; import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.myplaces.SplitSegmentDialogFragment; diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index d220b8bec1..b58ef78260 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -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.MapMarkersHelper.MapMarkerChangedListener; +import net.osmand.plus.mapmarkers.ItineraryHelper.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.getMapMarkersHelper().addListener(this); + app.getItineraryHelper().addListener(this); } @Override diff --git a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java index d0d2b6dbd7..023bbf744f 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 : ""); - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); markersHelper.addMapMarker(new LatLon(lat, lon), pd); MapMarker marker = markersHelper.getFirstMapMarker(); diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index 5d540d5170..639df58054 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -18,8 +18,8 @@ import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.PluginsFragment; import net.osmand.plus.dashboard.DashboardOnMap.DashboardType; -import net.osmand.plus.mapmarkers.MapMarkersDialogFragment; -import net.osmand.plus.mapmarkers.MapMarkersGroup; +import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment; +import net.osmand.plus.mapmarkers.ItineraryGroup; 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(MapMarkersGroup.MARKERS_SYNC_GROUP_ID)); + MapMarkersDialogFragment.showInstance(mapActivity, openMapMarkersGroupsExtra.getString(ItineraryGroup.MARKERS_SYNC_GROUP_ID)); } mapActivity.setIntent(null); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index cf032a5393..2bb6b53a92 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -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.MapMarkersHelper.MapMarkerChangedListener; +import net.osmand.plus.mapmarkers.ItineraryHelper.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.getMapMarkersHelper().addListener(this); + app.getItineraryHelper().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().getMapMarkersHelper().removeListener(this); + mapActivity.getMyApplication().getItineraryHelper().removeListener(this); } MenuController menuController = getMenuController(); if (menuController != null) { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index e67b8dc11b..8501d57838 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -60,7 +60,7 @@ public class AmenityMenuController extends MenuController { } String mapNameForMarker = amenity.getName() + "_" + amenity.getType().getKeyName(); - marker = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarker(mapNameForMarker, amenity.getLocation()); + marker = mapActivity.getMyApplication().getItineraryHelper().getMapMarker(mapNameForMarker, amenity.getLocation()); if (marker != null) { MapMarkerMenuController markerMenuController = new MapMarkerMenuController(mapActivity, marker.getPointDescription(mapActivity), marker); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java index 84ced6c613..a57aca19c7 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper(); + final ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper(); mapMarker = markersHelper.getMapMarker(fav); if (mapMarker == null) { mapMarker = markersHelper.getMapMarker(new LatLon(fav.getLatitude(), fav.getLongitude())); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java index 29bc7c01aa..fc84698f1e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java @@ -11,7 +11,7 @@ import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import net.osmand.data.PointDescription; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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) { - MapMarkersHelper markersHelper = activity.getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = activity.getMyApplication().getItineraryHelper(); 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); } - MapMarkersHelper markersHelper = activity.getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = activity.getMyApplication().getItineraryHelper(); markersHelper.moveMarkerToTop(getMapMarker()); activity.getContextMenu().close(); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java index 95a266563c..7433373950 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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; - MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper(); mapMarker = markersHelper.getMapMarker(wpt); if (mapMarker == null) { mapMarker = markersHelper.getMapMarker(new LatLon(wpt.lat, wpt.lon)); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java index e580edd6eb..247c5b5c52 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java @@ -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.getMapMarkersHelper().updateMapMarker(marker, true); + app.getItineraryHelper().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.getMapMarkersHelper().removeMarker(marker); + app.getItineraryHelper().removeMarker(marker); } if (needDismiss) { dismiss(true); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java index 2d0654301b..ef689af104 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java @@ -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.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; 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) { - MapMarkersHelper helper = app.getMapMarkersHelper(); - MapMarkersGroup group = helper.getMarkersGroup(gpxFile); + ItineraryHelper helper = app.getItineraryHelper(); + ItineraryGroup group = helper.getMarkersGroup(gpxFile); if (group != null) { helper.runSynchronization(group); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java index 7ecd61565f..bd0eba17e7 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java @@ -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.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; 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) { - MapMarkersHelper helper = app.getMapMarkersHelper(); - MapMarkersGroup group = helper.getMarkersGroup(gpxFile); + ItineraryHelper helper = app.getItineraryHelper(); + ItineraryGroup group = helper.getMarkersGroup(gpxFile); if (group != null) { helper.runSynchronization(group); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java deleted file mode 100644 index 47353e409f..0000000000 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java +++ /dev/null @@ -1,4 +0,0 @@ -package net.osmand.plus.mapmarkers; - -import androidx.annotation.DrawableRes; - diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java b/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java index c5c97a1c2e..8718357bb2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java @@ -6,9 +6,9 @@ public class GroupHeader { @DrawableRes private int iconRes; - private MapMarkersGroup group; + private ItineraryGroup group; - public GroupHeader(int iconRes, MapMarkersGroup group) { + public GroupHeader(int iconRes, ItineraryGroup group) { this.iconRes = iconRes; this.group = group; } @@ -18,7 +18,7 @@ public class GroupHeader { return iconRes; } - public MapMarkersGroup getGroup() { + public ItineraryGroup getGroup() { return group; } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java index 2060140d3d..df034369d8 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java @@ -45,11 +45,11 @@ public class MarkersPlanRouteContext { private boolean adjustMapOnStart = true; private boolean navigationFromMarkers; - Map, List> getSnappedToRoadPoints() { + public Map, List> getSnappedToRoadPoints() { return snappedToRoadPoints; } - TrkSegment getSnapTrkSegment() { + public TrkSegment getSnapTrkSegment() { return snapTrkSegment; } @@ -57,7 +57,7 @@ public class MarkersPlanRouteContext { return snappedMode; } - void setSnappedMode(ApplicationMode snappedMode) { + public void setSnappedMode(ApplicationMode snappedMode) { this.snappedMode = snappedMode; } @@ -69,11 +69,11 @@ public class MarkersPlanRouteContext { this.listener = listener; } - boolean isProgressBarVisible() { + public boolean isProgressBarVisible() { return progressBarVisible; } - void setProgressBarVisible(boolean progressBarVisible) { + public void setProgressBarVisible(boolean progressBarVisible) { this.progressBarVisible = progressBarVisible; } @@ -113,7 +113,7 @@ public class MarkersPlanRouteContext { this.app = app; } - void cancelSnapToRoad() { + public void cancelSnapToRoad() { listener.hideProgressBar(true); snapToRoadPairsToCalculate.clear(); if (calculationProgress != null) { @@ -151,7 +151,7 @@ public class MarkersPlanRouteContext { } } - void recreateSnapTrkSegment(boolean adjustMap) { + public void recreateSnapTrkSegment(boolean adjustMap) { snapTrkSegment.points.clear(); List points = getPointsToCalculate(); if (snappedMode == ApplicationMode.DEFAULT) { @@ -178,7 +178,7 @@ public class MarkersPlanRouteContext { } private List getPointsToCalculate() { - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); List points = new LinkedList<>(); Location myLoc = app.getLocationProvider().getLastStaleKnownLocation(); if (markersHelper.isStartFromMyLocation() && myLoc != null) { @@ -281,7 +281,7 @@ public class MarkersPlanRouteContext { return params; } - interface PlanRouteProgressListener { + public interface PlanRouteProgressListener { void showProgressBar(); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index 2fa206d08f..4c1afc1eca 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -13,13 +13,14 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.snackbar.Snackbar; import net.osmand.data.LatLon; -import net.osmand.plus.mapmarkers.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmAndFormatter; 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.ItineraryType; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.util.Algorithms; import java.util.Collections; @@ -43,7 +44,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter mapMarkers = app.getMapMarkersHelper().getMapMarkers(); + List mapMarkers = app.getItineraryHelper().getMapMarkers(); int markersCount = mapMarkers.size(); showDirectionMarkers = new ArrayList<>(mapMarkers.subList(0, getToIndex(markersCount))); } @@ -101,9 +101,9 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter(); - MapMarkersHelper helper = app.getMapMarkersHelper(); + ItineraryHelper helper = app.getItineraryHelper(); helper.updateGroups(); - List groups = new ArrayList<>(helper.getMapMarkersGroups()); + List groups = new ArrayList<>(helper.getItineraryGroups()); groups.addAll(helper.getGroupsForDisplayedGpx()); groups.addAll(helper.getGroupsForSavedArticlesTravelBook()); @@ -134,7 +134,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter categories = group.getWptCategories(); if (categories != null && !categories.isEmpty()) { @@ -616,7 +616,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter(); markerGroups = new HashMap<>(); - List markersHistory = app.getMapMarkersHelper().getMapMarkersHistory(); + List markersHistory = app.getItineraryHelper().getMapMarkersHistory(); int previousHeader = -1; int monthsDisplayed = 0; @@ -161,13 +161,13 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter adapter = new MapMarkersListAdapter(); - List markers = getMyApplication().getMapMarkersHelper().getMapMarkers(); + List markers = getMyApplication().getItineraryHelper().getMapMarkers(); if (markers.size() > 0) { for (MapMarker marker : markers) { adapter.add(marker); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersActiveFragment.java similarity index 97% rename from OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java rename to OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersActiveFragment.java index d59dad4346..462f444b46 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersActiveFragment.java @@ -1,4 +1,4 @@ -package net.osmand.plus.mapmarkers; +package net.osmand.plus.mapmarkers.fragments; import android.os.Build; import android.os.Bundle; @@ -26,6 +26,7 @@ import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.mapmarkers.adapters.MapMarkersActiveAdapter; import net.osmand.plus.mapmarkers.adapters.MapMarkersActiveAdapter.MapMarkersActiveAdapterListener; import net.osmand.plus.mapmarkers.adapters.MapMarkersItemTouchHelperCallback; @@ -66,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.getMapMarkersHelper().moveMarkerToTop(marker); + app.getItineraryHelper().moveMarkerToTop(marker); updateAdapter(); } else { FavouritePoint fav = marker.favouritePoint == null @@ -113,7 +114,7 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL toPosition = holder.getAdapterPosition(); if (toPosition >= 0 && fromPosition >= 0 && toPosition != fromPosition) { hideSnackbar(); - mapActivity.getMyApplication().getMapMarkersHelper().reorderActiveMarkersIfNeeded(); + mapActivity.getMyApplication().getItineraryHelper().reorderActiveMarkersIfNeeded(); adapter.notifyDataSetChanged(); } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersDialogFragment.java similarity index 90% rename from OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java rename to OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersDialogFragment.java index f0b226dd1e..5727d6abf9 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersDialogFragment.java @@ -1,4 +1,4 @@ -package net.osmand.plus.mapmarkers; +package net.osmand.plus.mapmarkers.fragments; import android.app.Dialog; import android.graphics.drawable.Drawable; @@ -32,13 +32,18 @@ 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.CoordinateInputDialogFragment.OnPointsSavedListener; -import net.osmand.plus.mapmarkers.DirectionIndicationDialogFragment.DirectionIndicationFragmentListener; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersSortByDef; -import net.osmand.plus.mapmarkers.MapMarkersHelper.OnGroupSyncedListener; -import net.osmand.plus.mapmarkers.OptionsBottomSheetDialogFragment.MarkerOptionsFragmentListener; -import net.osmand.plus.mapmarkers.OrderByBottomSheetDialogFragment.OrderByFragmentListener; -import net.osmand.plus.mapmarkers.SaveAsTrackBottomSheetDialogFragment.MarkerSaveAsTrackFragmentListener; +import net.osmand.plus.mapmarkers.ItineraryHelper; +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.bottomsheets.OptionsBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.OptionsBottomSheetDialogFragment.MarkerOptionsFragmentListener; +import net.osmand.plus.mapmarkers.bottomsheets.OrderByBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.OrderByBottomSheetDialogFragment.OrderByFragmentListener; +import net.osmand.plus.mapmarkers.bottomsheets.SaveAsTrackBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.SaveAsTrackBottomSheetDialogFragment.MarkerSaveAsTrackFragmentListener; import net.osmand.plus.track.TrackMenuFragment; import java.io.File; @@ -46,8 +51,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import static net.osmand.plus.mapmarkers.OptionsBottomSheetDialogFragment.GROUPS_MARKERS_MENU; -import static net.osmand.plus.mapmarkers.OptionsBottomSheetDialogFragment.HISTORY_MARKERS_MENU; +import static net.osmand.plus.mapmarkers.bottomsheets.OptionsBottomSheetDialogFragment.GROUPS_MARKERS_MENU; +import static net.osmand.plus.mapmarkers.bottomsheets.OptionsBottomSheetDialogFragment.HISTORY_MARKERS_MENU; public class MapMarkersDialogFragment extends DialogFragment implements OnGroupSyncedListener { @@ -218,13 +223,13 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS @Override public void onResume() { super.onResume(); - getMyApplication().getMapMarkersHelper().addSyncListener(this); + getMyApplication().getItineraryHelper().addSyncListener(this); } @Override public void onPause() { super.onPause(); - getMyApplication().getMapMarkersHelper().removeSyncListener(this); + getMyApplication().getItineraryHelper().removeSyncListener(this); } @Override @@ -403,7 +408,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS @Override public void buildRouteOnClick() { if (mapActivity != null) { - if (mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers().isEmpty()) { + if (mapActivity.getMyApplication().getItineraryHelper().getMapMarkers().isEmpty()) { Toast.makeText(mapActivity, getString(R.string.plan_route_no_markers_toast), Toast.LENGTH_SHORT).show(); } else { PlanRouteFragment.showInstance(mapActivity); @@ -415,7 +420,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS @Override public void saveAsNewTrackOnClick() { if (mapActivity != null) { - if (mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers().isEmpty()) { + if (mapActivity.getMyApplication().getItineraryHelper().getMapMarkers().isEmpty()) { Toast.makeText(mapActivity, getString(R.string.plan_route_no_markers_toast), Toast.LENGTH_SHORT).show(); } else { SaveAsTrackBottomSheetDialogFragment fragment = new SaveAsTrackBottomSheetDialogFragment(); @@ -428,7 +433,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS @Override public void moveAllToHistoryOnClick() { if (mapActivity != null) { - final MapMarkersHelper helper = mapActivity.getMyApplication().getMapMarkersHelper(); + final ItineraryHelper helper = mapActivity.getMyApplication().getItineraryHelper(); final List markers = new ArrayList<>(helper.getMapMarkers()); helper.moveAllActiveMarkersToHistory(); if (viewPager.getCurrentItem() == ACTIVE_MARKERS_POSITION) { @@ -481,7 +486,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS @Override public void saveGpx(final String fileName) { - final String gpxPath = mapActivity.getMyApplication().getMapMarkersHelper().saveMarkersToFile(fileName); + final String gpxPath = mapActivity.getMyApplication().getItineraryHelper().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 @@ -506,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.getMapMarkersHelper().sortMarkers(sortByMode, loc); + app.getItineraryHelper().sortMarkers(sortByMode, loc); activeFragment.updateAdapter(); } }; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersGroupsFragment.java similarity index 93% rename from OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java rename to OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersGroupsFragment.java index df071bf5b9..bb796912ee 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersGroupsFragment.java @@ -1,4 +1,4 @@ -package net.osmand.plus.mapmarkers; +package net.osmand.plus.mapmarkers.fragments; import android.graphics.Canvas; import android.graphics.Paint; @@ -34,7 +34,13 @@ 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.SelectionMarkersGroupBottomSheetDialogFragment.AddMarkersGroupFragmentListener; +import net.osmand.plus.mapmarkers.MapMarker; +import net.osmand.plus.mapmarkers.bottomsheets.AddFavouritesGroupBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.AddGroupBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.AddTracksGroupBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.HistoryMarkerMenuBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.SelectionMarkersGroupBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.SelectionMarkersGroupBottomSheetDialogFragment.AddMarkersGroupFragmentListener; import net.osmand.plus.mapmarkers.adapters.MapMarkerItemViewHolder; import net.osmand.plus.mapmarkers.adapters.MapMarkersGroupsAdapter; import net.osmand.plus.widgets.EmptyStateRecyclerView; @@ -189,10 +195,10 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL final MapMarker marker = (MapMarker) item; int snackbarStringRes; if (direction == ItemTouchHelper.RIGHT) { - app.getMapMarkersHelper().moveMapMarkerToHistory((MapMarker) item); + app.getItineraryHelper().moveMapMarkerToHistory((MapMarker) item); snackbarStringRes = R.string.marker_moved_to_history; } else { - app.getMapMarkersHelper().removeMarker((MapMarker) item); + app.getItineraryHelper().removeMarker((MapMarker) item); snackbarStringRes = R.string.item_removed; } updateAdapter(); @@ -201,9 +207,9 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL @Override public void onClick(View view) { if (direction == ItemTouchHelper.RIGHT) { - app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0); + app.getItineraryHelper().restoreMarkerFromHistory(marker, 0); } else { - app.getMapMarkersHelper().addMarker(marker); + app.getItineraryHelper().addMarker(marker); } updateAdapter(); } @@ -230,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.getMapMarkersHelper().moveMarkerToTop(marker); + app.getItineraryHelper().moveMarkerToTop(marker); updateAdapter(); } else { FavouritePoint fav = marker.favouritePoint == null @@ -338,7 +344,7 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL Object item = adapter.getItem(pos); if (item instanceof MapMarker) { if (getMyApplication() != null) { - getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory((MapMarker) item, 0); + getMyApplication().getItineraryHelper().restoreMarkerFromHistory((MapMarker) item, 0); } updateAdapter(); } @@ -349,7 +355,7 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL Object item = adapter.getItem(pos); if (item instanceof MapMarker) { if (getMyApplication() != null) { - getMyApplication().getMapMarkersHelper().removeMarker((MapMarker) item); + getMyApplication().getItineraryHelper().removeMarker((MapMarker) item); } updateAdapter(); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersHistoryFragment.java similarity index 93% rename from OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java rename to OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersHistoryFragment.java index c631e3d3e7..b3f9ec1ccc 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/MapMarkersHistoryFragment.java @@ -1,4 +1,4 @@ -package net.osmand.plus.mapmarkers; +package net.osmand.plus.mapmarkers.fragments; import android.graphics.Canvas; import android.graphics.Paint; @@ -24,12 +24,15 @@ 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.MapMarker; import net.osmand.plus.mapmarkers.adapters.MapMarkerHeaderViewHolder; import net.osmand.plus.mapmarkers.adapters.MapMarkerItemViewHolder; import net.osmand.plus.mapmarkers.adapters.MapMarkersHistoryAdapter; +import net.osmand.plus.mapmarkers.bottomsheets.HistoryMarkerMenuBottomSheetDialogFragment; import net.osmand.plus.widgets.EmptyStateRecyclerView; -public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHelper.MapMarkerChangedListener { +public class MapMarkersHistoryFragment extends Fragment implements MapMarkerChangedListener { private MapMarkersHistoryAdapter adapter; private OsmandApplication app; @@ -149,10 +152,10 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel final MapMarker marker = (MapMarker) item; int snackbarStringRes; if (direction == ItemTouchHelper.LEFT) { - app.getMapMarkersHelper().restoreMarkerFromHistory((MapMarker) item, 0); + app.getItineraryHelper().restoreMarkerFromHistory((MapMarker) item, 0); snackbarStringRes = R.string.marker_moved_to_active; } else { - app.getMapMarkersHelper().removeMarker((MapMarker) item); + app.getItineraryHelper().removeMarker((MapMarker) item); snackbarStringRes = R.string.item_removed; } snackbar = Snackbar.make(viewHolder.itemView, snackbarStringRes, Snackbar.LENGTH_LONG) @@ -160,9 +163,9 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel @Override public void onClick(View view) { if (direction == ItemTouchHelper.LEFT) { - app.getMapMarkersHelper().moveMapMarkerToHistory(marker); + app.getItineraryHelper().moveMapMarkerToHistory(marker); } else { - app.getMapMarkersHelper().addMarker(marker); + app.getItineraryHelper().addMarker(marker); } } }); @@ -208,7 +211,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel recyclerView.setEmptyView(emptyView); recyclerView.setAdapter(adapter); - app.getMapMarkersHelper().addListener(this); + app.getItineraryHelper().addListener(this); return mainView; } @@ -228,7 +231,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel public void onMakeMarkerActive(int pos) { Object item = adapter.getItem(pos); if (item instanceof MapMarker) { - app.getMapMarkersHelper().restoreMarkerFromHistory((MapMarker) item, 0); + app.getItineraryHelper().restoreMarkerFromHistory((MapMarker) item, 0); } } @@ -236,7 +239,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel public void onDeleteMarker(int pos) { Object item = adapter.getItem(pos); if (item instanceof MapMarker) { - app.getMapMarkersHelper().removeMarker((MapMarker) item); + app.getItineraryHelper().removeMarker((MapMarker) item); } } }; @@ -244,7 +247,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel @Override public void onDestroy() { - app.getMapMarkersHelper().removeListener(this); + app.getItineraryHelper().removeListener(this); super.onDestroy(); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/PlanRouteFragment.java similarity index 96% rename from OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java rename to OsmAnd/src/net/osmand/plus/mapmarkers/fragments/PlanRouteFragment.java index 71b9523f34..c7cbce22a2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/fragments/PlanRouteFragment.java @@ -1,4 +1,4 @@ -package net.osmand.plus.mapmarkers; +package net.osmand.plus.mapmarkers.fragments; import android.app.ProgressDialog; import android.content.Context; @@ -48,7 +48,11 @@ 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.PlanRouteOptionsBottomSheetDialogFragment.PlanRouteOptionsFragmentListener; +import net.osmand.plus.mapmarkers.ItineraryHelper; +import net.osmand.plus.mapmarkers.MapMarker; +import net.osmand.plus.mapmarkers.MarkersPlanRouteContext; +import net.osmand.plus.mapmarkers.bottomsheets.PlanRouteOptionsBottomSheetDialogFragment; +import net.osmand.plus.mapmarkers.bottomsheets.PlanRouteOptionsBottomSheetDialogFragment.PlanRouteOptionsFragmentListener; import net.osmand.plus.mapmarkers.adapters.MapMarkersItemTouchHelperCallback; import net.osmand.plus.mapmarkers.adapters.MapMarkersListAdapter; import net.osmand.plus.measurementtool.SnapToRoadBottomSheetDialogFragment; @@ -73,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 MapMarkersHelper markersHelper; + private ItineraryHelper markersHelper; private MarkersPlanRouteContext planRouteContext; private MapMarkersListAdapter adapter; @@ -112,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().getMapMarkersHelper(); + markersHelper = mapActivity.getMyApplication().getItineraryHelper(); planRouteContext = markersHelper.getPlanRouteContext(); planRouteContext.setListener(new MarkersPlanRouteContext.PlanRouteProgressListener() { @Override @@ -347,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().getMapMarkersHelper().reorderActiveMarkersIfNeeded(); + mapActivity.getMyApplication().getItineraryHelper().reorderActiveMarkersIfNeeded(); mapActivity.refreshMap(); adapter.reloadData(); try { @@ -568,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.getMapMarkersHelper().isStartFromMyLocation() && myLoc != null; + boolean startFromLocation = app.getItineraryHelper().isStartFromMyLocation() && myLoc != null; if (selectedCount > (startFromLocation ? 0 : 1)) { sortSelectedMarkersDoorToDoor(mapActivity, startFromLocation, myLoc); } @@ -664,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().getMapMarkersHelper().getSelectedMarkersCount(); + selectedCount = mapActivity.getMyApplication().getItineraryHelper().getSelectedMarkersCount(); planRouteContext.recreateSnapTrkSegment(planRouteContext.isAdjustMapOnStart()); planRouteContext.setAdjustMapOnStart(true); mapActivity.refreshMap(); @@ -821,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().getMapMarkersHelper().isStartFromMyLocation() && myLocation != null) { + if (mapActivity.getMyApplication().getItineraryHelper().isStartFromMyLocation() && myLocation != null) { left = myLocation.getLongitude(); right = myLocation.getLongitude(); top = myLocation.getLatitude(); @@ -875,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().getMapMarkersHelper().getPlanRouteContext().isMarkersListOpened(); + boolean fullscreen = portrait && mapActivity.getMyApplication().getItineraryHelper().getPlanRouteContext().isMarkersListOpened(); int containerRes = portrait ? (fullscreen ? R.id.fragmentContainer : R.id.bottomFragmentContainer) : R.id.topFragmentContainer; FragmentManager fm = mapActivity.getSupportFragmentManager(); fm.beginTransaction() @@ -905,7 +909,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat @Override protected List doInBackground(Void... voids) { - MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper(); List selectedMarkers = markersHelper.getSelectedMarkers(); List selectedLatLon = markersHelper.getSelectedMarkersLatLon(); @@ -941,7 +945,7 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat } } - mapActivity.getMyApplication().getMapMarkersHelper().addSelectedMarkersToTop(res); + mapActivity.getMyApplication().getItineraryHelper().addSelectedMarkersToTop(res); adapter.reloadData(); adapter.notifyDataSetChanged(); planRouteContext.recreateSnapTrkSegment(false); diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index a2eaae19d0..54ee96e694 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -76,7 +76,7 @@ import net.osmand.plus.base.OsmandExpandableListFragment; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetType; import net.osmand.plus.helpers.enums.TracksSortByMode; -import net.osmand.plus.mapmarkers.CoordinateInputDialogFragment; +import net.osmand.plus.mapmarkers.fragments.CoordinateInputDialogFragment; import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.myplaces.MoveGpxFileBottomSheet.OnTrackFileMoveListener; import net.osmand.plus.osmedit.OsmEditingPlugin; @@ -107,7 +107,6 @@ import static net.osmand.plus.track.TrackMenuFragment.openTrack; import static net.osmand.util.Algorithms.capitalizeFirstLetter; import static net.osmand.util.Algorithms.formatDuration; import static net.osmand.util.Algorithms.objectEquals; -import static net.osmand.util.Algorithms.removeAllFiles; public class AvailableGPXFragment extends OsmandExpandableListFragment implements FavoritesFragmentStateHolder, OsmAuthorizationListener, OnTrackFileMoveListener, RenameCallback { diff --git a/OsmAnd/src/net/osmand/plus/myplaces/DeletePointsTask.java b/OsmAnd/src/net/osmand/plus/myplaces/DeletePointsTask.java index 996d52cfec..8abb5104ca 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/DeletePointsTask.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/DeletePointsTask.java @@ -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.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; import java.io.File; import java.lang.ref.WeakReference; @@ -65,8 +65,8 @@ public class DeletePointsTask extends AsyncTask { } private void syncGpx(GPXFile gpxFile) { - MapMarkersHelper helper = app.getMapMarkersHelper(); - MapMarkersGroup group = helper.getMarkersGroup(gpxFile); + ItineraryHelper helper = app.getItineraryHelper(); + ItineraryGroup group = helper.getMarkersGroup(gpxFile); if (group != null) { helper.runSynchronization(group); } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java index 674ee76042..289a478878 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java @@ -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.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 MapMarkersHelper mapMarkersHelper; + private ItineraryHelper itineraryHelper; private GpxDisplayGroup group; @@ -83,7 +83,7 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment } app = requiredMyApplication(); selectedGpxHelper = app.getSelectedGpxHelper(); - mapMarkersHelper = app.getMapMarkersHelper(); + itineraryHelper = app.getItineraryHelper(); 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) { - MapMarkersGroup markersGroup = mapMarkersHelper.getMarkersGroup(gpxFile); + ItineraryGroup markersGroup = itineraryHelper.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; - MapMarkersGroup markersGroup = mapMarkersHelper.getMarkersGroup(gpxFile); + ItineraryGroup markersGroup = itineraryHelper.getMarkersGroup(gpxFile); if (markersGroup == null) { groupCreated = true; - markersGroup = mapMarkersHelper.addOrEnableGroup(gpxFile); + markersGroup = itineraryHelper.addOrEnableGroup(gpxFile); } Set categories = markersGroup.getWptCategories(); Set selectedCategories = new HashSet<>(); @@ -232,11 +232,11 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment selectedCategories.add(group.getName()); } if (Algorithms.isEmpty(selectedCategories)) { - mapMarkersHelper.removeMarkersGroup(markersGroup); + itineraryHelper.removeMarkersGroup(markersGroup); } else { - mapMarkersHelper.updateGroupWptCategories(markersGroup, selectedCategories); + itineraryHelper.updateGroupWptCategories(markersGroup, selectedCategories); if (!groupCreated) { - mapMarkersHelper.runSynchronization(markersGroup); + itineraryHelper.runSynchronization(markersGroup); } } } @@ -524,8 +524,8 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment } private void syncGpx(GPXFile gpxFile) { - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); - MapMarkersGroup group = markersHelper.getMarkersGroup(gpxFile); + ItineraryHelper markersHelper = app.getItineraryHelper(); + ItineraryGroup group = markersHelper.getMarkersGroup(gpxFile); if (group != null) { markersHelper.runSynchronization(group); } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java index 59be8cc533..96a18b9eca 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java @@ -62,9 +62,9 @@ import net.osmand.plus.activities.TrackActivity; import net.osmand.plus.base.OsmandExpandableListFragment; import net.osmand.plus.base.PointImageDrawable; import net.osmand.plus.helpers.GpxUiHelper; -import net.osmand.plus.mapmarkers.CoordinateInputDialogFragment; -import net.osmand.plus.mapmarkers.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.fragments.CoordinateInputDialogFragment; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + final ItineraryHelper markersHelper = app.getItineraryHelper(); 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 MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + final ItineraryHelper markersHelper = app.getItineraryHelper(); FragmentActivity activity = getActivity(); if (activity == null) { return; } final GPXFile gpxFile = getGpx(); - MapMarkersGroup markersSearch = markersHelper.getMarkersGroup(gpxFile); - final MapMarkersGroup markersGr; + ItineraryGroup markersSearch = markersHelper.getMarkersGroup(gpxFile); + final ItineraryGroup markersGr; final boolean markersRemoved; if (markersSearch != null) { markersGr = markersSearch; @@ -538,7 +538,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment implements markersHelper.addOrEnableGroup(gpxFile); } } else { - MapMarkersGroup group = markersHelper.getMarkersGroup(gpxFile); + ItineraryGroup group = markersHelper.getMarkersGroup(gpxFile); if (group != null) { markersHelper.removeMarkersGroup(group); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java index 22016f6c9b..f755835dd8 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 items = new ArrayList<>(); MarkersItemsAdapter adapter = new MarkersItemsAdapter(app, items); adapter.setItemClickListener(getAdapterOnClickListener(items)); - MapMarkersHelper helper = app.getMapMarkersHelper(); + ItineraryHelper helper = app.getItineraryHelper(); items.add(MARKERS); items.addAll(helper.getMapMarkers()); BaseBottomSheetItem scrollItem = new HorizontalRecyclerBottomSheetItem.Builder() diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index e57dec6080..f48a6b9e42 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -71,7 +71,7 @@ import net.osmand.plus.helpers.WaypointDialogHelper; import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenuFragment; import net.osmand.plus.mapmarkers.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkerSelectionFragment; +import net.osmand.plus.mapmarkers.fragments.MapMarkerSelectionFragment; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.profiles.AppModesBottomSheetDialogFragment.UpdateMapRouteMenuListener; import net.osmand.plus.profiles.ConfigureAppModesBottomSheetDialogFragment; @@ -715,7 +715,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener } // Map markers card - List mapMarkers = app.getMapMarkersHelper().getMapMarkers(); + List mapMarkers = app.getItineraryHelper().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 mapMarkers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers(); + List mapMarkers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers(); if (index != -1 && mapMarkers.size() > index) { m = mapMarkers.get(index); } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java index ba0c3d7dc0..3cd593da52 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java @@ -10,10 +10,11 @@ import net.osmand.GPXUtilities.GPXFile; import net.osmand.data.PointDescription; import net.osmand.plus.OsmandApplication; 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.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.util.Algorithms; @@ -28,7 +29,7 @@ import static net.osmand.IndexConstants.GPX_FILE_EXT; public class HistoryMarkersSettingsItem extends CollectionSettingsItem { - private MapMarkersHelper markersHelper; + private ItineraryHelper markersHelper; public HistoryMarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { super(app, null, items); @@ -45,7 +46,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem(markersHelper.getMapMarkersFromDefaultGroups(true)); } @@ -122,10 +123,10 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem mapMarkers = markersHelper.readMarkersFromGpx(gpxFile, true); + List mapMarkers = markersHelper.getSaveHelper().readMarkersFromGpx(gpxFile, true); items.addAll(mapMarkers); } } @@ -152,7 +153,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem getWriter() { - GPXFile gpxFile = markersHelper.generateGpx(items, true); + GPXFile gpxFile = markersHelper.getSaveHelper().generateGpx(items, true); return getGpxWriter(gpxFile); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java index daa6b9b485..c6b2be97ae 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -10,10 +10,11 @@ import net.osmand.GPXUtilities.GPXFile; import net.osmand.data.PointDescription; import net.osmand.plus.OsmandApplication; 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.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.util.Algorithms; @@ -28,7 +29,7 @@ import static net.osmand.IndexConstants.GPX_FILE_EXT; public class MarkersSettingsItem extends CollectionSettingsItem { - private MapMarkersHelper markersHelper; + private ItineraryHelper markersHelper; public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { super(app, null, items); @@ -45,7 +46,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem { @Override protected void init() { super.init(); - markersHelper = app.getMapMarkersHelper(); + markersHelper = app.getItineraryHelper(); existingItems = new ArrayList<>(markersHelper.getMapMarkersFromDefaultGroups(false)); } @@ -122,10 +123,10 @@ public class MarkersSettingsItem extends CollectionSettingsItem { } } - public MapMarkersGroup getMarkersGroup() { + public ItineraryGroup getMarkersGroup() { String name = app.getString(R.string.map_markers); String groupId = ExportSettingsType.ACTIVE_MARKERS.name(); - MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS); markersGroup.setMarkers(items); return markersGroup; } @@ -142,7 +143,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem { warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType()))); SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error); } else { - List mapMarkers = markersHelper.readMarkersFromGpx(gpxFile, false); + List mapMarkers = markersHelper.getSaveHelper().readMarkersFromGpx(gpxFile, false); items.addAll(mapMarkers); } } @@ -152,7 +153,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem { @Nullable @Override SettingsItemWriter getWriter() { - GPXFile gpxFile = markersHelper.generateGpx(items, true); + GPXFile gpxFile = markersHelper.getSaveHelper().generateGpx(items, true); return getGpxWriter(gpxFile); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index 61cfd43cc1..97c75fafce 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -30,11 +30,11 @@ import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXInfo; -import net.osmand.plus.helpers.LocaleHelper; import net.osmand.plus.helpers.SearchHistoryHelper; import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryType; import net.osmand.plus.mapmarkers.MapMarker; -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; @@ -606,19 +606,19 @@ public class SettingsHelper { myPlacesItems.put(ExportSettingsType.MULTIMEDIA_NOTES, files); } } - List mapMarkers = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(false); + List mapMarkers = app.getItineraryHelper().getMapMarkersFromDefaultGroups(false); if (!mapMarkers.isEmpty()) { String name = app.getString(R.string.map_markers); String groupId = ExportSettingsType.ACTIVE_MARKERS.name(); - MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS); markersGroup.setMarkers(mapMarkers); myPlacesItems.put(ExportSettingsType.ACTIVE_MARKERS, Collections.singletonList(markersGroup)); } - List markersHistory = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(true); + List markersHistory = app.getItineraryHelper().getMapMarkersFromDefaultGroups(true); if (!markersHistory.isEmpty()) { String name = app.getString(R.string.shared_string_history); String groupId = ExportSettingsType.HISTORY_MARKERS.name(); - MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + ItineraryGroup markersGroup = new ItineraryGroup(groupId, name, ItineraryType.MARKERS); markersGroup.setMarkers(markersHistory); myPlacesItems.put(ExportSettingsType.HISTORY_MARKERS, Collections.singletonList(markersGroup)); } @@ -721,8 +721,8 @@ public class SettingsHelper { List favoriteGroups = new ArrayList<>(); List osmNotesPointList = new ArrayList<>(); List osmEditsPointList = new ArrayList<>(); - List markersGroups = new ArrayList<>(); - List markersHistoryGroups = new ArrayList<>(); + List markersGroups = new ArrayList<>(); + List markersHistoryGroups = new ArrayList<>(); List historyEntries = new ArrayList<>(); List 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 MapMarkersGroup) { - MapMarkersGroup markersGroup = (MapMarkersGroup) object; + } else if (object instanceof ItineraryGroup) { + ItineraryGroup markersGroup = (ItineraryGroup) object; if (ExportSettingsType.ACTIVE_MARKERS.name().equals(markersGroup.getId())) { - markersGroups.add((MapMarkersGroup) object); + markersGroups.add((ItineraryGroup) object); } else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) { - markersHistoryGroups.add((MapMarkersGroup) object); + markersHistoryGroups.add((ItineraryGroup) object); } } else if (object instanceof HistoryEntry) { historyEntries.add((HistoryEntry) object); @@ -813,7 +813,7 @@ public class SettingsHelper { } if (!markersGroups.isEmpty()) { List mapMarkers = new ArrayList<>(); - for (MapMarkersGroup group : markersGroups) { + for (ItineraryGroup 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 mapMarkers = new ArrayList<>(); - for (MapMarkersGroup group : markersHistoryGroups) { + for (ItineraryGroup group : markersHistoryGroups) { mapMarkers.addAll(group.getMarkers()); } HistoryMarkersSettingsItem baseItem = getBaseItem(SettingsItemType.HISTORY_MARKERS, HistoryMarkersSettingsItem.class, settingsItems); @@ -911,8 +911,8 @@ public class SettingsHelper { List notesPointList = new ArrayList<>(); List editsPointList = new ArrayList<>(); List favoriteGroups = new ArrayList<>(); - List markersGroups = new ArrayList<>(); - List markersHistoryGroups = new ArrayList<>(); + List markersGroups = new ArrayList<>(); + List markersHistoryGroups = new ArrayList<>(); List historyEntries = new ArrayList<>(); List onlineRoutingEngines = new ArrayList<>(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java index c3b74af4fd..d2ff913dbb 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportItemsBottomSheet.java @@ -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.MapMarkersGroup; +import net.osmand.plus.mapmarkers.ItineraryGroup; 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 MapMarkersGroup) { - MapMarkersGroup markersGroup = (MapMarkersGroup) object; + } else if (object instanceof ItineraryGroup) { + ItineraryGroup markersGroup = (ItineraryGroup) 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))); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java index 6b6a85035d..fe39a8fcd3 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportSettingsAdapter.java @@ -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.MapMarkersGroup; +import net.osmand.plus.mapmarkers.ItineraryGroup; 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 MapMarkersGroup) { - int selectedMarkers = ((MapMarkersGroup) object).getMarkers().size(); + } else if (object instanceof ItineraryGroup) { + int selectedMarkers = ((ItineraryGroup) 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); } diff --git a/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java index 04c4ac320a..791070b295 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 MapMarkersHelper mapMarkersHelper; + private ItineraryHelper itineraryHelper; protected List 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(); - mapMarkersHelper = view.getApplication().getMapMarkersHelper(); + itineraryHelper = view.getApplication().getItineraryHelper(); 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 = mapMarkersHelper.getMapMarker(objectInMotion); + MapMarker mapMarker = itineraryHelper.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 smallObjectsLatLon = new ArrayList<>(); for (FavoriteGroup group : favouritesDbHelper.getFavoriteGroups()) { List> fullObjects = new ArrayList<>(); - boolean synced = mapMarkersHelper.getMarkersGroup(group) != null; + boolean synced = itineraryHelper.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 = mapMarkersHelper.getMapMarker(favoritePoint)) == null) { + if ((marker = itineraryHelper.getMapMarker(favoritePoint)) == null) { continue; } } diff --git a/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java index 84a1483834..56948efb3f 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java @@ -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.MapMarkersGroup; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryGroup; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 MapMarkersHelper mapMarkersHelper; + private ItineraryHelper itineraryHelper; private GpxSelectionHelper selectedGpxHelper; private final Map 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(); - mapMarkersHelper = view.getApplication().getMapMarkersHelper(); + itineraryHelper = view.getApplication().getItineraryHelper(); 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 = mapMarkersHelper.getMapMarker(objectInMotion); + MapMarker mapMarker = itineraryHelper.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> fullObjects = new ArrayList<>(); int fileColor = getFileColor(g); - boolean synced = mapMarkersHelper.getMarkersGroup(g.getGpxFile()) != null; + boolean synced = itineraryHelper.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 = mapMarkersHelper.getMapMarker(wpt)) == null) { + if ((marker = itineraryHelper.getMapMarker(wpt)) == null) { continue; } } @@ -1226,9 +1226,9 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM } private void syncGpx(GPXFile gpxFile) { - MapMarkersGroup group = view.getApplication().getMapMarkersHelper().getMarkersGroup(gpxFile); + ItineraryGroup group = view.getApplication().getItineraryHelper().getMarkersGroup(gpxFile); if (group != null) { - mapMarkersHelper.runSynchronization(group); + itineraryHelper.runSynchronization(group); } } diff --git a/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java index b6496222f8..b840e4f674 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java @@ -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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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(); } - MapMarkersHelper markersHelper = app.getMapMarkersHelper(); + ItineraryHelper markersHelper = app.getItineraryHelper(); List 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(); - MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = map.getMyApplication().getItineraryHelper(); 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 MapMarkersHelper helper = map.getMyApplication().getMapMarkersHelper(); + final ItineraryHelper helper = map.getMyApplication().getItineraryHelper(); 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.getMapMarkersHelper().getMapMarkers()) { + for (MapMarker marker : app.getItineraryHelper().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) { - MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper(); + ItineraryHelper markersHelper = map.getMyApplication().getItineraryHelper(); MapMarker marker = (MapMarker) o; PointDescription originalDescription = marker.getOriginalPointDescription(); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index 8794414553..bc2e24dc28 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -14,8 +14,8 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.mapmarkers.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkersDialogFragment; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment; +import net.osmand.plus.mapmarkers.ItineraryHelper; 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 MapMarkersHelper helper; + private ItineraryHelper 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().getMapMarkersHelper(); + helper = map.getMyApplication().getItineraryHelper(); 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 MapMarkersHelper helper; + private ItineraryHelper 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().getMapMarkersHelper(); + helper = map.getMyApplication().getItineraryHelper(); setText(null, null); setOnClickListener(new View.OnClickListener() { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java index a64fb19f02..967c2aeada 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java @@ -20,7 +20,7 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dialogs.ConfigureMapMenu; -import net.osmand.plus.mapmarkers.DirectionIndicationDialogFragment; +import net.osmand.plus.mapmarkers.fragments.DirectionIndicationDialogFragment; import net.osmand.plus.quickaction.QuickActionListFragment; import net.osmand.plus.views.layers.MapInfoLayer; import net.osmand.plus.views.layers.MapQuickActionLayer; diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index f9ac17aa23..d9b9e06e24 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -495,7 +495,7 @@ public class RouteInfoWidgetsFactory { Location myLocation = getApplication().getLocationProvider().getLastKnownLocation(); LatLon l = getNextTargetPoint(); if (l == null) { - List markers = getApplication().getMapMarkersHelper().getMapMarkers(); + List markers = getApplication().getItineraryHelper().getMapMarkers(); if (markers.size() > 0) { l = markers.get(0).point; }