Rename markersHelper and move fragments to separate packages
This commit is contained in:
parent
8950a05446
commit
256d634cdb
64 changed files with 351 additions and 323 deletions
|
@ -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<MapMarker> mapMarkers = markersHelper.getMapMarkers();
|
||||
for (MapMarker m : mapMarkers) {
|
||||
if (m.getOnlyName().equals(name)) {
|
||||
|
@ -1085,7 +1085,7 @@ public class OsmandAidlApi {
|
|||
|
||||
boolean removeAllActiveMapMarkers() {
|
||||
boolean refreshNeeded = false;
|
||||
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
|
||||
ItineraryHelper markersHelper = app.getItineraryHelper();
|
||||
List<MapMarker> mapMarkers = markersHelper.getMapMarkers();
|
||||
for (MapMarker m : mapMarkers) {
|
||||
markersHelper.moveMapMarkerToHistory(m);
|
||||
|
@ -1101,7 +1101,7 @@ public class OsmandAidlApi {
|
|||
boolean updateMapMarker(String prevName, LatLon prevLatLon, String newName, LatLon newLatLon, boolean ignoreCoordinates) {
|
||||
LatLon latLon = new LatLon(prevLatLon.getLatitude(), prevLatLon.getLongitude());
|
||||
LatLon latLonNew = new LatLon(newLatLon.getLatitude(), newLatLon.getLongitude());
|
||||
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
|
||||
ItineraryHelper markersHelper = app.getItineraryHelper();
|
||||
List<MapMarker> mapMarkers = markersHelper.getMapMarkers();
|
||||
for (MapMarker m : mapMarkers) {
|
||||
if (m.getOnlyName().equals(prevName)) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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<LatLon> points = new ArrayList<>();
|
||||
List<PointDescription> names = new ArrayList<>();
|
||||
for (Map.Entry<String, Set<FavouritePoint>> entry : favoritesSelected.entrySet()) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,11 +45,11 @@ public class MarkersPlanRouteContext {
|
|||
private boolean adjustMapOnStart = true;
|
||||
private boolean navigationFromMarkers;
|
||||
|
||||
Map<Pair<WptPt, WptPt>, List<WptPt>> getSnappedToRoadPoints() {
|
||||
public Map<Pair<WptPt, WptPt>, List<WptPt>> 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<WptPt> points = getPointsToCalculate();
|
||||
if (snappedMode == ApplicationMode.DEFAULT) {
|
||||
|
@ -178,7 +178,7 @@ public class MarkersPlanRouteContext {
|
|||
}
|
||||
|
||||
private List<WptPt> getPointsToCalculate() {
|
||||
MapMarkersHelper markersHelper = app.getMapMarkersHelper();
|
||||
ItineraryHelper markersHelper = app.getItineraryHelper();
|
||||
List<WptPt> 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();
|
||||
|
||||
|
|
|
@ -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<MapMarkerItemV
|
|||
this.mapActivity = mapActivity;
|
||||
uiUtilities = mapActivity.getMyApplication().getUIUtilities();
|
||||
updateLocationViewCache = uiUtilities.getUpdateLocationViewCache();
|
||||
markers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers();
|
||||
markers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers();
|
||||
night = !mapActivity.getMyApplication().getSettings().isLightContent();
|
||||
showDirectionEnabled = mapActivity.getMyApplication().getSettings().MARKERS_DISTANCE_INDICATION_ENABLED.get();
|
||||
}
|
||||
|
@ -151,7 +152,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
}
|
||||
final MapMarker marker = markers.get(position);
|
||||
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().moveMapMarkerToHistory(marker);
|
||||
mapActivity.getMyApplication().getItineraryHelper().moveMapMarkerToHistory(marker);
|
||||
changeMarkers();
|
||||
notifyDataSetChanged();
|
||||
|
||||
|
@ -159,7 +160,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory(marker, position);
|
||||
mapActivity.getMyApplication().getItineraryHelper().restoreMarkerFromHistory(marker, position);
|
||||
changeMarkers();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
@ -188,7 +189,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
}
|
||||
|
||||
public void changeMarkers() {
|
||||
markers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers();
|
||||
markers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers();
|
||||
}
|
||||
|
||||
public void hideSnackbar() {
|
||||
|
@ -213,11 +214,11 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
public void onItemSwiped(RecyclerView.ViewHolder holder) {
|
||||
final int pos = holder.getAdapterPosition();
|
||||
final MapMarker marker = getItem(pos);
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().moveMapMarkerToHistory(marker);
|
||||
MapMarkersGroup group = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkerGroupById(marker.groupKey,
|
||||
MapMarkersGroup.ANY_TYPE);
|
||||
mapActivity.getMyApplication().getItineraryHelper().moveMapMarkerToHistory(marker);
|
||||
ItineraryGroup group = mapActivity.getMyApplication().getItineraryHelper().getMapMarkerGroupById(marker.groupKey,
|
||||
ItineraryType.MARKERS);
|
||||
if (group != null) {
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().updateGroup(group);
|
||||
mapActivity.getMyApplication().getItineraryHelper().updateGroup(group);
|
||||
}
|
||||
changeMarkers();
|
||||
notifyDataSetChanged();
|
||||
|
@ -225,7 +226,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory(marker, pos);
|
||||
mapActivity.getMyApplication().getItineraryHelper().restoreMarkerFromHistory(marker, pos);
|
||||
changeMarkers();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import android.view.ViewGroup;
|
|||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
|
@ -23,10 +22,11 @@ import net.osmand.IndexConstants;
|
|||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.GpxSelectionHelper;
|
||||
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
||||
import net.osmand.plus.mapmarkers.MapMarkersHelper;
|
||||
import net.osmand.plus.mapmarkers.ItineraryHelper;
|
||||
import net.osmand.plus.mapmarkers.GroupHeader;
|
||||
import net.osmand.plus.mapmarkers.ItineraryType;
|
||||
import net.osmand.plus.mapmarkers.MapMarker;
|
||||
import net.osmand.plus.mapmarkers.MapMarkersGroup;
|
||||
import net.osmand.plus.mapmarkers.ItineraryGroup;
|
||||
import net.osmand.plus.mapmarkers.ShowHideHistoryButton;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -34,7 +34,7 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.UiUtilities.UpdateLocationViewCache;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.mapmarkers.SelectWptCategoriesBottomSheetDialogFragment;
|
||||
import net.osmand.plus.mapmarkers.bottomsheets.SelectWptCategoriesBottomSheetDialogFragment;
|
||||
import net.osmand.plus.wikivoyage.article.WikivoyageArticleDialogFragment;
|
||||
import net.osmand.plus.wikivoyage.data.TravelArticle;
|
||||
import net.osmand.plus.wikivoyage.data.TravelHelper;
|
||||
|
@ -84,7 +84,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
|
||||
private void updateShowDirectionMarkers() {
|
||||
showDirectionEnabled = app.getSettings().MARKERS_DISTANCE_INDICATION_ENABLED.get();
|
||||
List<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkers();
|
||||
List<MapMarker> 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<RecyclerView.V
|
|||
|
||||
private void createDisplayGroups() {
|
||||
items = new ArrayList<>();
|
||||
MapMarkersHelper helper = app.getMapMarkersHelper();
|
||||
ItineraryHelper helper = app.getItineraryHelper();
|
||||
helper.updateGroups();
|
||||
List<MapMarkersGroup> groups = new ArrayList<>(helper.getMapMarkersGroups());
|
||||
List<ItineraryGroup> groups = new ArrayList<>(helper.getItineraryGroups());
|
||||
groups.addAll(helper.getGroupsForDisplayedGpx());
|
||||
groups.addAll(helper.getGroupsForSavedArticlesTravelBook());
|
||||
|
||||
|
@ -134,7 +134,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
Calendar markerCalendar = Calendar.getInstance();
|
||||
|
||||
for (int i = 0; i < groups.size(); i++) {
|
||||
MapMarkersGroup group = groups.get(i);
|
||||
ItineraryGroup group = groups.get(i);
|
||||
if (!group.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
return null;
|
||||
}
|
||||
|
||||
private void populateAdapterWithGroupMarkers(MapMarkersGroup group, int position) {
|
||||
private void populateAdapterWithGroupMarkers(ItineraryGroup group, int position) {
|
||||
if (position != RecyclerView.NO_POSITION) {
|
||||
ShowHideHistoryButton showHideHistoryButton = group.getShowHideHistoryButton();
|
||||
if (!group.isDisabled()) {
|
||||
|
@ -253,7 +253,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
|
||||
public int getGroupHeaderPosition(String groupId) {
|
||||
int pos = -1;
|
||||
MapMarkersGroup group = app.getMapMarkersHelper().getMapMarkerGroupById(groupId, MapMarkersGroup.ANY_TYPE);
|
||||
ItineraryGroup group = app.getItineraryHelper().getMapMarkerGroupById(groupId, ItineraryType.MARKERS);
|
||||
if (group != null) {
|
||||
pos = items.indexOf(group.getGroupHeader());
|
||||
}
|
||||
|
@ -376,9 +376,9 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
return;
|
||||
}
|
||||
if (markerInHistory) {
|
||||
app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
|
||||
app.getItineraryHelper().restoreMarkerFromHistory(marker, 0);
|
||||
} else {
|
||||
app.getMapMarkersHelper().moveMapMarkerToHistory(marker);
|
||||
app.getItineraryHelper().moveMapMarkerToHistory(marker);
|
||||
}
|
||||
updateDisplayedData();
|
||||
if (!markerInHistory) {
|
||||
|
@ -386,7 +386,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
|
||||
mapActivity.getMyApplication().getItineraryHelper().restoreMarkerFromHistory(marker, 0);
|
||||
updateDisplayedData();
|
||||
}
|
||||
});
|
||||
|
@ -421,11 +421,11 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
headerViewHolder.articleDescription.setVisibility(View.GONE);
|
||||
} else if (header instanceof GroupHeader) {
|
||||
final GroupHeader groupHeader = (GroupHeader) header;
|
||||
final MapMarkersGroup group = groupHeader.getGroup();
|
||||
final ItineraryGroup group = groupHeader.getGroup();
|
||||
String groupName = group.getName();
|
||||
if (groupName.isEmpty()) {
|
||||
groupName = app.getString(R.string.shared_string_favorites);
|
||||
} else if (group.getType() == MapMarkersGroup.GPX_TYPE) {
|
||||
} else if (group.getType() == ItineraryType.TRACK) {
|
||||
groupName = groupName.replace(IndexConstants.GPX_FILE_EXT, "").replace("/", " ").replace("_", " ");
|
||||
}
|
||||
if (group.isDisabled()) {
|
||||
|
@ -466,7 +466,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
CompoundButton.OnCheckedChangeListener checkedChangeListener = new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean enabled) {
|
||||
final MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper();
|
||||
final ItineraryHelper itineraryHelper = app.getItineraryHelper();
|
||||
final GPXFile[] gpxFile = new GPXFile[1];
|
||||
boolean disabled = !enabled;
|
||||
|
||||
|
@ -482,8 +482,8 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
fragment.setUsedOnMap(false);
|
||||
fragment.show(mapActivity.getSupportFragmentManager(), SelectWptCategoriesBottomSheetDialogFragment.TAG);
|
||||
}
|
||||
mapMarkersHelper.updateGroupDisabled(group, disabled);
|
||||
if (group.getType() == MapMarkersGroup.GPX_TYPE) {
|
||||
itineraryHelper.updateGroupDisabled(group, disabled);
|
||||
if (group.getType() == ItineraryType.TRACK) {
|
||||
group.setVisibleUntilRestart(disabled);
|
||||
String gpxPath = group.getGpxPath();
|
||||
SelectedGpxFile selectedGpxFile = app.getSelectedGpxHelper().getSelectedFileByPath(gpxPath);
|
||||
|
@ -496,9 +496,9 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
switchGpxVisibility(gpxFile[0], selectedGpxFile, !disabled);
|
||||
}
|
||||
if(!disabled) {
|
||||
mapMarkersHelper.enableGroup(group);
|
||||
itineraryHelper.enableGroup(group);
|
||||
} else {
|
||||
mapMarkersHelper.runSynchronization(group);
|
||||
itineraryHelper.runSynchronization(group);
|
||||
}
|
||||
|
||||
if (disabled) {
|
||||
|
@ -506,10 +506,10 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (group.getType() == MapMarkersGroup.GPX_TYPE && gpxFile[0] != null) {
|
||||
if (group.getType() == ItineraryType.TRACK && gpxFile[0] != null) {
|
||||
switchGpxVisibility(gpxFile[0], null, true);
|
||||
}
|
||||
mapMarkersHelper.enableGroup(group);
|
||||
itineraryHelper.enableGroup(group);
|
||||
}
|
||||
});
|
||||
UiUtilities.setupSnackbar(snackbar, night);
|
||||
|
@ -549,7 +549,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
final Object header = getItem(position);
|
||||
if (header instanceof CategoriesSubHeader) {
|
||||
final CategoriesSubHeader categoriesSubHeader = (CategoriesSubHeader) header;
|
||||
final MapMarkersGroup group = categoriesSubHeader.getGroup();
|
||||
final ItineraryGroup group = categoriesSubHeader.getGroup();
|
||||
View.OnClickListener openChooseCategoriesDialog = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
@ -563,7 +563,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
fragment.setUsedOnMap(false);
|
||||
fragment.show(mapActivity.getSupportFragmentManager(), SelectWptCategoriesBottomSheetDialogFragment.TAG);
|
||||
} else {
|
||||
mapActivity.getMyApplication().getMapMarkersHelper().addOrEnableGpxGroup(new File(group.getGpxPath()));
|
||||
mapActivity.getMyApplication().getItineraryHelper().addOrEnableGpxGroup(new File(group.getGpxPath()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -592,7 +592,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
}
|
||||
}
|
||||
|
||||
private String getGroupWptCategoriesString(MapMarkersGroup group) {
|
||||
private String getGroupWptCategoriesString(ItineraryGroup group) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Set<String> categories = group.getWptCategories();
|
||||
if (categories != null && !categories.isEmpty()) {
|
||||
|
@ -616,7 +616,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
Object item = items.get(position);
|
||||
if (item instanceof MapMarker) {
|
||||
return MARKER_TYPE;
|
||||
} else if (item instanceof GroupHeader || item instanceof Integer) {
|
||||
} else if (item instanceof GroupHeader || item instanceof MarkerGroupItem) {
|
||||
return HEADER_TYPE;
|
||||
} else if (item instanceof ShowHideHistoryButton) {
|
||||
return SHOW_HIDE_HISTORY_TYPE;
|
||||
|
@ -664,13 +664,13 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
|
||||
public class CategoriesSubHeader {
|
||||
|
||||
private MapMarkersGroup group;
|
||||
private ItineraryGroup group;
|
||||
|
||||
public CategoriesSubHeader(MapMarkersGroup group) {
|
||||
public CategoriesSubHeader(ItineraryGroup group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public MapMarkersGroup getGroup() {
|
||||
public ItineraryGroup getGroup() {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
|
|||
public void createHeaders() {
|
||||
items = new ArrayList<>();
|
||||
markerGroups = new HashMap<>();
|
||||
List<MapMarker> markersHistory = app.getMapMarkersHelper().getMapMarkersHistory();
|
||||
List<MapMarker> markersHistory = app.getItineraryHelper().getMapMarkersHistory();
|
||||
int previousHeader = -1;
|
||||
int monthsDisplayed = 0;
|
||||
|
||||
|
@ -161,13 +161,13 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
|
|||
if (position < 0) {
|
||||
return;
|
||||
}
|
||||
app.getMapMarkersHelper().restoreMarkerFromHistory(marker, 0);
|
||||
app.getItineraryHelper().restoreMarkerFromHistory(marker, 0);
|
||||
|
||||
snackbar = Snackbar.make(itemViewHolder.itemView, app.getString(R.string.marker_moved_to_active), Snackbar.LENGTH_LONG)
|
||||
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
app.getMapMarkersHelper().moveMapMarkerToHistory(marker);
|
||||
app.getItineraryHelper().moveMapMarkerToHistory(marker);
|
||||
}
|
||||
});
|
||||
UiUtilities.setupSnackbar(snackbar, night);
|
||||
|
@ -216,14 +216,14 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
|
|||
return;
|
||||
}
|
||||
for (MapMarker marker : group) {
|
||||
app.getMapMarkersHelper().removeMarker((MapMarker) marker);
|
||||
app.getItineraryHelper().removeMarker((MapMarker) marker);
|
||||
}
|
||||
snackbar = Snackbar.make(holder.itemView, app.getString(R.string.n_items_removed), Snackbar.LENGTH_LONG)
|
||||
.setAction(R.string.shared_string_undo, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
for (MapMarker marker : group) {
|
||||
app.getMapMarkersHelper().addMarker(marker);
|
||||
app.getItineraryHelper().addMarker(marker);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -97,7 +97,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
|
|||
boolean firstSelectedMarker = pos == firstSelectedMarkerPos;
|
||||
boolean roundTripFinishItem = finish && showRoundTripItem;
|
||||
|
||||
boolean useLocation = app.getMapMarkersHelper().isStartFromMyLocation() && showLocationItem;
|
||||
boolean useLocation = app.getItineraryHelper().isStartFromMyLocation() && showLocationItem;
|
||||
|
||||
MapMarker marker = null;
|
||||
Location location = null;
|
||||
|
@ -168,7 +168,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
|
|||
|
||||
if (locationItem) {
|
||||
holder.topDivider.setVisibility(View.VISIBLE);
|
||||
holder.checkBox.setChecked(app.getMapMarkersHelper().isStartFromMyLocation());
|
||||
holder.checkBox.setChecked(app.getItineraryHelper().isStartFromMyLocation());
|
||||
holder.distance.setVisibility(View.GONE);
|
||||
holder.description.setText(locDescription.getName());
|
||||
} else if (roundTripFinishItem) {
|
||||
|
@ -270,7 +270,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
|
|||
return false;
|
||||
}
|
||||
int offset = showLocationItem ? 1 : 0;
|
||||
Collections.swap(mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers(), from - offset, to - offset);
|
||||
Collections.swap(mapActivity.getMyApplication().getItineraryHelper().getMapMarkers(), from - offset, to - offset);
|
||||
Collections.swap(items, from, to);
|
||||
notifyItemMoved(from, to);
|
||||
return true;
|
||||
|
@ -310,7 +310,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
|
|||
lookupLocationAddress(app);
|
||||
items.add(myLoc);
|
||||
}
|
||||
items.addAll(mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers());
|
||||
items.addAll(mapActivity.getMyApplication().getItineraryHelper().getMapMarkers());
|
||||
calculateStartAndFinishPos();
|
||||
showRoundTripItem = inRoundTrip && !inDragAndDrop && startPos != -1;
|
||||
if (showRoundTripItem) {
|
||||
|
@ -343,7 +343,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter<MapMarkerItemVie
|
|||
boolean startCalculated = false;
|
||||
boolean finishCalculated = false;
|
||||
boolean firstSelectedMarkerCalculated = false;
|
||||
if (app.getMapMarkersHelper().isStartFromMyLocation() && showLocationItem) {
|
||||
if (app.getItineraryHelper().isStartFromMyLocation() && showLocationItem) {
|
||||
startPos = 0;
|
||||
startCalculated = true;
|
||||
if (inRoundTrip && !inDragAndDrop) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class AddFavouritesGroupBottomSheetDialogFragment extends AddGroupBottomS
|
|||
if (!group.isVisible()) {
|
||||
favouritesDbHelper.editFavouriteGroup(group, group.getName(), group.getColor(), true);
|
||||
}
|
||||
getMyApplication().getMapMarkersHelper().addOrEnableGroup(group);
|
||||
getMyApplication().getItineraryHelper().addOrEnableGroup(group);
|
||||
dismiss();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.AsyncTask;
|
||||
|
@ -108,7 +108,7 @@ public class AddTracksGroupBottomSheetDialogFragment extends AddGroupBottomSheet
|
|||
GPXFile res = GPXUtilities.loadGPXFile(gpx);
|
||||
selectionHelper.selectGpxFile(res, true, false, false, false, false);
|
||||
}
|
||||
app.getMapMarkersHelper().addOrEnableGpxGroup(gpx);
|
||||
app.getItineraryHelper().addOrEnableGpxGroup(gpx);
|
||||
}
|
||||
}
|
||||
dismiss();
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
@ -65,7 +65,7 @@ public class CoordinateInputActionsBottomSheet extends MenuBottomSheetDialogFrag
|
|||
return R.string.shared_string_cancel;
|
||||
}
|
||||
|
||||
interface CoordinateInputActionsListener {
|
||||
public interface CoordinateInputActionsListener {
|
||||
|
||||
void removeItem(int position);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
|
@ -162,7 +162,7 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
|
|||
return R.string.shared_string_close;
|
||||
}
|
||||
|
||||
interface CoordinateInputFormatChangeListener {
|
||||
public interface CoordinateInputFormatChangeListener {
|
||||
|
||||
void onKeyboardChanged();
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
@ -9,6 +9,7 @@ import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
|||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription;
|
||||
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem;
|
||||
import net.osmand.plus.mapmarkers.MapMarker;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
@ -95,7 +96,7 @@ public class HistoryMarkerMenuBottomSheetDialogFragment extends MenuBottomSheetD
|
|||
return R.string.shared_string_close;
|
||||
}
|
||||
|
||||
interface HistoryMarkerMenuFragmentListener {
|
||||
public interface HistoryMarkerMenuFragmentListener {
|
||||
|
||||
void onMakeMarkerActive(int pos);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Build;
|
||||
|
@ -17,6 +17,8 @@ import net.osmand.AndroidUtils;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.BottomSheetDialogFragment;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.mapmarkers.fragments.MapMarkersDialogFragment;
|
||||
import net.osmand.plus.mapmarkers.MapMarkersMode;
|
||||
|
||||
public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
||||
|
||||
|
@ -220,7 +222,7 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
|
|||
return scrH - stBarH - nBarH - AndroidUtils.dpToPx(activity, 56);
|
||||
}
|
||||
|
||||
interface MarkerOptionsFragmentListener {
|
||||
public interface MarkerOptionsFragmentListener {
|
||||
|
||||
void sortByOnClick();
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersSortByDef;
|
||||
import net.osmand.plus.mapmarkers.ItineraryHelper;
|
||||
import net.osmand.plus.mapmarkers.ItineraryHelper.MapMarkersSortByDef;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
|
||||
|
@ -37,7 +38,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_NAME);
|
||||
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_NAME);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
@ -55,7 +56,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DISTANCE_ASC);
|
||||
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DISTANCE_ASC);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
@ -71,7 +72,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DISTANCE_DESC);
|
||||
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DISTANCE_DESC);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
@ -89,7 +90,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DATE_ADDED_ASC);
|
||||
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DATE_ADDED_ASC);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
@ -105,7 +106,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
listener.onMapMarkersOrderByModeChanged(MapMarkersHelper.BY_DATE_ADDED_DESC);
|
||||
listener.onMapMarkersOrderByModeChanged(ItineraryHelper.BY_DATE_ADDED_DESC);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
@ -119,7 +120,7 @@ public class OrderByBottomSheetDialogFragment extends MenuBottomSheetDialogFragm
|
|||
return R.string.shared_string_close;
|
||||
}
|
||||
|
||||
interface OrderByFragmentListener {
|
||||
public interface OrderByFragmentListener {
|
||||
void onMapMarkersOrderByModeChanged(@MapMarkersSortByDef int sortByMode);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
@ -125,7 +125,7 @@ public class PlanRouteOptionsBottomSheetDialogFragment extends MenuBottomSheetDi
|
|||
return R.string.shared_string_close;
|
||||
}
|
||||
|
||||
interface PlanRouteOptionsFragmentListener {
|
||||
public interface PlanRouteOptionsFragmentListener {
|
||||
|
||||
void selectOnClick();
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.format.DateFormat;
|
||||
|
@ -31,7 +31,7 @@ import net.osmand.plus.widgets.OsmandTextFieldBoxes;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import static net.osmand.plus.mapmarkers.CoordinateInputDialogFragment.ADDED_POINTS_NUMBER_KEY;
|
||||
import static net.osmand.plus.mapmarkers.fragments.CoordinateInputDialogFragment.ADDED_POINTS_NUMBER_KEY;
|
||||
|
||||
public class SaveAsTrackBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
||||
|
||||
|
@ -167,7 +167,7 @@ public class SaveAsTrackBottomSheetDialogFragment extends BottomSheetDialogFragm
|
|||
}
|
||||
}
|
||||
|
||||
interface MarkerSaveAsTrackFragmentListener {
|
||||
public interface MarkerSaveAsTrackFragmentListener {
|
||||
void saveGpx(String fileName);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
@ -20,6 +20,8 @@ import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton;
|
|||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.ShortDescriptionItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
|
||||
import net.osmand.plus.mapmarkers.ItineraryGroup;
|
||||
import net.osmand.plus.mapmarkers.ItineraryHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -136,18 +138,18 @@ public class SelectWptCategoriesBottomSheetDialogFragment extends MenuBottomShee
|
|||
private void updateAddOrEnableGroupWptCategories() {
|
||||
OsmandApplication app = getMyApplication();
|
||||
GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper();
|
||||
MapMarkersHelper mapMarkersHelper = app.getMapMarkersHelper();
|
||||
ItineraryHelper itineraryHelper = app.getItineraryHelper();
|
||||
|
||||
SelectedGpxFile selectedGpxFile = gpxSelectionHelper.getSelectedFileByPath(gpxFile.path);
|
||||
if (selectedGpxFile == null) {
|
||||
gpxSelectionHelper.selectGpxFile(gpxFile, true, false, false, false, false);
|
||||
}
|
||||
MapMarkersGroup group = mapMarkersHelper.getMarkersGroup(gpxFile);
|
||||
ItineraryGroup group = itineraryHelper.getMarkersGroup(gpxFile);
|
||||
if (group == null) {
|
||||
group = mapMarkersHelper.addOrEnableGroup(gpxFile);
|
||||
group = itineraryHelper.addOrEnableGroup(gpxFile);
|
||||
}
|
||||
mapMarkersHelper.updateGroupWptCategories(group, selectedCategories);
|
||||
mapMarkersHelper.runSynchronization(group);
|
||||
itineraryHelper.updateGroupWptCategories(group, selectedCategories);
|
||||
itineraryHelper.runSynchronization(group);
|
||||
}
|
||||
|
||||
private boolean isAllChecked() {
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.bottomsheets;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
@ -64,7 +64,7 @@ public class SelectionMarkersGroupBottomSheetDialogFragment extends MenuBottomSh
|
|||
return R.string.shared_string_close;
|
||||
}
|
||||
|
||||
interface AddMarkersGroupFragmentListener {
|
||||
public interface AddMarkersGroupFragmentListener {
|
||||
|
||||
void favouritesOnClick();
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
|
@ -71,11 +71,17 @@ import net.osmand.plus.Version;
|
|||
import net.osmand.plus.activities.SavingTrackHelper;
|
||||
import net.osmand.plus.activities.TrackActivity;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats;
|
||||
import net.osmand.plus.mapmarkers.ItineraryGroup;
|
||||
import net.osmand.plus.mapmarkers.ItineraryHelper;
|
||||
import net.osmand.plus.mapmarkers.bottomsheets.CoordinateInputActionsBottomSheet;
|
||||
import net.osmand.plus.mapmarkers.bottomsheets.CoordinateInputBottomSheetDialogFragment;
|
||||
import net.osmand.plus.mapmarkers.bottomsheets.CoordinateInputBottomSheetDialogFragment.CoordinateInputFormatChangeListener;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats.DDM;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats.DMS;
|
||||
import net.osmand.plus.mapmarkers.CoordinateInputFormats.Format;
|
||||
import net.osmand.plus.mapmarkers.adapters.CoordinateInputAdapter;
|
||||
import net.osmand.plus.mapmarkers.bottomsheets.SaveAsTrackBottomSheetDialogFragment;
|
||||
import net.osmand.plus.settings.backend.OsmandPreference;
|
||||
import net.osmand.plus.track.TrackMenuFragment;
|
||||
import net.osmand.plus.widgets.EditTextEx;
|
||||
|
@ -168,8 +174,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
}
|
||||
|
||||
private void syncGpx(GPXFile gpxFile) {
|
||||
MapMarkersHelper helper = getMyApplication().getMapMarkersHelper();
|
||||
MapMarkersGroup group = helper.getMarkersGroup(gpxFile);
|
||||
ItineraryHelper helper = getMyApplication().getItineraryHelper();
|
||||
ItineraryGroup group = helper.getMarkersGroup(gpxFile);
|
||||
if (group != null) {
|
||||
helper.runSynchronization(group);
|
||||
}
|
||||
|
@ -1089,7 +1095,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
public void saveGpx(final String fileName) {
|
||||
new SaveGpxAsyncTask(app, getGpx(),fileName, false).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
hasUnsavedChanges = false;
|
||||
app.getMapMarkersHelper().addOrEnableGroup(getGpx());
|
||||
app.getItineraryHelper().addOrEnableGroup(getGpx());
|
||||
if (listener != null) {
|
||||
listener.onPointsSaved();
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
@ -30,6 +30,7 @@ import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCal
|
|||
import com.github.ksoichiro.android.observablescrollview.ScrollState;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.mapmarkers.MapMarkersMode;
|
||||
import net.osmand.plus.settings.backend.ApplicationMode;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
import net.osmand.plus.settings.backend.OsmandPreference;
|
|
@ -1,4 +1,4 @@
|
|||
package net.osmand.plus.mapmarkers;
|
||||
package net.osmand.plus.mapmarkers.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -21,6 +21,7 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.base.BaseOsmAndDialogFragment;
|
||||
import net.osmand.plus.base.MapViewTrackingUtilities;
|
||||
import net.osmand.plus.helpers.MapMarkerDialogHelper;
|
||||
import net.osmand.plus.mapmarkers.MapMarker;
|
||||
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu;
|
||||
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu.OnMarkerSelectListener;
|
||||
import net.osmand.plus.routepreparationmenu.MapRouteInfoMenu.PointType;
|
||||
|
@ -92,7 +93,7 @@ public class MapMarkerSelectionFragment extends BaseOsmAndDialogFragment {
|
|||
|
||||
ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
final ArrayAdapter<MapMarker> adapter = new MapMarkersListAdapter();
|
||||
List<MapMarker> markers = getMyApplication().getMapMarkersHelper().getMapMarkers();
|
||||
List<MapMarker> markers = getMyApplication().getItineraryHelper().getMapMarkers();
|
||||
if (markers.size() > 0) {
|
||||
for (MapMarker marker : markers) {
|
||||
adapter.add(marker);
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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<MapMarker> 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();
|
||||
}
|
||||
};
|
|
@ -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();
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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<MapMarker> doInBackground(Void... voids) {
|
||||
MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
|
||||
ItineraryHelper markersHelper = mapActivity.getMyApplication().getItineraryHelper();
|
||||
List<MapMarker> selectedMarkers = markersHelper.getSelectedMarkers();
|
||||
List<LatLon> 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);
|
|
@ -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 {
|
||||
|
|
|
@ -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<Void, Void, Void> {
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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<String> categories = markersGroup.getWptCategories();
|
||||
Set<String> selectedCategories = new HashSet<>();
|
||||
|
@ -232,11 +232,11 @@ public class EditTrackGroupDialogFragment extends MenuBottomSheetDialogFragment
|
|||
selectedCategories.add(group.getName());
|
||||
}
|
||||
if (Algorithms.isEmpty(selectedCategories)) {
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<Object> 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()
|
||||
|
|
|
@ -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<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkers();
|
||||
List<MapMarker> 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<MapMarker> mapMarkers = mapActivity.getMyApplication().getMapMarkersHelper().getMapMarkers();
|
||||
List<MapMarker> mapMarkers = mapActivity.getMyApplication().getItineraryHelper().getMapMarkers();
|
||||
if (index != -1 && mapMarkers.size() > index) {
|
||||
m = mapMarkers.get(index);
|
||||
}
|
||||
|
|
|
@ -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<MapMarker> {
|
||||
|
||||
private MapMarkersHelper markersHelper;
|
||||
private ItineraryHelper markersHelper;
|
||||
|
||||
public HistoryMarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List<MapMarker> items) {
|
||||
super(app, null, items);
|
||||
|
@ -45,7 +46,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
|
|||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
markersHelper = app.getMapMarkersHelper();
|
||||
markersHelper = app.getItineraryHelper();
|
||||
existingItems = new ArrayList<>(markersHelper.getMapMarkersFromDefaultGroups(true));
|
||||
}
|
||||
|
||||
|
@ -122,10 +123,10 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
|
|||
}
|
||||
}
|
||||
|
||||
public MapMarkersGroup getMarkersGroup() {
|
||||
public ItineraryGroup getMarkersGroup() {
|
||||
String name = app.getString(R.string.markers_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(items);
|
||||
return markersGroup;
|
||||
}
|
||||
|
@ -142,7 +143,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
|
|||
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
|
||||
SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error);
|
||||
} else {
|
||||
List<MapMarker> mapMarkers = markersHelper.readMarkersFromGpx(gpxFile, true);
|
||||
List<MapMarker> mapMarkers = markersHelper.getSaveHelper().readMarkersFromGpx(gpxFile, true);
|
||||
items.addAll(mapMarkers);
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +153,7 @@ public class HistoryMarkersSettingsItem extends CollectionSettingsItem<MapMarker
|
|||
@Nullable
|
||||
@Override
|
||||
SettingsItemWriter<? extends SettingsItem> getWriter() {
|
||||
GPXFile gpxFile = markersHelper.generateGpx(items, true);
|
||||
GPXFile gpxFile = markersHelper.getSaveHelper().generateGpx(items, true);
|
||||
return getGpxWriter(gpxFile);
|
||||
}
|
||||
}
|
|
@ -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<MapMarker> {
|
||||
|
||||
private MapMarkersHelper markersHelper;
|
||||
private ItineraryHelper markersHelper;
|
||||
|
||||
public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List<MapMarker> items) {
|
||||
super(app, null, items);
|
||||
|
@ -45,7 +46,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
|
|||
@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<MapMarker> {
|
|||
}
|
||||
}
|
||||
|
||||
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<MapMarker> {
|
|||
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
|
||||
SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error);
|
||||
} else {
|
||||
List<MapMarker> mapMarkers = markersHelper.readMarkersFromGpx(gpxFile, false);
|
||||
List<MapMarker> mapMarkers = markersHelper.getSaveHelper().readMarkersFromGpx(gpxFile, false);
|
||||
items.addAll(mapMarkers);
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +153,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem<MapMarker> {
|
|||
@Nullable
|
||||
@Override
|
||||
SettingsItemWriter<? extends SettingsItem> getWriter() {
|
||||
GPXFile gpxFile = markersHelper.generateGpx(items, true);
|
||||
GPXFile gpxFile = markersHelper.getSaveHelper().generateGpx(items, true);
|
||||
return getGpxWriter(gpxFile);
|
||||
}
|
||||
}
|
|
@ -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<MapMarker> mapMarkers = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(false);
|
||||
List<MapMarker> 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<MapMarker> markersHistory = app.getMapMarkersHelper().getMapMarkersFromDefaultGroups(true);
|
||||
List<MapMarker> 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<FavoriteGroup> favoriteGroups = new ArrayList<>();
|
||||
List<OsmNotesPoint> osmNotesPointList = new ArrayList<>();
|
||||
List<OpenstreetmapPoint> osmEditsPointList = new ArrayList<>();
|
||||
List<MapMarkersGroup> markersGroups = new ArrayList<>();
|
||||
List<MapMarkersGroup> markersHistoryGroups = new ArrayList<>();
|
||||
List<ItineraryGroup> markersGroups = new ArrayList<>();
|
||||
List<ItineraryGroup> markersHistoryGroups = new ArrayList<>();
|
||||
List<HistoryEntry> historyEntries = new ArrayList<>();
|
||||
List<OnlineRoutingEngine> onlineRoutingEngines = new ArrayList<>();
|
||||
|
||||
|
@ -756,12 +756,12 @@ public class SettingsHelper {
|
|||
osmEditsPointList.add((OpenstreetmapPoint) object);
|
||||
} else if (object instanceof FavoriteGroup) {
|
||||
favoriteGroups.add((FavoriteGroup) object);
|
||||
} else if (object instanceof 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<MapMarker> 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<MapMarker> 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<OsmNotesPoint> notesPointList = new ArrayList<>();
|
||||
List<OpenstreetmapPoint> editsPointList = new ArrayList<>();
|
||||
List<FavoriteGroup> favoriteGroups = new ArrayList<>();
|
||||
List<MapMarkersGroup> markersGroups = new ArrayList<>();
|
||||
List<MapMarkersGroup> markersHistoryGroups = new ArrayList<>();
|
||||
List<ItineraryGroup> markersGroups = new ArrayList<>();
|
||||
List<ItineraryGroup> markersHistoryGroups = new ArrayList<>();
|
||||
List<HistoryEntry> historyEntries = new ArrayList<>();
|
||||
List<OnlineRoutingEngine> onlineRoutingEngines = new ArrayList<>();
|
||||
|
||||
|
|
|
@ -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)));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<FavouritePoint> cache = new ArrayList<>();
|
||||
private MapTextLayer textLayer;
|
||||
@ColorInt
|
||||
|
@ -57,7 +57,7 @@ public class FavouritesLayer extends OsmandMapLayer implements IContextMenuProvi
|
|||
this.view = view;
|
||||
settings = view.getApplication().getSettings();
|
||||
favouritesDbHelper = view.getApplication().getFavorites();
|
||||
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<LatLon> smallObjectsLatLon = new ArrayList<>();
|
||||
for (FavoriteGroup group : favouritesDbHelper.getFavoriteGroups()) {
|
||||
List<Pair<FavouritePoint, MapMarker>> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<String, CachedTrack> segmentsCache = new HashMap<>();
|
||||
|
@ -165,7 +165,7 @@ public class GPXLayer extends OsmandMapLayer implements IContextMenuProvider, IM
|
|||
this.view = view;
|
||||
gpxDbHelper = view.getApplication().getGpxDbHelper();
|
||||
selectedGpxHelper = view.getApplication().getSelectedGpxHelper();
|
||||
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<Pair<WptPt, MapMarker>> 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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<MapMarker> activeMapMarkers = markersHelper.getMapMarkers();
|
||||
int displayedWidgets = settings.DISPLAYED_MARKERS_WIDGETS_COUNT.get();
|
||||
|
||||
|
@ -340,7 +340,7 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
|
|||
|
||||
int displayedWidgets = settings.DISPLAYED_MARKERS_WIDGETS_COUNT.get();
|
||||
|
||||
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();
|
||||
|
|
|
@ -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() {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -495,7 +495,7 @@ public class RouteInfoWidgetsFactory {
|
|||
Location myLocation = getApplication().getLocationProvider().getLastKnownLocation();
|
||||
LatLon l = getNextTargetPoint();
|
||||
if (l == null) {
|
||||
List<MapMarker> markers = getApplication().getMapMarkersHelper().getMapMarkers();
|
||||
List<MapMarker> markers = getApplication().getItineraryHelper().getMapMarkers();
|
||||
if (markers.size() > 0) {
|
||||
l = markers.get(0).point;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue