From 4923723adef9feb1716d6030d2e0c02ec8ab0f3b Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 3 Nov 2020 18:11:38 +0200 Subject: [PATCH 01/47] Add MarkersSettingsItem initial commit --- .../settings/backend/ExportSettingsType.java | 3 +- .../backend/backup/MarkersSettingsItem.java | 152 ++++++++++++++++++ .../backend/backup/SettingsHelper.java | 19 +++ .../backend/backup/SettingsItemType.java | 3 +- .../backend/backup/SettingsItemsFactory.java | 3 + .../fragments/DuplicatesSettingsAdapter.java | 20 ++- .../ExportImportSettingsAdapter.java | 12 ++ .../ImportedSettingsItemsAdapter.java | 4 + 8 files changed, 209 insertions(+), 7 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java index 91d5493217..a530ef5dcf 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java @@ -16,5 +16,6 @@ public enum ExportSettingsType { OFFLINE_MAPS, FAVORITES, TTS_VOICE, - VOICE + VOICE, + MARKERS } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java new file mode 100644 index 0000000000..0d1f9d6bb8 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -0,0 +1,152 @@ +package net.osmand.plus.settings.backend.backup; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.GPXUtilities; +import net.osmand.GPXUtilities.GPXFile; +import net.osmand.plus.MapMarkersHelper; +import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import static net.osmand.IndexConstants.GPX_FILE_EXT; + +public class MarkersSettingsItem extends CollectionSettingsItem { + + private MapMarkersHelper markersHelper; + + public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { + super(app, null, items); + } + + public MarkersSettingsItem(@NonNull OsmandApplication app, @Nullable MarkersSettingsItem baseItem, @NonNull List items) { + super(app, baseItem, items); + } + + MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull JSONObject json) throws JSONException { + super(app, json); + } + + @Override + protected void init() { + super.init(); + markersHelper = app.getMapMarkersHelper(); + existingItems = new ArrayList<>(markersHelper.getMapMarkersGroups()); + } + + @NonNull + @Override + public SettingsItemType getType() { + return SettingsItemType.MARKERS; + } + + @NonNull + @Override + public String getName() { + return "markers"; + } + + @NonNull + @Override + public String getPublicName(@NonNull Context ctx) { + return ctx.getString(R.string.map_markers); + } + + @NonNull + public String getDefaultFileName() { + return getName() + getDefaultFileExtension(); + } + + @NonNull + public String getDefaultFileExtension() { + return GPX_FILE_EXT; + } + + @Override + public void apply() { + List newItems = getNewItems(); + if (!newItems.isEmpty() || !duplicateItems.isEmpty()) { + appliedItems = new ArrayList<>(newItems); + + for (MapMarkersGroup duplicate : duplicateItems) { + if (shouldReplace) { + + } + appliedItems.add(shouldReplace ? duplicate : renameItem(duplicate)); + } + } + } + + @Override + public boolean isDuplicate(@NonNull MapMarkersGroup markersGroup) { + String name = markersGroup.getName(); + for (MapMarkersGroup group : existingItems) { + if (group.getName().equals(name)) { + return true; + } + } + return false; + } + + @Override + public boolean shouldReadOnCollecting() { + return true; + } + + @NonNull + @Override + public MapMarkersGroup renameItem(@NonNull MapMarkersGroup item) { + return item; + } + + @Nullable + @Override + SettingsItemReader getReader() { + return new SettingsItemReader(this) { + + @Override + public void readFromStream(@NonNull InputStream inputStream, File destination) throws IOException, IllegalArgumentException { + GPXFile gpxFile = GPXUtilities.loadGPXFile(inputStream); + if (gpxFile.error != null) { + warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType()))); + SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error); + } else { + Map flatGroups = new LinkedHashMap<>(); + } + } + }; + } + + @Nullable + @Override + SettingsItemWriter getWriter() { + return new SettingsItemWriter(this) { + + @Override + public boolean writeToStream(@NonNull OutputStream outputStream) throws IOException { +// Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); +// if (error != null) { +// warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); +// SettingsHelper.LOG.error("Failed write to gpx file", error); +// return false; +// } + return true; + } + }; + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index f3821505a2..43e8fe22c2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -14,6 +14,7 @@ import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; +import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.SQLiteTileSource; @@ -552,6 +553,10 @@ public class SettingsHelper { if (!files.isEmpty()) { dataList.put(ExportSettingsType.VOICE, files); } + List markersGroups = app.getMapMarkersHelper().getMapMarkersGroups(); + if (!markersGroups.isEmpty()) { + dataList.put(ExportSettingsType.MARKERS, markersGroups); + } return dataList; } @@ -591,6 +596,7 @@ public class SettingsHelper { List favoriteGroups = new ArrayList<>(); List osmNotesPointList = new ArrayList<>(); List osmEditsPointList = new ArrayList<>(); + List markersGroups = new ArrayList<>(); for (Object object : data) { if (object instanceof QuickAction) { @@ -615,6 +621,8 @@ public class SettingsHelper { osmEditsPointList.add((OpenstreetmapPoint) object); } else if (object instanceof FavoriteGroup) { favoriteGroups.add((FavoriteGroup) object); + } else if (object instanceof MapMarkersGroup) { + markersGroups.add((MapMarkersGroup) object); } } if (!quickActions.isEmpty()) { @@ -646,6 +654,9 @@ public class SettingsHelper { if (!favoriteGroups.isEmpty()) { settingsItems.add(new FavoritesSettingsItem(app, favoriteGroups)); } + if (!markersGroups.isEmpty()) { + settingsItems.add(new MarkersSettingsItem(app, markersGroups)); + } return settingsItems; } @@ -667,6 +678,7 @@ public class SettingsHelper { List notesPointList = new ArrayList<>(); List editsPointList = new ArrayList<>(); List favoriteGroups = new ArrayList<>(); + List markersGroups = new ArrayList<>(); for (SettingsItem item : settingsItems) { switch (item.getType()) { @@ -746,6 +758,10 @@ public class SettingsHelper { FavoritesSettingsItem favoritesSettingsItem = (FavoritesSettingsItem) item; favoriteGroups.addAll(favoritesSettingsItem.getItems()); break; + case MARKERS: + MarkersSettingsItem markersSettingsItem = (MarkersSettingsItem) item; + markersGroups.addAll(markersSettingsItem.getItems()); + break; default: break; } @@ -799,6 +815,9 @@ public class SettingsHelper { if (!voiceFilesList.isEmpty()) { settingsToOperate.put(ExportSettingsType.VOICE, voiceFilesList); } + if (!markersGroups.isEmpty()) { + settingsToOperate.put(ExportSettingsType.MARKERS, markersGroups); + } return settingsToOperate; } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java index bb6b68b3ce..bc254e28ca 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java @@ -15,5 +15,6 @@ public enum SettingsItemType { DOWNLOADS, OSM_NOTES, OSM_EDITS, - FAVOURITES + FAVOURITES, + MARKERS } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java index 9669099003..3012cc3dd8 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java @@ -134,6 +134,9 @@ class SettingsItemsFactory { case FAVOURITES: item = new FavoritesSettingsItem(app, json); break; + case MARKERS: + item = new MarkersSettingsItem(app, json); + break; } return item; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java index d90f4b7429..58af347031 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java @@ -14,19 +14,20 @@ import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.audionotes.AudioVideoNotesPlugin; -import net.osmand.plus.helpers.GpxUiHelper; -import net.osmand.plus.settings.backend.ApplicationMode; -import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; +import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; +import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; +import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.profiles.ProfileIconColors; import net.osmand.plus.profiles.RoutingProfileDataObject.RoutingProfilesResources; import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.render.RenderingIcons; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -134,7 +135,7 @@ public class DuplicatesSettingsAdapter extends RecyclerView.Adapter Date: Tue, 3 Nov 2020 18:34:49 +0200 Subject: [PATCH 02/47] Move MapMarkersHelper to mapmarkers package --- OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 4 ++-- OsmAnd/src/net/osmand/plus/AppInitializer.java | 1 + OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java | 3 ++- OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java | 3 ++- OsmAnd/src/net/osmand/plus/OsmandApplication.java | 1 + .../activities/EditFavoriteGroupDialogFragment.java | 4 ++-- .../osmand/plus/activities/FavoritesTreeFragment.java | 2 +- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 4 ++-- .../net/osmand/plus/activities/MapActivityActions.java | 4 ++-- .../net/osmand/plus/base/MapViewTrackingUtilities.java | 4 ++-- .../src/net/osmand/plus/helpers/ExternalApiHelper.java | 4 ++-- OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java | 2 +- .../net/osmand/plus/helpers/MapMarkerDialogHelper.java | 2 +- .../net/osmand/plus/mapcontextmenu/MapContextMenu.java | 4 ++-- .../net/osmand/plus/mapcontextmenu/MenuController.java | 2 +- .../controllers/AmenityMenuController.java | 2 +- .../controllers/FavouritePointMenuController.java | 4 ++-- .../controllers/MapMarkerMenuController.java | 4 ++-- .../controllers/WptPtMenuController.java | 4 ++-- .../plus/mapcontextmenu/editors/MapMarkerEditor.java | 2 +- .../editors/MapMarkerEditorFragment.java | 2 +- .../mapcontextmenu/editors/WptPtEditorFragment.java | 4 ++-- .../mapcontextmenu/editors/WptPtEditorFragmentNew.java | 4 ++-- .../plus/mapmarkers/CoordinateInputDialogFragment.java | 2 -- .../HistoryMarkerMenuBottomSheetDialogFragment.java | 2 +- .../plus/mapmarkers/MapMarkerSelectionFragment.java | 2 +- .../plus/mapmarkers/MapMarkersActiveFragment.java | 2 +- .../net/osmand/plus/mapmarkers/MapMarkersDbHelper.java | 5 ++--- .../plus/mapmarkers/MapMarkersDialogFragment.java | 5 ++--- .../plus/mapmarkers/MapMarkersGroupsFragment.java | 2 +- .../osmand/plus/{ => mapmarkers}/MapMarkersHelper.java | 10 +++++++--- .../plus/mapmarkers/MapMarkersHistoryFragment.java | 3 +-- .../plus/mapmarkers/MarkersPlanRouteContext.java | 1 - .../mapmarkers/OrderByBottomSheetDialogFragment.java | 3 +-- .../net/osmand/plus/mapmarkers/PlanRouteFragment.java | 3 +-- .../SelectWptCategoriesBottomSheetDialogFragment.java | 3 +-- .../mapmarkers/adapters/MapMarkersActiveAdapter.java | 6 +++--- .../mapmarkers/adapters/MapMarkersGroupsAdapter.java | 10 +++++----- .../mapmarkers/adapters/MapMarkersHistoryAdapter.java | 2 +- .../mapmarkers/adapters/MapMarkersListAdapter.java | 2 +- .../plus/myplaces/EditTrackGroupDialogFragment.java | 4 ++-- .../net/osmand/plus/myplaces/TrackPointFragment.java | 4 ++-- .../AddPointBottomSheetDialog.java | 4 ++-- .../plus/routepreparationmenu/MapRouteInfoMenu.java | 2 +- .../routepreparationmenu/cards/MapMarkersCard.java | 2 +- .../settings/backend/backup/MarkersSettingsItem.java | 4 ++-- .../plus/settings/backend/backup/SettingsHelper.java | 2 +- .../settings/fragments/DuplicatesSettingsAdapter.java | 2 +- .../fragments/ExportImportSettingsAdapter.java | 2 +- .../net/osmand/plus/views/layers/FavouritesLayer.java | 4 ++-- OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java | 6 +++--- .../net/osmand/plus/views/layers/MapMarkersLayer.java | 4 ++-- .../views/mapwidgets/MapMarkersWidgetsFactory.java | 4 ++-- .../plus/views/mapwidgets/RouteInfoWidgetsFactory.java | 2 +- 54 files changed, 89 insertions(+), 90 deletions(-) rename OsmAnd/src/net/osmand/plus/{ => mapmarkers}/MapMarkersHelper.java (99%) diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index ec3a9c1e10..89b5c95828 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -55,8 +55,8 @@ import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.GPXDatabase.GpxDataItem; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.SQLiteTileSource; diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 58690a9a3b..b172d08242 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -41,6 +41,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.monitoring.LiveMonitoringHelper; import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.poi.PoiFiltersHelper; diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 22beca7cbe..0e79b30e5b 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -16,7 +16,8 @@ import net.osmand.PlatformUtil; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.plus.GeocodingLookupService.AddressLookupRequest; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.util.Algorithms; diff --git a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java index 923bbe646a..b4d4fa0c3b 100644 --- a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java +++ b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java @@ -23,7 +23,8 @@ import net.osmand.PlatformUtil; import net.osmand.StateChangedListener; import net.osmand.data.LatLon; import net.osmand.plus.GPXDatabase.GpxDataItem; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.activities.SavingTrackHelper; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetAxisType; diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index b57d94dc3a..539db520ae 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -63,6 +63,7 @@ import net.osmand.plus.helpers.enums.MetricsConstants; import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.mapmarkers.MapMarkersDbHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper; import net.osmand.plus.monitoring.LiveMonitoringHelper; import net.osmand.plus.poi.PoiFiltersHelper; import net.osmand.plus.quickaction.QuickActionRegistry; diff --git a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java index 4b2079a573..63c84274c6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java @@ -27,8 +27,8 @@ import androidx.fragment.app.FragmentManager; import net.osmand.AndroidUtils; import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java index b1a625d27e..866503f477 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java @@ -41,7 +41,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.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper; import net.osmand.plus.OsmandApplication; import net.osmand.plus.settings.backend.OsmandPreference; import net.osmand.plus.settings.backend.OsmandSettings; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 8cb6e832c5..f9f8a81726 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -67,8 +67,8 @@ import net.osmand.plus.AppInitializer; import net.osmand.plus.AppInitializer.AppInitializeListener; import net.osmand.plus.AppInitializer.InitEvents; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; -import net.osmand.plus.MapMarkersHelper.MapMarker; -import net.osmand.plus.MapMarkersHelper.MapMarkerChangedListener; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OnDismissDialogFragmentListener; import net.osmand.plus.OsmAndConstants; import net.osmand.plus.OsmAndLocationSimulation; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 294b382ca4..ba13014b8f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -39,8 +39,8 @@ import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuAdapter.ItemClickListener; import net.osmand.plus.ContextMenuItem; import net.osmand.plus.ContextMenuItem.ItemBuilder; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 601fb62909..a0a3ef4edb 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -13,8 +13,8 @@ import net.osmand.data.LatLon; import net.osmand.data.RotatedTileBox; import net.osmand.map.IMapLocationListener; import net.osmand.map.WorldRegion; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkerChangedListener; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OsmAndConstants; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; diff --git a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java index 91d9a6f255..f6aa0f9526 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java @@ -31,8 +31,8 @@ import net.osmand.data.PointDescription; import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index 19748b100c..baadd43208 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -11,7 +11,7 @@ import net.osmand.PlatformUtil; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.map.TileSourceManager; -import net.osmand.plus.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java index 37bbbfda1a..a46e490635 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java @@ -10,7 +10,7 @@ import android.widget.TextView; import net.osmand.AndroidUtils; import net.osmand.Location; import net.osmand.data.LatLon; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 226216be06..6d99c3cad1 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -25,8 +25,8 @@ import net.osmand.data.TransportStop; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper.MapMarker; -import net.osmand.plus.MapMarkersHelper.MapMarkerChangedListener; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 55fc56b3b8..55f6063a87 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -32,7 +32,7 @@ import net.osmand.data.TransportStop; import net.osmand.map.OsmandRegions; import net.osmand.map.WorldRegion; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index 06ade3cc26..4f39b41773 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -12,7 +12,7 @@ import net.osmand.data.TransportStop; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiFilter; import net.osmand.osm.PoiType; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java index 9659ecd40b..4c53ded466 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java @@ -14,8 +14,8 @@ import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.TransportStop; import net.osmand.plus.FavouritesDbHelper; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java index b8f5789d47..6ea4e701e1 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java @@ -11,8 +11,8 @@ import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import net.osmand.data.PointDescription; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.settings.backend.OsmandPreference; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java index 3c1ce7d9f4..ddf3cecb9c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java @@ -11,8 +11,8 @@ import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.PointImageDrawable; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java index b90cd2c334..f75c71ca4c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java @@ -2,7 +2,7 @@ package net.osmand.plus.mapcontextmenu.editors; import androidx.annotation.NonNull; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.activities.MapActivity; public class MapMarkerEditor extends PointEditor { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java index ac0f69e37f..c925f95d4b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java @@ -14,7 +14,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import net.osmand.data.PointDescription; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java index 26062bafc4..80a937087f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java @@ -17,8 +17,8 @@ import net.osmand.GPXUtilities.WptPt; import net.osmand.data.LatLon; import net.osmand.data.WptLocationPoint; import net.osmand.plus.GpxSelectionHelper; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java index 92d6368a04..30da85d0bb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java @@ -20,8 +20,8 @@ import net.osmand.data.FavouritePoint.BackgroundType; import net.osmand.data.LatLon; import net.osmand.data.WptLocationPoint; import net.osmand.plus.GpxSelectionHelper; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index aef217f347..89ffdd389c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -63,7 +63,6 @@ import net.osmand.GPXUtilities.WptPt; import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.plus.GpxSelectionHelper; -import net.osmand.plus.MapMarkersHelper; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; @@ -79,7 +78,6 @@ 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.settings.backend.OsmandSettings; import net.osmand.plus.widgets.EditTextEx; import net.osmand.util.Algorithms; import net.osmand.util.LocationParser; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java index a1a3eaf82b..dc1e39bd92 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java @@ -3,7 +3,7 @@ package net.osmand.plus.mapmarkers; import android.os.Bundle; import android.view.View; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.R; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java index 993c5c1d93..e18a54c802 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java @@ -15,7 +15,7 @@ import androidx.annotation.Nullable; import net.osmand.AndroidUtils; import net.osmand.data.LatLon; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java index b893fbe5c8..69ec8af5a5 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java @@ -21,7 +21,7 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.WptLocationPoint; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java index d3c1c37705..1bdf8701b4 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java @@ -4,8 +4,8 @@ import androidx.annotation.Nullable; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; -import net.osmand.plus.MapMarkersHelper.MapMarker; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; @@ -13,7 +13,6 @@ import net.osmand.plus.helpers.SearchHistoryHelper; import net.osmand.util.Algorithms; import java.util.ArrayList; -import java.util.Calendar; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java index e84f7cbfc4..6d729c4ce2 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java @@ -29,9 +29,8 @@ import net.osmand.AndroidUtils; import net.osmand.Location; import net.osmand.data.LatLon; import net.osmand.plus.LockableViewPager; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersSortByDef; -import net.osmand.plus.MapMarkersHelper.OnGroupSyncedListener; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersSortByDef; +import net.osmand.plus.mapmarkers.MapMarkersHelper.OnGroupSyncedListener; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java index 5d368b7580..98b9128151 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java @@ -28,7 +28,7 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.WptLocationPoint; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java similarity index 99% rename from OsmAnd/src/net/osmand/plus/MapMarkersHelper.java rename to OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java index c168047ba9..c2615538a4 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java @@ -1,4 +1,4 @@ -package net.osmand.plus; +package net.osmand.plus.mapmarkers; import android.content.Context; import android.os.AsyncTask; @@ -19,10 +19,14 @@ import net.osmand.data.LatLon; import net.osmand.data.LocationPoint; import net.osmand.data.PointDescription; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; +import net.osmand.plus.GPXDatabase; +import net.osmand.plus.GeocodingLookupService; import net.osmand.plus.GeocodingLookupService.AddressLookupRequest; +import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.mapmarkers.MapMarkersDbHelper; -import net.osmand.plus.mapmarkers.MarkersPlanRouteContext; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; +import net.osmand.plus.Version; import net.osmand.plus.wikivoyage.data.TravelArticle; import net.osmand.plus.wikivoyage.data.TravelDbHelper; import net.osmand.util.Algorithms; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index a472dbf3a7..5cc2b081ab 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -20,8 +20,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.snackbar.Snackbar; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java index 025205cbca..622fa39542 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MarkersPlanRouteContext.java @@ -7,7 +7,6 @@ import net.osmand.data.LatLon; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.GPXUtilities.TrkSegment; import net.osmand.GPXUtilities.WptPt; -import net.osmand.plus.MapMarkersHelper; import net.osmand.plus.OsmandApplication; import net.osmand.plus.routing.RouteCalculationParams; import net.osmand.plus.routing.RouteCalculationResult; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java index 7239b76fcc..8e16b708b1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/OrderByBottomSheetDialogFragment.java @@ -4,8 +4,7 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.View; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersSortByDef; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersSortByDef; import net.osmand.plus.R; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index 60399c3872..8a891f7a11 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -39,8 +39,7 @@ import net.osmand.TspAnt; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.RotatedTileBox; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java index 0052bf655e..305d9a6b5b 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java @@ -13,8 +13,7 @@ import net.osmand.GPXUtilities.WptPt; import net.osmand.IndexConstants; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.base.MenuBottomSheetDialogFragment; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index 4b6eee036b..c81dffbf63 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -13,9 +13,9 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.snackbar.Snackbar; import net.osmand.data.LatLon; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java index 6b8a1b9dcd..650fb9e9e5 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupsAdapter.java @@ -21,11 +21,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.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.GroupHeader; -import net.osmand.plus.MapMarkersHelper.MapMarker; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; -import net.osmand.plus.MapMarkersHelper.ShowHideHistoryButton; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.GroupHeader; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper.ShowHideHistoryButton; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java index 024651d819..2278d0412d 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersHistoryAdapter.java @@ -10,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.snackbar.Snackbar; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java index 31695a085a..d01a845f68 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java @@ -17,7 +17,7 @@ import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.GeocodingLookupService.AddressLookupRequest; import net.osmand.plus.GeocodingLookupService.OnAddressLookupResult; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java index a08674368f..7a6c117058 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/EditTrackGroupDialogFragment.java @@ -28,8 +28,8 @@ import net.osmand.GPXUtilities.GPXFile; import net.osmand.GPXUtilities.WptPt; import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.EditFavoriteGroupDialogFragment.FavoriteColorAdapter; diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java index 72526e92ba..5c2f48f7e4 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackPointFragment.java @@ -54,8 +54,8 @@ import net.osmand.plus.GPXDatabase.GpxDataItem; import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItemType; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java index 4b2bfd6665..39ca914b7b 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/AddPointBottomSheetDialog.java @@ -27,8 +27,8 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.FavouritesDbHelper; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java index 4e16226026..b070f59264 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenu.java @@ -51,7 +51,7 @@ import net.osmand.plus.GeocodingLookupService; import net.osmand.plus.GeocodingLookupService.AddressLookupRequest; import net.osmand.plus.GeocodingLookupService.OnAddressLookupResult; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.settings.backend.OsmandSettings; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java index f4bbd99d8c..15bdb9af01 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java @@ -14,7 +14,7 @@ import androidx.appcompat.view.ContextThemeWrapper; import net.osmand.AndroidUtils; import net.osmand.data.LatLon; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.MapViewTrackingUtilities; diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java index 0d1f9d6bb8..e0ee6b758e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -7,8 +7,8 @@ import androidx.annotation.Nullable; import net.osmand.GPXUtilities; import net.osmand.GPXUtilities.GPXFile; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index 43e8fe22c2..176303632d 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -14,7 +14,7 @@ import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.SQLiteTileSource; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java index 58af347031..25d5ca9503 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java @@ -14,7 +14,7 @@ import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java index b695395673..eec6cde0f9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ExportImportSettingsAdapter.java @@ -17,7 +17,7 @@ import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java index d0a1b91d8b..1093d02e0f 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/FavouritesLayer.java @@ -17,8 +17,8 @@ import net.osmand.data.QuadTree; import net.osmand.data.RotatedTileBox; import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.base.PointImageDrawable; diff --git a/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java index 46d51bca33..4169e8da0a 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/GPXLayer.java @@ -37,9 +37,9 @@ import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; -import net.osmand.plus.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java index 244a9efc17..a8b992ddde 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/MapMarkersLayer.java @@ -31,8 +31,8 @@ import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.QuadPoint; import net.osmand.data.RotatedTileBox; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndConstants; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index 799490d949..733d23308b 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -9,8 +9,8 @@ import net.osmand.Location; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.UiUtilities; -import net.osmand.plus.MapMarkersHelper; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index f77bc27f36..b8e9c9e8f0 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -12,7 +12,7 @@ import android.view.View; import net.osmand.Location; import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; -import net.osmand.plus.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; From 7c4b28613c11633eee7212a76ec188e3ba91212f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 3 Nov 2020 23:21:33 +0200 Subject: [PATCH 03/47] Move inner classes from MapMarkersHelper --- OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 2 +- .../net/osmand/plus/FavouritesDbHelper.java | 2 +- .../net/osmand/plus/GpxSelectionHelper.java | 2 +- .../EditFavoriteGroupDialogFragment.java | 2 +- .../osmand/plus/activities/MapActivity.java | 2 +- .../plus/activities/MapActivityActions.java | 2 +- .../plus/base/MapViewTrackingUtilities.java | 4 +- .../plus/helpers/ExternalApiHelper.java | 2 +- .../net/osmand/plus/helpers/IntentHelper.java | 4 +- .../plus/helpers/MapMarkerDialogHelper.java | 2 +- .../plus/mapcontextmenu/MapContextMenu.java | 2 +- .../plus/mapcontextmenu/MenuController.java | 2 +- .../controllers/AmenityMenuController.java | 2 +- .../FavouritePointMenuController.java | 2 +- .../controllers/MapMarkerMenuController.java | 2 +- .../controllers/WptPtMenuController.java | 2 +- .../editors/MapMarkerEditor.java | 2 +- .../editors/MapMarkerEditorFragment.java | 2 +- .../editors/WptPtEditorFragment.java | 2 +- .../editors/WptPtEditorFragmentNew.java | 2 +- .../plus/mapmarkers/CategoriesSubHeader.java | 24 ++ .../CoordinateInputDialogFragment.java | 2 +- .../osmand/plus/mapmarkers/GroupHeader.java | 24 ++ ...ryMarkerMenuBottomSheetDialogFragment.java | 1 - .../net/osmand/plus/mapmarkers/MapMarker.java | 137 +++++++ .../MapMarkerSelectionFragment.java | 1 - .../mapmarkers/MapMarkersActiveFragment.java | 1 - .../plus/mapmarkers/MapMarkersDbHelper.java | 2 - .../mapmarkers/MapMarkersDialogFragment.java | 2 +- .../plus/mapmarkers/MapMarkersGroup.java | 183 +++++++++ .../mapmarkers/MapMarkersGroupsFragment.java | 1 - .../plus/mapmarkers/MapMarkersHelper.java | 380 ++---------------- .../mapmarkers/MapMarkersHistoryFragment.java | 1 - .../plus/mapmarkers/PlanRouteFragment.java | 1 - ...ptCategoriesBottomSheetDialogFragment.java | 1 - .../mapmarkers/ShowHideHistoryButton.java | 5 + .../adapters/MapMarkersActiveAdapter.java | 7 +- .../adapters/MapMarkersGroupsAdapter.java | 17 +- .../adapters/MapMarkersHistoryAdapter.java | 2 +- .../adapters/MapMarkersListAdapter.java | 2 +- .../EditTrackGroupDialogFragment.java | 2 +- .../plus/myplaces/TrackPointFragment.java | 2 +- .../AddPointBottomSheetDialog.java | 2 +- .../MapRouteInfoMenu.java | 2 +- .../cards/MapMarkersCard.java | 2 +- .../backend/backup/MarkersSettingsItem.java | 2 +- .../backend/backup/SettingsHelper.java | 2 +- .../fragments/DuplicatesSettingsAdapter.java | 2 +- .../ExportImportSettingsAdapter.java | 2 +- .../plus/views/layers/FavouritesLayer.java | 2 +- .../osmand/plus/views/layers/GPXLayer.java | 4 +- .../plus/views/layers/MapMarkersLayer.java | 2 +- .../mapwidgets/MapMarkersWidgetsFactory.java | 2 +- .../mapwidgets/RouteInfoWidgetsFactory.java | 2 +- 54 files changed, 467 insertions(+), 401 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java create mode 100644 OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java create mode 100644 OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java create mode 100644 OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroup.java create mode 100644 OsmAnd/src/net/osmand/plus/mapmarkers/ShowHideHistoryButton.java diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java index 89b5c95828..de3f073bdc 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java @@ -56,7 +56,7 @@ import net.osmand.plus.GPXDatabase.GpxDataItem; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.SQLiteTileSource; diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 0e79b30e5b..c1db6114bc 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -17,7 +17,7 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.plus.GeocodingLookupService.AddressLookupRequest; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.util.Algorithms; diff --git a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java index b4d4fa0c3b..2651e7b988 100644 --- a/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java +++ b/OsmAnd/src/net/osmand/plus/GpxSelectionHelper.java @@ -24,7 +24,7 @@ import net.osmand.StateChangedListener; import net.osmand.data.LatLon; import net.osmand.plus.GPXDatabase.GpxDataItem; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.activities.SavingTrackHelper; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetAxisType; diff --git a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java index 63c84274c6..001868e7b4 100644 --- a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java @@ -28,7 +28,7 @@ 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.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index f9f8a81726..f38012a987 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -67,7 +67,7 @@ import net.osmand.plus.AppInitializer; import net.osmand.plus.AppInitializer.AppInitializeListener; import net.osmand.plus.AppInitializer.InitEvents; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OnDismissDialogFragmentListener; import net.osmand.plus.OsmAndConstants; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index ba13014b8f..08fef7dd77 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -40,7 +40,7 @@ import net.osmand.plus.ContextMenuAdapter.ItemClickListener; import net.osmand.plus.ContextMenuItem; import net.osmand.plus.ContextMenuItem.ItemBuilder; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index a0a3ef4edb..9c6c6c2e7e 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -13,7 +13,7 @@ import net.osmand.data.LatLon; import net.osmand.data.RotatedTileBox; import net.osmand.map.IMapLocationListener; import net.osmand.map.WorldRegion; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OsmAndConstants; import net.osmand.plus.OsmAndLocationProvider; @@ -88,7 +88,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc } @Override - public void onMapMarkerChanged(MapMarkersHelper.MapMarker mapMarker) { + public void onMapMarkerChanged(MapMarker mapMarker) { } @Override diff --git a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java index f6aa0f9526..6222663a00 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/ExternalApiHelper.java @@ -32,7 +32,7 @@ import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java index baadd43208..d0d74badfe 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/IntentHelper.java @@ -11,7 +11,7 @@ import net.osmand.PlatformUtil; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.map.TileSourceManager; -import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; @@ -207,7 +207,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(MapMarkersHelper.MapMarkersGroup.MARKERS_SYNC_GROUP_ID)); + MapMarkersDialogFragment.showInstance(mapActivity, openMapMarkersGroupsExtra.getString(MapMarkersGroup.MARKERS_SYNC_GROUP_ID)); } mapActivity.setIntent(null); } diff --git a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java index a46e490635..a90247e644 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java @@ -10,7 +10,7 @@ import android.widget.TextView; import net.osmand.AndroidUtils; import net.osmand.Location; import net.osmand.data.LatLon; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 6d99c3cad1..1bb1e1146e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -25,7 +25,7 @@ import net.osmand.data.TransportStop; import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkerChangedListener; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 55f6063a87..d2c1cf155a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -32,7 +32,7 @@ import net.osmand.data.TransportStop; import net.osmand.map.OsmandRegions; import net.osmand.map.WorldRegion; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index 4f39b41773..aa65a39e90 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -12,7 +12,7 @@ import net.osmand.data.TransportStop; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiFilter; import net.osmand.osm.PoiType; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java index 4c53ded466..84ced6c613 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java @@ -15,7 +15,7 @@ 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.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java index 6ea4e701e1..29bc7c01aa 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java @@ -12,7 +12,7 @@ import androidx.core.content.ContextCompat; import net.osmand.data.PointDescription; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.settings.backend.OsmandPreference; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java index ddf3cecb9c..f436fb03fb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java @@ -12,7 +12,7 @@ import net.osmand.data.PointDescription; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.PointImageDrawable; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java index f75c71ca4c..ca97d1679f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditor.java @@ -2,7 +2,7 @@ package net.osmand.plus.mapcontextmenu.editors; import androidx.annotation.NonNull; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.activities.MapActivity; public class MapMarkerEditor extends PointEditor { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java index c925f95d4b..e580edd6eb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/MapMarkerEditorFragment.java @@ -14,7 +14,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import net.osmand.data.PointDescription; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java index 80a937087f..eaf3cc994b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragment.java @@ -18,7 +18,7 @@ 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.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java index 30da85d0bb..c973009798 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WptPtEditorFragmentNew.java @@ -21,7 +21,7 @@ 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.MapMarkersHelper.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java new file mode 100644 index 0000000000..aef2f28afd --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CategoriesSubHeader.java @@ -0,0 +1,24 @@ +package net.osmand.plus.mapmarkers; + +import androidx.annotation.DrawableRes; + +public class CategoriesSubHeader { + + @DrawableRes + private int iconRes; + private MapMarkersGroup group; + + public CategoriesSubHeader(int iconRes, MapMarkersGroup group) { + this.iconRes = iconRes; + this.group = group; + } + + @DrawableRes + public int getIconRes() { + return iconRes; + } + + public MapMarkersGroup getGroup() { + return group; + } +} diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java index 89ffdd389c..09eef3d06c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/CoordinateInputDialogFragment.java @@ -169,7 +169,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm private void syncGpx(GPXFile gpxFile) { MapMarkersHelper helper = getMyApplication().getMapMarkersHelper(); - MapMarkersHelper.MapMarkersGroup group = helper.getMarkersGroup(gpxFile); + MapMarkersGroup group = helper.getMarkersGroup(gpxFile); if (group != null) { helper.runSynchronization(group); } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java b/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java new file mode 100644 index 0000000000..c5c97a1c2e --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/GroupHeader.java @@ -0,0 +1,24 @@ +package net.osmand.plus.mapmarkers; + +import androidx.annotation.DrawableRes; + +public class GroupHeader { + + @DrawableRes + private int iconRes; + private MapMarkersGroup group; + + public GroupHeader(int iconRes, MapMarkersGroup group) { + this.iconRes = iconRes; + this.group = group; + } + + @DrawableRes + public int getIconRes() { + return iconRes; + } + + public MapMarkersGroup getGroup() { + return group; + } +} diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java index dc1e39bd92..a1cb1cafe6 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/HistoryMarkerMenuBottomSheetDialogFragment.java @@ -3,7 +3,6 @@ package net.osmand.plus.mapmarkers; import android.os.Bundle; import android.view.View; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.R; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java new file mode 100644 index 0000000000..172aea8a46 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java @@ -0,0 +1,137 @@ +package net.osmand.plus.mapmarkers; + +import android.content.Context; + +import androidx.core.content.ContextCompat; + +import net.osmand.GPXUtilities; +import net.osmand.data.FavouritePoint; +import net.osmand.data.LatLon; +import net.osmand.data.LocationPoint; +import net.osmand.data.PointDescription; +import net.osmand.plus.R; +import net.osmand.util.Algorithms; + +import static net.osmand.data.PointDescription.POINT_TYPE_MAP_MARKER; + +public class MapMarker implements LocationPoint { + private static int[] colors; + + public String id; + public LatLon point; + private PointDescription pointDescription; + public int colorIndex; + public int index; + public boolean history; + public boolean selected; + public int dist; + public long creationDate; + public long visitedDate; + public String nextKey; + public String groupKey; + public String groupName; + public GPXUtilities.WptPt wptPt; + public FavouritePoint favouritePoint; + public String mapObjectName; + + public MapMarker(LatLon point, PointDescription name, int colorIndex, boolean selected, int index) { + this.point = point; + this.pointDescription = name; + this.colorIndex = colorIndex; + this.selected = selected; + this.index = index; + } + + public int getType() { + return favouritePoint == null ? + (wptPt == null ? MapMarkersGroup.ANY_TYPE : MapMarkersGroup.GPX_TYPE) : + MapMarkersGroup.FAVORITES_TYPE; + } + + public PointDescription getPointDescription(Context ctx) { + return new PointDescription(POINT_TYPE_MAP_MARKER, ctx.getString(R.string.map_marker), getOnlyName()); + } + + public String getName(Context ctx) { + String name; + PointDescription pd = getPointDescription(ctx); + if (Algorithms.isEmpty(pd.getName())) { + name = pd.getTypeName(); + } else { + name = pd.getName(); + } + return name; + } + + public PointDescription getOriginalPointDescription() { + return pointDescription; + } + + public void setOriginalPointDescription(PointDescription pointDescription) { + this.pointDescription = pointDescription; + } + + public String getOnlyName() { + return pointDescription == null ? "" : pointDescription.getName(); + } + + public double getLatitude() { + return point.getLatitude(); + } + + public double getLongitude() { + return point.getLongitude(); + } + + @Override + public int getColor() { + return 0; + } + + @Override + public boolean isVisible() { + return false; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MapMarker mapMarker = (MapMarker) o; + + return colorIndex == mapMarker.colorIndex && point.equals(mapMarker.point); + } + + @Override + public int hashCode() { + int result = point.hashCode(); + result = 31 * result + colorIndex; + return result; + } + + private static final int[] colorsIds = new int[]{ + R.color.marker_blue, + R.color.marker_green, + R.color.marker_orange, + R.color.marker_red, + R.color.marker_yellow, + R.color.marker_teal, + R.color.marker_purple + }; + + public static int[] getColors(Context context) { + if (colors != null) { + return colors; + } + colors = new int[colorsIds.length]; + for (int i = 0; i < colorsIds.length; i++) { + colors[i] = ContextCompat.getColor(context, colorsIds[i]); + } + return colors; + } + + public static int getColorId(int colorIndex) { + return (colorIndex >= 0 && colorIndex < colorsIds.length) ? colorsIds[colorIndex] : colorsIds[0]; + } +} diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java index e18a54c802..cd723e7d7c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkerSelectionFragment.java @@ -15,7 +15,6 @@ import androidx.annotation.Nullable; import net.osmand.AndroidUtils; import net.osmand.data.LatLon; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java index 69ec8af5a5..d59dad4346 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java @@ -21,7 +21,6 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.WptLocationPoint; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java index 1bdf8701b4..0b2ba5ab0c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java @@ -4,8 +4,6 @@ import androidx.annotation.Nullable; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java index 6d729c4ce2..fd9f100c4b 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java @@ -429,7 +429,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS public void moveAllToHistoryOnClick() { if (mapActivity != null) { final MapMarkersHelper helper = mapActivity.getMyApplication().getMapMarkersHelper(); - final List markers = new ArrayList<>(helper.getMapMarkers()); + final List markers = new ArrayList<>(helper.getMapMarkers()); helper.moveAllActiveMarkersToHistory(); if (viewPager.getCurrentItem() == ACTIVE_MARKERS_POSITION) { activeFragment.updateAdapter(); diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroup.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroup.java new file mode 100644 index 0000000000..2a97af91c8 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroup.java @@ -0,0 +1,183 @@ +package net.osmand.plus.mapmarkers; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.plus.wikivoyage.data.TravelArticle; +import net.osmand.util.Algorithms; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class MapMarkersGroup { + + public static final int ANY_TYPE = -1; + public static final int FAVORITES_TYPE = 0; + public static final int GPX_TYPE = 1; + + public static final String MARKERS_SYNC_GROUP_ID = "markers_sync_group_id"; + + private String id; + private String name; + private int type = ANY_TYPE; + private Set wptCategories; + private long creationDate; + private boolean disabled; + private boolean visible = true; + private boolean wasShown = false; + private boolean visibleUntilRestart; + private List markers = new ArrayList<>(); + private TravelArticle wikivoyageArticle; + // TODO should be removed from this class: + private GroupHeader header; + private CategoriesSubHeader categoriesSubHeader; + private ShowHideHistoryButton showHideHistoryButton; + + public MapMarkersGroup() { + + } + + public MapMarkersGroup(@NonNull String id, @NonNull String name, int type) { + this.id = id; + this.name = name; + this.type = type; + } + + public String getId() { + return id; + } + + public String getGpxPath() { + return id; + } + + public TravelArticle getWikivoyageArticle() { + return wikivoyageArticle; + } + + public long getCreationDate() { + return creationDate; + } + + public void setCreationDate(long creationDate) { + this.creationDate = creationDate; + } + + public void setVisible(boolean visible) { + this.visible = visible; + } + + public void setMarkers(List markers) { + this.markers = markers; + } + + public void setHeader(GroupHeader header) { + this.header = header; + } + + public void setCategoriesSubHeader(CategoriesSubHeader categoriesSubHeader) { + this.categoriesSubHeader = categoriesSubHeader; + } + + public void setShowHideHistoryButton(ShowHideHistoryButton showHideHistoryButton) { + this.showHideHistoryButton = showHideHistoryButton; + } + + public boolean isWasShown() { + return wasShown; + } + + public boolean isVisibleUntilRestart() { + return visibleUntilRestart; + } + + public void setWikivoyageArticle(TravelArticle wikivoyageArticle) { + this.wikivoyageArticle = wikivoyageArticle; + } + + public String getName() { + return name; + } + + public int getType() { + return type; + } + + public void setWptCategories(Set wptCategories) { + this.wptCategories = wptCategories; + } + + public Set getWptCategories() { + return wptCategories; + } + + public boolean isDisabled() { + return disabled; + } + + public void setDisabled(boolean disabled) { + this.disabled = disabled; + } + + public boolean isVisible() { + return visible; + } + + public boolean wasShown() { + return wasShown; + } + + public void setWasShown(boolean wasShown) { + this.wasShown = wasShown; + } + + public void setVisibleUntilRestart(boolean visibleUntilRestart) { + this.visibleUntilRestart = visibleUntilRestart; + } + + public List getMarkers() { + return markers; + } + + public GroupHeader getGroupHeader() { + return header; + } + + public CategoriesSubHeader getCategoriesSubHeader() { + return categoriesSubHeader; + } + + public ShowHideHistoryButton getShowHideHistoryButton() { + return showHideHistoryButton; + } + + @Nullable + public String getWptCategoriesString() { + if (wptCategories != null) { + return Algorithms.encodeStringSet(wptCategories); + } + return null; + } + + public List getActiveMarkers() { + List markers = new ArrayList<>(this.markers); + List activeMarkers = new ArrayList<>(markers.size()); + for (MapMarker marker : markers) { + if (!marker.history) { + activeMarkers.add(marker); + } + } + return activeMarkers; + } + + public List getHistoryMarkers() { + List historyMarkers = new ArrayList<>(); + for (MapMarker marker : markers) { + if (marker.history) { + historyMarkers.add(marker); + } + } + return historyMarkers; + } +} diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java index 98b9128151..df071bf5b9 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java @@ -28,7 +28,6 @@ import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.WptLocationPoint; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java index c2615538a4..7184c79cc1 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java @@ -1,12 +1,10 @@ package net.osmand.plus.mapmarkers; -import android.content.Context; import android.os.AsyncTask; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.core.content.ContextCompat; import net.osmand.FileUtils; import net.osmand.GPXUtilities; @@ -16,7 +14,6 @@ import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; -import net.osmand.data.LocationPoint; import net.osmand.data.PointDescription; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; import net.osmand.plus.GPXDatabase; @@ -152,12 +149,12 @@ public class MapMarkersHelper { if (group == null) { if (noGroup == null) { noGroup = new MapMarkersGroup(); - noGroup.creationDate = Long.MAX_VALUE; + noGroup.setCreationDate(Long.MAX_VALUE); } noGroup.getMarkers().add(marker); } else { - if (marker.creationDate < group.creationDate) { - group.creationDate = marker.creationDate; + if (marker.creationDate < group.getCreationDate()) { + group.setCreationDate(marker.creationDate); } group.getMarkers().add(marker); } @@ -194,16 +191,17 @@ public class MapMarkersHelper { } private void lookupAddress(final MapMarker mapMarker) { - if (mapMarker != null && mapMarker.pointDescription.isSearchingAddress(ctx)) { + if (mapMarker != null && mapMarker.getOriginalPointDescription().isSearchingAddress(ctx)) { cancelPointAddressRequests(mapMarker.point); AddressLookupRequest lookupRequest = new AddressLookupRequest(mapMarker.point, new GeocodingLookupService.OnAddressLookupResult() { @Override public void geocodingDone(String address) { + PointDescription pointDescription = mapMarker.getOriginalPointDescription(); if (Algorithms.isEmpty(address)) { - mapMarker.pointDescription.setName(PointDescription.getAddressNotFoundStr(ctx)); + pointDescription.setName(PointDescription.getAddressNotFoundStr(ctx)); } else { - mapMarker.pointDescription.setName(address); + pointDescription.setName(address); } markersDbHelper.updateMarker(mapMarker); refreshMarker(mapMarker); @@ -295,7 +293,6 @@ public class MapMarkersHelper { }); } - public void runSynchronization(final @NonNull MapMarkersGroup group) { ctx.runInUIThread(new Runnable() { @Override @@ -305,19 +302,17 @@ public class MapMarkersHelper { }); } - public MapMarkersGroup getMarkersGroup(GPXFile gpx) { if(gpx == null || gpx.path == null) { return null; } return getMapMarkerGroupById(getMarkerGroupId(new File(gpx.path)), MapMarkersGroup.GPX_TYPE); } - + public MapMarkersGroup getMarkersGroup(FavoriteGroup favGroup) { return getMapMarkerGroupById(getMarkerGroupId(favGroup), MapMarkersGroup.FAVORITES_TYPE); } - public MapMarkersGroup addOrEnableGpxGroup(@NonNull File file) { updateGpxShowAsMarkers(file); MapMarkersGroup gr = getMapMarkerGroupById(getMarkerGroupId(file), MapMarkersGroup.GPX_TYPE); @@ -328,7 +323,7 @@ public class MapMarkersHelper { enableGroup(gr); return gr; } - + public MapMarkersGroup addOrEnableGroup(@NonNull GPXFile file) { updateGpxShowAsMarkers(new File(file.path)); MapMarkersGroup gr = getMarkersGroup(file); @@ -340,7 +335,6 @@ public class MapMarkersHelper { return gr; } - public MapMarkersGroup addOrEnableGroup(@NonNull FavoriteGroup group) { MapMarkersGroup gr = getMarkersGroup(group); if (gr == null) { @@ -350,7 +344,7 @@ public class MapMarkersHelper { enableGroup(gr); return gr; } - + public void enableGroup(@NonNull MapMarkersGroup gr) { // check if group doesn't exist internally if(!mapMarkersGroups.contains(gr)) { @@ -397,14 +391,14 @@ public class MapMarkersHelper { String id = group.getId(); if (id != null) { markersDbHelper.updateGroupDisabled(id, disabled); - group.disabled = disabled; + group.setDisabled(disabled); } } public void updateGroupWptCategories(@NonNull MapMarkersGroup group, Set wptCategories) { String id = group.getId(); if (id != null) { - group.wptCategories = wptCategories; + group.setWptCategories(wptCategories); if (wptCategories != null) { markersDbHelper.updateGroupCategories(id, group.getWptCategoriesString()); } @@ -416,7 +410,7 @@ public class MapMarkersHelper { markersDbHelper.removeActiveMarkersFromGroup(group.getId()); removeFromMapMarkersList(group.getActiveMarkers()); if (updateGroup) { - group.markers = group.getHistoryMarkers(); + group.setMarkers(group.getHistoryMarkers()); updateGroup(group); } reorderActiveMarkersIfNeeded(); @@ -439,12 +433,12 @@ public class MapMarkersHelper { ShowHideHistoryButton showHideHistoryButton = mapMarkersGroup.getShowHideHistoryButton(); if (showHideHistoryButton != null) { if (historyMarkersCount == 0) { - mapMarkersGroup.showHideHistoryButton = null; + mapMarkersGroup.setShowHideHistoryButton(null); } } else if (historyMarkersCount > 0) { showHideHistoryButton = new ShowHideHistoryButton(); showHideHistoryButton.showHistory = false; - mapMarkersGroup.showHideHistoryButton = showHideHistoryButton; + mapMarkersGroup.setShowHideHistoryButton(showHideHistoryButton); } } @@ -464,10 +458,8 @@ public class MapMarkersHelper { sortMarkers(mapMarkersGroup.getMarkers(), false, BY_DATE_ADDED_DESC); } } else { - mapMarkersGroup = new MapMarkersGroup(); - mapMarkersGroup.id = marker.groupKey; - mapMarkersGroup.name = marker.groupName; - mapMarkersGroup.creationDate = Long.MAX_VALUE; + mapMarkersGroup = new MapMarkersGroup(marker.groupKey, marker.groupName, MapMarkersGroup.ANY_TYPE); + mapMarkersGroup.setCreationDate(Long.MAX_VALUE); mapMarkersGroup.getMarkers().add(marker); addToGroupsList(mapMarkersGroup); sortGroups(); @@ -477,18 +469,19 @@ public class MapMarkersHelper { } private void createHeadersInGroup(@NonNull MapMarkersGroup group) { - GroupHeader header = new GroupHeader(); - CategoriesSubHeader categoriesSubHeader = new CategoriesSubHeader(); int type = group.getType(); + int headerIconId = 0; + int subHeaderIconId = 0; if (type != -1) { - header.iconRes = type == MapMarkersGroup.FAVORITES_TYPE + headerIconId = type == MapMarkersGroup.FAVORITES_TYPE ? R.drawable.ic_action_favorite : R.drawable.ic_action_polygom_dark; - categoriesSubHeader.iconRes = R.drawable.ic_action_filter; + subHeaderIconId = R.drawable.ic_action_filter; } - header.group = group; - categoriesSubHeader.group = group; - group.header = header; - group.categoriesSubHeader = categoriesSubHeader; + GroupHeader header = new GroupHeader(headerIconId, group); + CategoriesSubHeader categoriesSubHeader = new CategoriesSubHeader(subHeaderIconId, group); + + group.setHeader(header); + group.setCategoriesSubHeader(categoriesSubHeader); } private void removeMarkerFromGroup(MapMarker marker) { @@ -506,8 +499,8 @@ public class MapMarkersHelper { Collections.sort(mapMarkersGroups, new Comparator() { @Override public int compare(MapMarkersGroup group1, MapMarkersGroup group2) { - long t1 = group1.creationDate; - long t2 = group2.creationDate; + long t1 = group1.getCreationDate(); + long t2 = group2.getCreationDate(); return (t1 > t2) ? -1 : ((t1 == t2) ? 0 : 1); } }); @@ -519,7 +512,7 @@ public class MapMarkersHelper { for (MapMarkersGroup group : mapMarkersGroups) { if ((id == null && group.getId() == null) || (group.getId() != null && group.getId().equals(id))) { - if(type == MapMarkersGroup.ANY_TYPE || type == group.type) { + if (type == MapMarkersGroup.ANY_TYPE || type == group.getType()) { return group; } } @@ -532,7 +525,7 @@ public class MapMarkersHelper { Algorithms.getFileNameWithoutExtension(fl.getName()), MapMarkersGroup.GPX_TYPE); } - + private MapMarkersGroup createFavMarkerGroup(FavoriteGroup favGroup) { return new MapMarkersGroup(favGroup.getName(), favGroup.getName(), MapMarkersGroup.FAVORITES_TYPE); } @@ -540,11 +533,11 @@ public class MapMarkersHelper { private String getMarkerGroupId(File gpx) { return gpx.getAbsolutePath(); } - + private String getMarkerGroupId(FavoriteGroup group) { return group.getName(); } - + @NonNull public List getGroupsForDisplayedGpx() { List res = new ArrayList<>(); @@ -553,14 +546,14 @@ public class MapMarkersHelper { MapMarkersGroup search = getMarkersGroup(selected.getGpxFile()); if (search == null && selected.getGpxFile() != null && selected.getGpxFile().path != null) { MapMarkersGroup group = createGPXMarkerGroup(new File(selected.getGpxFile().path)); - group.disabled = true; + group.setDisabled(true); createHeadersInGroup(group); res.add(group); } } return res; } - + @NonNull public List getGroupsForSavedArticlesTravelBook() { List res = new ArrayList<>(); @@ -574,7 +567,7 @@ public class MapMarkersHelper { MapMarkersGroup search = getMapMarkerGroupById(getMarkerGroupId(path), MapMarkersGroup.GPX_TYPE); if (search == null) { MapMarkersGroup group = createGPXMarkerGroup(path); - group.disabled = true; + group.setDisabled(true); createHeadersInGroup(group); res.add(group); } @@ -1159,7 +1152,7 @@ public class MapMarkersHelper { if (favGroup == null) { return; } - group.visible = favGroup.isVisible(); + group.setVisible(favGroup.isVisible()); if (!group.isVisible() || group.isDisabled()) { removeGroupActiveMarkers(group, true); return; @@ -1179,17 +1172,17 @@ public class MapMarkersHelper { String gpxPath = group.getId(); SelectedGpxFile selectedGpxFile = gpxHelper.getSelectedFileByPath(gpxPath); GPXFile gpx = selectedGpxFile == null ? null : selectedGpxFile.getGpxFile(); - group.visible = gpx != null || group.visibleUntilRestart; + group.setVisible(gpx != null || group.isVisibleUntilRestart()); if (gpx == null || group.isDisabled()) { removeGroupActiveMarkers(group, true); return; } - boolean addAll = group.wptCategories == null || group.wptCategories.isEmpty(); + boolean addAll = group.getWptCategories() == null || group.getWptCategories().isEmpty(); List gpxPoints = new ArrayList<>(gpx.getPoints()); for (WptPt pt : gpxPoints) { - if (addAll || group.wptCategories.contains(pt.category) - || (pt.category == null && group.wptCategories.contains(""))) { + if (addAll || group.getWptCategories().contains(pt.category) + || (pt.category == null && group.getWptCategories().contains(""))) { addNewMarkerIfNeeded(group, groupMarkers, new LatLon(pt.lat, pt.lon), pt.name, null, pt); } } @@ -1212,295 +1205,4 @@ public class MapMarkersHelper { } } } - - public static class MapMarkersGroup { - - public static final int ANY_TYPE = -1; - public static final int FAVORITES_TYPE = 0; - public static final int GPX_TYPE = 1; - - public static final String MARKERS_SYNC_GROUP_ID = "markers_sync_group_id"; - - private String id; - private String name; - private int type = -1; - private Set wptCategories; - private long creationDate; - private boolean disabled; - private boolean visible = true; - private boolean wasShown = false; - private boolean visibleUntilRestart; - private List markers = new ArrayList<>(); - private TravelArticle wikivoyageArticle; - // TODO should be removed from this class: - private GroupHeader header; - private CategoriesSubHeader categoriesSubHeader; - private ShowHideHistoryButton showHideHistoryButton; - - public MapMarkersGroup() { - - } - - public MapMarkersGroup(@NonNull String id, @NonNull String name, int type) { - this.id = id; - this.name = name; - this.type = type; - } - - public String getId() { - return id; - } - - public String getGpxPath() { - return id; - } - - public TravelArticle getWikivoyageArticle() { - return wikivoyageArticle; - } - - public void setWikivoyageArticle(TravelArticle wikivoyageArticle) { - this.wikivoyageArticle = wikivoyageArticle; - } - - public String getName() { - return name; - } - - public int getType() { - return type; - } - - public void setWptCategories(Set wptCategories) { - this.wptCategories = wptCategories; - } - - public Set getWptCategories() { - return wptCategories; - } - - public boolean isDisabled() { - return disabled; - } - - public void setDisabled(boolean disabled) { - this.disabled = disabled; - } - - public boolean isVisible() { - return visible; - } - - public boolean wasShown() { - return wasShown; - } - - public void setWasShown(boolean wasShown) { - this.wasShown = wasShown; - } - - public void setVisibleUntilRestart(boolean visibleUntilRestart) { - this.visibleUntilRestart = visibleUntilRestart; - } - - public List getMarkers() { - return markers; - } - - public GroupHeader getGroupHeader() { - return header; - } - - public CategoriesSubHeader getCategoriesSubHeader() { - return categoriesSubHeader; - } - - public ShowHideHistoryButton getShowHideHistoryButton() { - return showHideHistoryButton; - } - - @Nullable - public String getWptCategoriesString() { - if (wptCategories != null) { - return Algorithms.encodeStringSet(wptCategories); - } - return null; - } - - public List getActiveMarkers() { - List markers = new ArrayList<>(this.markers); - List activeMarkers = new ArrayList<>(markers.size()); - for (MapMarker marker : markers) { - if (!marker.history) { - activeMarkers.add(marker); - } - } - return activeMarkers; - } - - public List getHistoryMarkers() { - List historyMarkers = new ArrayList<>(); - for (MapMarker marker : markers) { - if (marker.history) { - historyMarkers.add(marker); - } - } - return historyMarkers; - } - } - - public static class ShowHideHistoryButton { - public boolean showHistory; - } - - public static class GroupHeader { - private int iconRes; - private MapMarkersGroup group; - - public int getIconRes() { - return iconRes; - } - - public MapMarkersGroup getGroup() { - return group; - } - } - - public static class CategoriesSubHeader { - private int iconRes; - private MapMarkersGroup group; - - public int getIconRes() { - return iconRes; - } - - public MapMarkersGroup getGroup() { - return group; - } - } - - public static class MapMarker implements LocationPoint { - private static int[] colors; - - public String id; - public LatLon point; - private PointDescription pointDescription; - public int colorIndex; - public int index; - public boolean history; - public boolean selected; - public int dist; - public long creationDate; - public long visitedDate; - public String nextKey; - public String groupKey; - public String groupName; - public WptPt wptPt; - public FavouritePoint favouritePoint; - public String mapObjectName; - - public MapMarker(LatLon point, PointDescription name, int colorIndex, boolean selected, int index) { - this.point = point; - this.pointDescription = name; - this.colorIndex = colorIndex; - this.selected = selected; - this.index = index; - } - - public int getType() { - return favouritePoint == null ? - (wptPt == null ? MapMarkersGroup.ANY_TYPE : MapMarkersGroup.GPX_TYPE) : - MapMarkersGroup.FAVORITES_TYPE; - } - - public PointDescription getPointDescription(Context ctx) { - return new PointDescription(POINT_TYPE_MAP_MARKER, ctx.getString(R.string.map_marker), getOnlyName()); - } - - public String getName(Context ctx) { - String name; - PointDescription pd = getPointDescription(ctx); - if (Algorithms.isEmpty(pd.getName())) { - name = pd.getTypeName(); - } else { - name = pd.getName(); - } - return name; - } - - public PointDescription getOriginalPointDescription() { - return pointDescription; - } - - public void setOriginalPointDescription(PointDescription pointDescription) { - this.pointDescription = pointDescription; - } - - public String getOnlyName() { - return pointDescription == null ? "" : pointDescription.getName(); - } - - public double getLatitude() { - return point.getLatitude(); - } - - public double getLongitude() { - return point.getLongitude(); - } - - @Override - public int getColor() { - return 0; - } - - @Override - public boolean isVisible() { - return false; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - MapMarker mapMarker = (MapMarker) o; - - return colorIndex == mapMarker.colorIndex && point.equals(mapMarker.point); - } - - @Override - public int hashCode() { - int result = point.hashCode(); - result = 31 * result + colorIndex; - return result; - } - - private static final int[] colorsIds = new int[]{ - R.color.marker_blue, - R.color.marker_green, - R.color.marker_orange, - R.color.marker_red, - R.color.marker_yellow, - R.color.marker_teal, - R.color.marker_purple - }; - - public static int[] getColors(Context context) { - if (colors != null) { - return colors; - } - colors = new int[colorsIds.length]; - for (int i = 0; i < colorsIds.length; i++) { - colors[i] = ContextCompat.getColor(context, colorsIds[i]); - } - return colors; - } - - public static int getColorId(int colorIndex) { - return (colorIndex >= 0 && colorIndex < colorsIds.length) ? colorsIds[colorIndex] : colorsIds[0]; - } - } - - - -} +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index 5cc2b081ab..c631e3d3e7 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -20,7 +20,6 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.snackbar.Snackbar; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index 8a891f7a11..3e0842710c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -39,7 +39,6 @@ import net.osmand.TspAnt; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.data.RotatedTileBox; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java index 305d9a6b5b..d676372223 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/SelectWptCategoriesBottomSheetDialogFragment.java @@ -13,7 +13,6 @@ import net.osmand.GPXUtilities.WptPt; import net.osmand.IndexConstants; import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.base.MenuBottomSheetDialogFragment; diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/ShowHideHistoryButton.java b/OsmAnd/src/net/osmand/plus/mapmarkers/ShowHideHistoryButton.java new file mode 100644 index 0000000000..b21b656299 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/ShowHideHistoryButton.java @@ -0,0 +1,5 @@ +package net.osmand.plus.mapmarkers; + +public class ShowHideHistoryButton { + public boolean showHistory; +} diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index c81dffbf63..c1e85387b3 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -13,9 +13,8 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.snackbar.Snackbar; import net.osmand.data.LatLon; -import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarker; -import net.osmand.plus.mapmarkers.MapMarkersHelper.MapMarkersGroup; +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; @@ -215,7 +214,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter Date: Sun, 8 Nov 2020 17:00:41 +0200 Subject: [PATCH 04/47] Show markers groups in import settings UI --- .../backend/backup/MarkersSettingsItem.java | 15 ++++++++------- .../fragments/ImportDuplicatesFragment.java | 8 ++++++++ .../fragments/ImportSettingsFragment.java | 9 +++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java index 10384f2d2d..99722505d0 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -96,7 +96,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem public boolean isDuplicate(@NonNull MapMarkersGroup markersGroup) { String name = markersGroup.getName(); for (MapMarkersGroup group : existingItems) { - if (group.getName().equals(name)) { + if (Algorithms.stringsEqual(group.getName(), name)) { return true; } } @@ -139,12 +139,13 @@ public class MarkersSettingsItem extends CollectionSettingsItem @Override public boolean writeToStream(@NonNull OutputStream outputStream) throws IOException { -// Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); -// if (error != null) { -// warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); -// SettingsHelper.LOG.error("Failed write to gpx file", error); -// return false; -// } + GPXFile gpxFile = generateGpx(); + Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); + if (error != null) { + warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); + SettingsHelper.LOG.error("Failed write to gpx file", error); + return false; + } return true; } }; diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java index 14d89803e2..c2610d06a2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportDuplicatesFragment.java @@ -32,6 +32,7 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.osmedit.OpenstreetmapPoint; import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.poi.PoiUIFilter; @@ -200,6 +201,7 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment { List ttsVoiceFilesList = new ArrayList<>(); List voiceFilesList = new ArrayList<>(); List mapFilesList = new ArrayList<>(); + List markersGroups = new ArrayList<>(); for (Object object : duplicatesList) { if (object instanceof ApplicationMode.ApplicationModeBean) { @@ -236,6 +238,8 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment { osmNotesPointList.add((OsmNotesPoint) object); } else if (object instanceof OpenstreetmapPoint) { osmEditsPointList.add((OpenstreetmapPoint) object); + } else if (object instanceof MapMarkersGroup) { + markersGroups.add((MapMarkersGroup) object); } } if (!profiles.isEmpty()) { @@ -298,6 +302,10 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment { duplicates.add(getString(R.string.local_indexes_cat_voice)); duplicates.addAll(voiceFilesList); } + if (!markersGroups.isEmpty()) { + duplicates.add(getString(R.string.map_markers)); + duplicates.addAll(markersGroups); + } return duplicates; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index f9960db436..d7ae7eb77b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -41,6 +41,7 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.osmedit.OpenstreetmapPoint; import net.osmand.plus.osmedit.OsmNotesPoint; import net.osmand.plus.poi.PoiUIFilter; @@ -49,6 +50,7 @@ import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; import net.osmand.plus.settings.backend.ExportSettingsType; import net.osmand.plus.settings.backend.backup.FavoritesSettingsItem; import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; +import net.osmand.plus.settings.backend.backup.MarkersSettingsItem; import net.osmand.plus.settings.backend.backup.OsmEditsSettingsItem; import net.osmand.plus.settings.backend.backup.OsmNotesSettingsItem; import net.osmand.plus.settings.backend.backup.SettingsHelper; @@ -436,6 +438,7 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { List osmNotesPointList = new ArrayList<>(); List osmEditsPointList = new ArrayList<>(); List favoriteGroups = new ArrayList<>(); + List markersGroups = new ArrayList<>(); for (Object object : data) { if (object instanceof ApplicationModeBean) { appModeBeans.add((ApplicationModeBean) object); @@ -459,6 +462,8 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { favoriteGroups.add((FavoriteGroup) object); } else if (object instanceof GlobalSettingsItem) { settingsItems.add((GlobalSettingsItem) object); + } else if (object instanceof MapMarkersGroup) { + markersGroups.add((MapMarkersGroup) object); } } if (!appModeBeans.isEmpty()) { @@ -490,6 +495,10 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { FavoritesSettingsItem baseItem = getBaseItem(SettingsItemType.FAVOURITES, FavoritesSettingsItem.class); settingsItems.add(new FavoritesSettingsItem(app, baseItem, favoriteGroups)); } + if (!markersGroups.isEmpty()) { + MarkersSettingsItem baseItem = getBaseItem(SettingsItemType.MARKERS, MarkersSettingsItem.class); + settingsItems.add(new MarkersSettingsItem(app, baseItem, markersGroups)); + } return settingsItems; } From 460980a475829e74c19fa7b2e96412fb37b8b5f4 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 9 Nov 2020 10:31:17 +0200 Subject: [PATCH 05/47] Export and import markers to file --- .../mapmarkers/MapMarkersDialogFragment.java | 2 +- .../plus/mapmarkers/MapMarkersHelper.java | 42 ++++++--- .../backend/backup/MarkersSettingsItem.java | 93 +++++++++++++++++-- 3 files changed, 116 insertions(+), 21 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java index fd9f100c4b..2a50192d03 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java @@ -481,7 +481,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS @Override public void saveGpx(final String fileName) { - final String gpxPath = mapActivity.getMyApplication().getMapMarkersHelper().generateGpx(fileName); + final String gpxPath = mapActivity.getMyApplication().getMapMarkersHelper().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 diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java index 7184c79cc1..d6d9b7cd2f 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java @@ -5,6 +5,7 @@ import android.os.AsyncTask; import androidx.annotation.IntDef; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import net.osmand.FileUtils; import net.osmand.GPXUtilities; @@ -58,6 +59,10 @@ public class MapMarkersHelper { public static final int BY_DATE_ADDED_ASC = 4; + public static final String GROUP_NAME = "group_name"; + public static final String GROUP_TYPE = "group_type"; + public static final String MARKER_HISTORY = "marker_history"; + private static final Log LOG = PlatformUtil.getLog(MapMarkersHelper.class); @Retention(RetentionPolicy.SOURCE) @@ -303,7 +308,7 @@ public class MapMarkersHelper { } public MapMarkersGroup getMarkersGroup(GPXFile gpx) { - if(gpx == null || gpx.path == null) { + if (gpx == null || gpx.path == null) { return null; } return getMapMarkerGroupById(getMarkerGroupId(new File(gpx.path)), MapMarkersGroup.GPX_TYPE); @@ -347,7 +352,7 @@ public class MapMarkersHelper { public void enableGroup(@NonNull MapMarkersGroup gr) { // check if group doesn't exist internally - if(!mapMarkersGroups.contains(gr)) { + if (!mapMarkersGroups.contains(gr)) { addGroupInternally(gr); } if (gr.isDisabled()) { @@ -558,12 +563,12 @@ public class MapMarkersHelper { public List getGroupsForSavedArticlesTravelBook() { List res = new ArrayList<>(); TravelDbHelper travelDbHelper = ctx.getTravelDbHelper(); - if(travelDbHelper.getSelectedTravelBook() != null) { + if (travelDbHelper.getSelectedTravelBook() != null) { List savedArticles = travelDbHelper.getLocalDataHelper().getSavedArticles(); for (TravelArticle art : savedArticles) { String gpxName = travelDbHelper.getGPXName(art); File path = ctx.getAppPath(IndexConstants.GPX_TRAVEL_DIR + gpxName); - LOG.debug("Article group " + path.getAbsolutePath() + " " + path.exists()) ; + LOG.debug("Article group " + path.getAbsolutePath() + " " + path.exists()); MapMarkersGroup search = getMapMarkerGroupById(getMarkerGroupId(path), MapMarkersGroup.GPX_TYPE); if (search == null) { MapMarkersGroup group = createGPXMarkerGroup(path); @@ -1001,7 +1006,8 @@ public class MapMarkersHelper { }); } - public String generateGpx(String fileName) { + public String saveMarkersToFile(String fileName) { + GPXFile gpxFile = generateGpx(); String dirName = IndexConstants.GPX_INDEX_DIR + IndexConstants.MAP_MARKERS_INDEX_DIR; File dir = ctx.getAppPath(dirName); if (!dir.exists()) { @@ -1009,18 +1015,32 @@ public class MapMarkersHelper { } String uniqueFileName = FileUtils.createUniqueFileName(ctx, fileName, dirName, IndexConstants.GPX_FILE_EXT); File fout = new File(dir, uniqueFileName + IndexConstants.GPX_FILE_EXT); + GPXUtilities.writeGpxFile(fout, gpxFile); - GPXFile file = new GPXFile(Version.getFullVersion(ctx)); - for (MapMarker marker : mapMarkers) { + return fout.getAbsolutePath(); + } + + public GPXFile generateGpx() { + return generateGpx(mapMarkers, false); + } + + public GPXFile generateGpx(List markers, boolean completeBackup) { + GPXFile gpxFile = new GPXFile(Version.getFullVersion(ctx)); + for (MapMarker marker : markers) { WptPt wpt = new WptPt(); wpt.lat = marker.getLatitude(); wpt.lon = marker.getLongitude(); - wpt.setColor(ctx.getResources().getColor(MapMarker.getColorId(marker.colorIndex))); wpt.name = marker.getOnlyName(); - file.addPoint(wpt); + wpt.setColor(ContextCompat.getColor(ctx, MapMarker.getColorId(marker.colorIndex))); + if (completeBackup) { + wpt.category = marker.groupKey; + wpt.getExtensionsToWrite().put(GROUP_NAME, marker.groupName); + wpt.getExtensionsToWrite().put(GROUP_TYPE, String.valueOf(marker.getType())); + wpt.getExtensionsToWrite().put(MARKER_HISTORY, String.valueOf(marker.history)); + } + gpxFile.addPoint(wpt); } - GPXUtilities.writeGpxFile(fout, file); - return fout.getAbsolutePath(); + return gpxFile; } // --------------------------------------------------------------------------------------------- diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java index 99722505d0..0b57280d3a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -7,28 +7,37 @@ import androidx.annotation.Nullable; import net.osmand.GPXUtilities; import net.osmand.GPXUtilities.GPXFile; -import net.osmand.plus.mapmarkers.MapMarkersHelper; -import net.osmand.plus.mapmarkers.MapMarkersGroup; +import net.osmand.GPXUtilities.WptPt; +import net.osmand.data.LatLon; +import net.osmand.data.PointDescription; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; +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.util.Algorithms; import org.json.JSONException; import org.json.JSONObject; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import static net.osmand.IndexConstants.GPX_FILE_EXT; +import static net.osmand.plus.mapmarkers.MapMarkersHelper.GROUP_NAME; +import static net.osmand.plus.mapmarkers.MapMarkersHelper.GROUP_TYPE; public class MarkersSettingsItem extends CollectionSettingsItem { private MapMarkersHelper markersHelper; + private Map flatGroups = new LinkedHashMap<>(); public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { super(app, null, items); @@ -85,9 +94,20 @@ public class MarkersSettingsItem extends CollectionSettingsItem for (MapMarkersGroup duplicate : duplicateItems) { if (shouldReplace) { - + MapMarkersGroup existingGroup = markersHelper.getMapMarkerGroupById(duplicate.getId(), duplicate.getType()); + if (existingGroup != null) { + List existingMarkers = new ArrayList<>(existingGroup.getMarkers()); + for (MapMarker marker : existingMarkers) { + markersHelper.removeMarker(marker); + } + } + } + appliedItems.add(duplicate); + } + for (MapMarkersGroup markersGroup : appliedItems) { + for (MapMarker marker : markersGroup.getMarkers()) { + markersHelper.addMapMarker(marker.point, marker.getOriginalPointDescription()); } - appliedItems.add(shouldReplace ? duplicate : renameItem(duplicate)); } } } @@ -96,7 +116,9 @@ public class MarkersSettingsItem extends CollectionSettingsItem public boolean isDuplicate(@NonNull MapMarkersGroup markersGroup) { String name = markersGroup.getName(); for (MapMarkersGroup group : existingItems) { - if (Algorithms.stringsEqual(group.getName(), name)) { + if (Algorithms.stringsEqual(group.getName(), name) + && !Algorithms.isEmpty(group.getMarkers()) + && !Algorithms.isEmpty(markersGroup.getMarkers())) { return true; } } @@ -120,18 +142,62 @@ public class MarkersSettingsItem extends CollectionSettingsItem return new SettingsItemReader(this) { @Override - public void readFromStream(@NonNull InputStream inputStream, File destination) throws IOException, IllegalArgumentException { + public void readFromStream(@NonNull InputStream inputStream, String entryName) throws IllegalArgumentException { GPXFile gpxFile = GPXUtilities.loadGPXFile(inputStream); if (gpxFile.error != null) { warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType()))); SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error); } else { - Map flatGroups = new LinkedHashMap<>(); + List markerColors = getMarkersColors(); + for (WptPt point : gpxFile.getPoints()) { + LatLon latLon = new LatLon(point.lat, point.lon); + + int colorIndex = markerColors.indexOf(point.getColor()); + if (colorIndex == -1) { + colorIndex = 0; + } + + PointDescription pointDescription = new PointDescription(PointDescription.POINT_TYPE_LOCATION, point.name); + MapMarker marker = new MapMarker(latLon, pointDescription, colorIndex, false, 0); + marker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE; + + MapMarkersGroup group = getOrCreateGroup(point); + group.getMarkers().add(marker); + } } } }; } + private MapMarkersGroup getOrCreateGroup(WptPt point) { + MapMarkersGroup markersGroup = flatGroups.get(point.category); + if (markersGroup != null) { + return markersGroup; + } + Map extensions = point.getExtensionsToRead(); + String groupName = extensions.get(GROUP_NAME); + String groupType = extensions.get(GROUP_TYPE); + int type = Algorithms.parseIntSilently(groupType, MapMarkersGroup.ANY_TYPE); + + if (point.category != null && groupName != null) { + markersGroup = new MapMarkersGroup(point.category, groupName, type); + } else { + markersGroup = new MapMarkersGroup(); + } + flatGroups.put(markersGroup.getId(), markersGroup); + items.add(markersGroup); + + return markersGroup; + } + + private List getMarkersColors() { + List colors = new ArrayList<>(); + for (int color : MapMarker.getColors(app)) { + colors.add(color); + } + return colors; + } + @Nullable @Override SettingsItemWriter getWriter() { @@ -139,7 +205,8 @@ public class MarkersSettingsItem extends CollectionSettingsItem @Override public boolean writeToStream(@NonNull OutputStream outputStream) throws IOException { - GPXFile gpxFile = generateGpx(); + List mapMarkers = getMarkersFromGroups(items); + GPXFile gpxFile = markersHelper.generateGpx(mapMarkers, true); Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); if (error != null) { warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); @@ -150,4 +217,12 @@ public class MarkersSettingsItem extends CollectionSettingsItem } }; } + + private List getMarkersFromGroups(List markersGroups) { + List mapMarkers = new ArrayList<>(); + for (MapMarkersGroup group : markersGroups) { + mapMarkers.addAll(group.getMarkers()); + } + return mapMarkers; + } } \ No newline at end of file From f57e0324ffb7ac5ab8c47683dfba75c578080fee Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 9 Nov 2020 11:27:21 +0200 Subject: [PATCH 06/47] Add history markers to exported file --- .../net/osmand/plus/mapmarkers/MapMarkersHelper.java | 4 ++++ .../settings/backend/backup/MarkersSettingsItem.java | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java index d6d9b7cd2f..dc3a25a61e 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java @@ -62,6 +62,8 @@ public class MapMarkersHelper { public static final String GROUP_NAME = "group_name"; public static final String GROUP_TYPE = "group_type"; public static final String MARKER_HISTORY = "marker_history"; + public static final String CREATION_DATE = "creation_date"; + public static final String VISITED_DATE = "visited_date"; private static final Log LOG = PlatformUtil.getLog(MapMarkersHelper.class); @@ -1037,6 +1039,8 @@ public class MapMarkersHelper { wpt.getExtensionsToWrite().put(GROUP_NAME, marker.groupName); wpt.getExtensionsToWrite().put(GROUP_TYPE, String.valueOf(marker.getType())); wpt.getExtensionsToWrite().put(MARKER_HISTORY, String.valueOf(marker.history)); + wpt.getExtensionsToWrite().put(CREATION_DATE, String.valueOf(marker.creationDate)); + wpt.getExtensionsToWrite().put(VISITED_DATE, String.valueOf(marker.visitedDate)); } gpxFile.addPoint(wpt); } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java index 0b57280d3a..4a8026ea44 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -31,8 +31,11 @@ import java.util.List; import java.util.Map; import static net.osmand.IndexConstants.GPX_FILE_EXT; +import static net.osmand.plus.mapmarkers.MapMarkersHelper.CREATION_DATE; import static net.osmand.plus.mapmarkers.MapMarkersHelper.GROUP_NAME; import static net.osmand.plus.mapmarkers.MapMarkersHelper.GROUP_TYPE; +import static net.osmand.plus.mapmarkers.MapMarkersHelper.MARKER_HISTORY; +import static net.osmand.plus.mapmarkers.MapMarkersHelper.VISITED_DATE; public class MarkersSettingsItem extends CollectionSettingsItem { @@ -106,7 +109,7 @@ public class MarkersSettingsItem extends CollectionSettingsItem } for (MapMarkersGroup markersGroup : appliedItems) { for (MapMarker marker : markersGroup.getMarkers()) { - markersHelper.addMapMarker(marker.point, marker.getOriginalPointDescription()); + markersHelper.addMarker(marker); } } } @@ -159,6 +162,13 @@ public class MarkersSettingsItem extends CollectionSettingsItem PointDescription pointDescription = new PointDescription(PointDescription.POINT_TYPE_LOCATION, point.name); MapMarker marker = new MapMarker(latLon, pointDescription, colorIndex, false, 0); + + String historyStr = point.getExtensionsToRead().get(MARKER_HISTORY); + String creationDateStr = point.getExtensionsToRead().get(CREATION_DATE); + String visitedDateStr = point.getExtensionsToRead().get(VISITED_DATE); + marker.creationDate = Algorithms.parseLongSilently(creationDateStr, 0); + marker.visitedDate = Algorithms.parseLongSilently(visitedDateStr, 0); + marker.history = Boolean.parseBoolean(historyStr); marker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE; MapMarkersGroup group = getOrCreateGroup(point); From 47bca02ec4fa83a8e19e3cbf17b5c66317468722 Mon Sep 17 00:00:00 2001 From: Achille Martin Date: Tue, 10 Nov 2020 14:40:50 +0100 Subject: [PATCH 07/47] Added translation using Weblate (Luxembourgish) --- OsmAnd/res/values-lb/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 OsmAnd/res/values-lb/strings.xml diff --git a/OsmAnd/res/values-lb/strings.xml b/OsmAnd/res/values-lb/strings.xml new file mode 100644 index 0000000000..a6b3daec93 --- /dev/null +++ b/OsmAnd/res/values-lb/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 29ee78dddc23b7bf1b520a58d8f6300cd902b135 Mon Sep 17 00:00:00 2001 From: ssantos Date: Sun, 8 Nov 2020 17:06:19 +0000 Subject: [PATCH 08/47] Translated using Weblate (Portuguese) Currently translated at 100.0% (3530 of 3530 strings) --- OsmAnd/res/values-pt/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 79de04a245..4c09d5f26f 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -3950,4 +3950,9 @@ Emergência Viagem Deve adicionar pelo menos dois pontos. + Gerir a assinatura + Há um problema com a sua assinatura. Clique no botão para ir às definições de assinatura do Google Play para corrigir o seu método de pagamento. + A assinatura do OsmAnd Live expirou + A assinatura do OsmAnd Live foi pausada + A assinatura do OsmAnd Live está em espera \ No newline at end of file From 6814ff196bb15908cfaf40fbfc2aeab739a2b668 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 8 Nov 2020 15:58:02 +0000 Subject: [PATCH 09/47] Translated using Weblate (German) Currently translated at 99.9% (3529 of 3530 strings) --- OsmAnd/res/values-de/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index ef1285f3f1..997d1f8b5b 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3950,4 +3950,10 @@ Symbole Lokale Karten Spezial + Sie müssen mindestens zwei Punkte hinzufügen. + Abonnement verwalten + Es gibt ein Problem mit Ihrem Abonnement. Klicken Sie auf die Schaltfläche, um zu den Einstellungen des Google Play Abonnements zu gelangen und Ihre Zahlungsmethode zu überprüfen. + OsmAnd Live Abonnement ist abgelaufen + OsmAnd Live Abonnement wurde ausgesetzt + OsmAnd Live Abonnement liegt auf Eis \ No newline at end of file From 0e737306c5fd2da3993f1526aee4f35940aac92e Mon Sep 17 00:00:00 2001 From: Athoss Date: Sun, 8 Nov 2020 14:53:25 +0000 Subject: [PATCH 10/47] Translated using Weblate (Hungarian) Currently translated at 99.8% (3525 of 3530 strings) --- OsmAnd/res/values-hu/strings.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index d82ea8991b..59663098d2 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -239,7 +239,7 @@ Rátéttérkép kiválasztása A térkép már telepítve van, a beállítások frissülnek. (Csempés) térkép kiválasztása telepítéshez vagy frissítéshez. - Nem lehet végrehajtani a műveletet internetkapcsolat nélkül. + A műveletet nem lehetséges internetkapcsolat nélkül végrehajtani. További telepítése… Raszteres térképek használata ezen nagyítási szint alatt. Legkisebb vektoros nagyítási szint @@ -1228,7 +1228,7 @@ Mented az adatokat GPX fájlként, vagy importálod az útpontokat a „Kedvencek”-be? Megosztás OsmAndból megosztott kedvencek - Nem találhatók letöltések, ellenőrizd az internetkapcsolatot. + Nem találhatók letöltések, ellenőrizze az internetkapcsolatot. Először egy hosszú koppintással adjon meg egy GPX-fájlt. Nyomvonal kijelölése Rendezés távolság szerint @@ -1370,7 +1370,7 @@ Frissítések Letöltés Helyi - A letöltés nem lehetséges, ellenőrizd az internet-kapcsolatot. + A letöltés nem lehetséges, ellenőrizze az internetkapcsolatot. Bezárás Minden fájl naprakész OpenGL megjelenítő használata @@ -2493,9 +2493,9 @@ A csoport összes pontja Nyitva ekkortól: Nyitva eddig: - Bezár ekkor: - Kinyit ekkor: - Kinyit ekkor: + Ekkor zár: + Ekkor nyit: + Ekkor nyit: További műveletek GPX fájl a kijelölt jegyzetek koordinátáival és adataival. GPX fájl az összes jegyzet koordinátáival és adataival. @@ -3939,4 +3939,5 @@ MGRS Az OsmAnd a NATO által is használt MGRS (Military Grid Reference System) koordinátákat alkamazza, amely hasonlít az UTM-formátumhoz. Legalább két pontot kell hozzáadnia. + Előfizetés kezelése \ No newline at end of file From db3780489f12e3cc34fb10f55936067c26059b3f Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Sun, 8 Nov 2020 17:19:16 +0000 Subject: [PATCH 11/47] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3530 of 3530 strings) --- OsmAnd/res/values-uk/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 699889de13..9a18b68263 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -2038,7 +2038,7 @@ Передплата включає щогодинні, щоденні та щотижневі оновлення, а також, необмежену кількість доступних завантажень для всіх мап з усього світу. Отримати Отримати на %1$s - Отримайте необмежені завантаження для мап, а також оновлення мап частіше ніж один раз на місяць: щотижня, щодня або щогодини. + Отримайте для мап необмежені завантаження та оновлення частіше ніж раз на місяць: щотижня, щодня або щогодини. Втулок для необмеженого доступу до мап, їх оновлень та отримання відомостей з Wikipedia. Милі/метри Пропустити завантаження мап @@ -2741,8 +2741,8 @@ \nРозкажіть нам про це. Надіслати пошуковий запит? Світ - Оновлення мап: щомісячне - Оновлення мап: щогодинне + Оновлення мап: щомісячно + Оновлення мап: щогодинно Купівля в застосунку Одноразовий платіж Після покупки він буде завжди доступний для вас. @@ -3661,7 +3661,7 @@ Передплата - OsmAnd Live OsmAnd покупки Довідник умовних позначень мапи. - Оплату буде здійснено з рахунку, прив\'язаного до вашого облікового запису Google Play, під час підтвердженні придбання. + Оплату буде здійснено під час підтвердження придбання з пов\'язаного з вашим обліковим записом Google Play рахунку. \n \nПередплата продовжується автоматично, якщо ви не скасуєте її до дати продовження. З вашого рахунку буде стягуватися плата за період продовження (щомісяця/щотримісяці/щорік) разово в день продовження. \n From bee18f9b9adef24150d805fc7b62b656c1303073 Mon Sep 17 00:00:00 2001 From: WaldiS Date: Mon, 9 Nov 2020 17:35:05 +0000 Subject: [PATCH 12/47] Translated using Weblate (Polish) Currently translated at 99.5% (3515 of 3530 strings) --- OsmAnd/res/values-pl/strings.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 9914cd72e6..49300cabce 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -3837,9 +3837,7 @@ Cała trasa zostanie ponownie wyznaczona przy użyciu wybranego profilu. Tylko następny segment zostanie przeliczony przy użyciu wybranego profilu. Wybierz sposób łączenia punktów, za pomocą linii prostej, lub oblicz trasę między nimi w sposób określony poniżej. - Aby skorzystać z tej opcji, OsmAnd musi przyciągnąć ślad do dróg mapy. -\n -\nW następnym kroku należy wybrać profil nawigacji w celu wykrycia dozwolonych dróg i odległości progowej w celu przybliżenia śledzenia drogi. + Następnie przyciągnij trasę do najbliższej dozwolonej drogi za pomocą jednego z profili nawigacji, aby skorzystać z tej opcji. Zdjęcia z poziomu ulicy Czy na pewno chcesz odrzucić wszystkie zmiany w zaplanowanej trasie, zamykając ją\? W przypadku odwrotnego kierunku @@ -3945,7 +3943,7 @@ Mapy lokalne Luka Udogodnienie - Specjalne + Specjalny Transport Usługi Symbole @@ -3956,4 +3954,8 @@ Zarządzaj subskrypcją Subskrypcja OsmAnd Live wygasła Subskrypcja OsmAnd Live została wstrzymana + Do jazdy skuterem śnieżnym z wyznaczonymi drogami i torami. + Należy dodać co najmniej dwa punkty. + Wystąpił problem z Twoją subskrypcją. Kliknij przycisk, aby przejść do ustawień subskrypcji Google Play i naprawić metodę płatności. + Subskrypcja OsmAnd Live jest wstrzymana \ No newline at end of file From 93e8b7939efda6237a7d88262a7d4fb65cf641d8 Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Sun, 8 Nov 2020 11:02:06 +0000 Subject: [PATCH 13/47] Translated using Weblate (Arabic) Currently translated at 100.0% (3530 of 3530 strings) --- OsmAnd/res/values-ar/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index b0694fc934..68aee33373 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3117,7 +3117,7 @@ يستخدم أوسماند تنسيق UTM وهو مشابه ولكن غير مطابق لتنسيق UTM الناتو. مثال معيار الإحداثيات - فتح رمز الموقع + رمز الموقع المفتوح (OLC) سيتم تطبيق التنسيق المحدد في كل أنحاء التطبيق. يتم تحديد هذا الاعداد بشكل افتراضي للأوضاع: %s تغيير الإعدادات @@ -3658,15 +3658,15 @@ مشتريات أوسماند دليل رموز الخريطة. أوضاع الملاحة - • خرائط جديدة للمنحدرات غير المتصلة بالإنترنت + • خرائط جديدة للتضاريس توضح المنحدرات من دون الحاجة للاتصال بالإنترنت \n \n • التخصيص الكامل للمفضلات ونقاط الطرق GPX - الألوان المخصصة والأيقونات والأشكال \n \n • تخصيص ترتيب العناصر في قائمة السياق ، تكوين الخريطة ، درج \n -\n • ويكيبيديا كطبقة منفصلة في تكوين الخريطة ، حدد اللغات المطلوبة فقط +\n • عرض ويكيبيديا كطبقة منفصلة في تكوين الخريطة ، حدد اللغات المطلوبة فقط \n -\n • إنشاء مرشح / خرائط POI الخاصة بك مع مرونة تامة +\n • إنشاء مرشح / خرائط للمعالم الخاصة بك مع مرونة تامة \n \n • تمت إضافة خيارات لاستعادة إعدادات الأوضاع المخصصة \n @@ -3674,7 +3674,7 @@ \n \n • إصلاح أحجام واجهة المستخدم على الأجهزة اللوحية \n -\n • إصلاح الخلل مع RTL +\n • إصلاح الخلل مع اللغات التي تكتب من اليمين \n \n إستئناف @@ -3683,7 +3683,7 @@ إظهار وسائل النقل العام إظهار/إخفاء وسائل النقل العام زر لإظهار أو إخفاء وسائل النقل العام على الخريطة. - إنشاء /تحرير POI + إنشاء /تحرير موضع مكان مكان الموقف إضافة / تحرير المفضلة استعادة ترتيب العناصر الافتراضية From 130414afa942ba7625839e28ad4dde579de73b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Kotr=C4=8D?= Date: Mon, 9 Nov 2020 14:53:42 +0000 Subject: [PATCH 14/47] Translated using Weblate (Czech) Currently translated at 81.9% (2892 of 3530 strings) --- OsmAnd/res/values-cs/strings.xml | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 5c5a1a7d25..28f2745e80 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -3654,4 +3654,78 @@ Zobrazená oblast: %1$s x %2$s Nechat obrazovku zapnutou Nechat obrazovku vypnutou Dále, pro použití této možnosti připojte vaši stopu k nejbližší povolené cestě s některým z vašich navigačních profilů. + Použít systémový časový limit obrazovky + \"Obnovit do základního nastavení\" nastaví výchozí pořadí. + Kopírovat souřadnice + • Profily: nyní můžete změnit pořadí, nastavit ikonu pro mapu, změnit všechna nastavení základních profilů a resetovat je zpět do výchozího stavu +\n +\n • V navigaci přibylo číslo výjezdu +\n +\n • Přepracovaná nastavení modulů +\n +\n • Přepracovaná obrazovka nastavení pro rychlý přístup ke všem profilům +\n +\n • Přidaná možnost kopírovat nastavení z jiného profilu +\n +\n • Přidaná možnost skrýt nebo změnit pořadí kategorií bodů zájmu při hledání +\n +\n • Zpřesněné umístění ikon bodů zájmu na mapě +\n +\n • Přidané údaje o východu a západu slunce v nastavení mapy +\n +\n • Přidané ikony Domov a Práce na mapě +\n +\n • Přidaná podpora pro víceřádkové popisy v nastavení +\n +\n • Přidaná správná transliterace v mapě Japonska +\n +\n • Přidaná mapa Antarktidy +\n +\n + Vymazat zaznamenaná data + Přímo k bodu + Nastavte počet položek v \"Úvodním panelu\", \"Nastavení mapy\" a \"Kontextovém menu\". +\n +\nVypněte nepoužívané moduly, abyste skryli jejich ovládací prvky. %1$s. + Položky v úvodním panelu a kontextovém menu + Nastavení uživatelského rozhraní + Úvodní panel + Skrýt veřejnou dopravu + Zobrazit veřejnou dopravu + Zobrazit/skrýt veřejnou dopravu + Tlačítko pro zobrazení nebo skrytí veřejné dopravy na mapě. + Vytvořit / upravit bod zájmu + Parkovací místa + Přidat / upravit oblíbený bod + Obnovit výchozí pořadí položek + Zpět k úpravám + Tlačítko akce přepne mezi zvolenými profily. + Přidat profil + Změnit profil aplikace + Nebyly nalezeny žádné vhodné profily. + Přehledová mapa světa (detailní) + Nepodporovaný typ + Zadejte šířku svého vozidla, na trase mohou být omezení pro široká vozidla. + Zadejte výšku svého vozidla, na trase mohou být omezení pro vysoká vozidla. + Zadejte hmotnost svého vozidla, na trase mohou být omezení pro těžká vozidla. + Zadejte délku svého vozidla, na trase mohou být omezení pro dlouhá vozidla. + GPX nemá správný tvar pro OsmAnd, kontaktujte prosím podporu pro další přezkoumání. + Vždy + Ovládání obrazovky + Vypne obrazovku po uplynutí systémového časového limitu. + Použít systémový časový limit obrazovky + Zvolte možnosti probuzení obrazovky (při zamykání zařízení se ujistěte, že je OsmAnd na popředí): + Každý navigační pokyn zapne obrazovku. + Navigační pokyny + Vypnuto. Vyžaduje \"Nechat obrazovku zapnutou\" pod \"Časový limit obrazovky po probuzení\". + Stisknutím tlačítka napájení zapnete obrazovku s aplikací OsmAnd na zamčené obrazovce. + Tlačítko napájení + Senzor přiblížení + Zvolte časový limit vypnutí obrazovky po probuzení (\"%1$s\" znamená bez časového limitu.) + Musíte přidat aspoň dva body. + Spravovat předplatné + S vaším předplatným je problém. Klikněte na tlačítko pro přechod do nastavení předplatného v Google Play a opravte způsob platby. + Předplatné OsmAnd Live skončilo + Předplatné OsmAnd Live je pozastaveno + Předplatné OsmAnd Live je zablokované \ No newline at end of file From 0f57503911fa760216d59982a9ba86c8b826970d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Sun, 8 Nov 2020 23:50:41 +0000 Subject: [PATCH 15/47] Translated using Weblate (Galician) Currently translated at 100.0% (3530 of 3530 strings) --- OsmAnd/res/values-gl/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index e422eecf62..2bff3c9301 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -3971,4 +3971,10 @@ Lon %2$s Deporte Emerxencia Viaxe + Tes que engadir polo menos dous puntos. + Xestionar subscrición + Hai un problema coa túa subscrición. Preme no botón para ir ós axustes de subscrición da Google Play e corrixir o teu método de pagamento. + A subscrición do OsmAnd Live expirou + A subscrición do OsmAnd Live foi detida + A subscrición do OsmAnd Live está en espera \ No newline at end of file From 6310e3c7451bcd72d5cd9417e69833f5c828e39d Mon Sep 17 00:00:00 2001 From: WaldiS Date: Mon, 9 Nov 2020 17:37:22 +0000 Subject: [PATCH 16/47] Translated using Weblate (Polish) Currently translated at 99.7% (3822 of 3830 strings) --- OsmAnd/res/values-pl/phrases.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-pl/phrases.xml b/OsmAnd/res/values-pl/phrases.xml index 20c67e111f..d048d53fdb 100644 --- a/OsmAnd/res/values-pl/phrases.xml +++ b/OsmAnd/res/values-pl/phrases.xml @@ -3562,10 +3562,10 @@ Zagrożenie Radioterapia Usunięty obiekt - н/к - н/к* + n/c + n/c* 1A - 1А* + 1A* 1B 1B* 2A @@ -3817,7 +3817,7 @@ Poziom wody: poniżej średniego poziomu wody Poziom wody: obmywający falami Poziom wody: pokrywający - Dostęp do Internetu dla klientów + Dostęp do Internetu: klienci Ssanie Pod ciśnieniem Woda podziemna From 55562d3072d360eb29595ccce4861485ce9bb074 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Sun, 8 Nov 2020 18:40:09 +0000 Subject: [PATCH 17/47] Translated using Weblate (Sardinian) Currently translated at 99.6% (3817 of 3830 strings) --- OsmAnd/res/values-sc/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-sc/phrases.xml b/OsmAnd/res/values-sc/phrases.xml index 2c62c095ff..7e589f3ab7 100644 --- a/OsmAnd/res/values-sc/phrases.xml +++ b/OsmAnd/res/values-sc/phrases.xml @@ -3845,4 +3845,5 @@ Cabannas Cobertura Puntu GPX + Torre ràdar \ No newline at end of file From 5d8d84a3d87f1bf142e51692043d66898ca924a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Sun, 8 Nov 2020 23:50:58 +0000 Subject: [PATCH 18/47] Translated using Weblate (Galician) Currently translated at 100.0% (3830 of 3830 strings) --- OsmAnd/res/values-gl/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-gl/phrases.xml b/OsmAnd/res/values-gl/phrases.xml index b377d6ec35..fece900054 100644 --- a/OsmAnd/res/values-gl/phrases.xml +++ b/OsmAnd/res/values-gl/phrases.xml @@ -3842,4 +3842,5 @@ Pendellos Terrazo Punto GPX + Torre de radar \ No newline at end of file From f737df035a4a0c27866f864a2c1f49c03de013c8 Mon Sep 17 00:00:00 2001 From: Franco Date: Sun, 8 Nov 2020 17:29:35 +0000 Subject: [PATCH 19/47] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3529 of 3530 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index f052206422..6358e33bbe 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3952,4 +3952,9 @@ MGRS OsmAnd usa MGRS, similar al formato UTM de la OTAN. Debes añadir al menos dos puntos. + Gestionar suscripción + Hay un problema con la suscripción. Pulsa el botón para ir a los ajustes de la suscripción de Google Play y corregir el método de pago. + La suscripción a OsmAnd Live ha caducado + La suscripción a OsmAnd Live se ha pausado + La suscripción a OsmAnd Live está en espera \ No newline at end of file From 62af03f85c561054a287a9792e13f725d2d8c54e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Mon, 9 Nov 2020 16:52:10 +0000 Subject: [PATCH 20/47] Translated using Weblate (Estonian) Currently translated at 99.2% (3505 of 3530 strings) --- OsmAnd/res/values-et/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index f1fbad6379..8e43c4142f 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -3798,4 +3798,10 @@ OsmAnd kasutab MGRS-vormingut, mis on sarnane NATO UTM-vormingule. MGRS MGRS + Graafiku joonistamiseks pead lisama vähemalt kaks punkti. + OsmAnd Live tellimus on ootel + OsmAnd Live tellimus on peatatud + OsmAnd Live tellimus on aegunud + Sinu tellimusega on üks pisikene segadus. Selleks et Google Play seadistuses makseviisi parandada, palun klõpsi seda nuppu. + Halda tellimusi \ No newline at end of file From 0db0a82b2e2e795e6a7ec02f283e8ef719dc2710 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Sun, 8 Nov 2020 12:45:52 +0000 Subject: [PATCH 21/47] Translated using Weblate (Esperanto) Currently translated at 99.9% (3529 of 3530 strings) --- OsmAnd/res/values-eo/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 93ff65c8f2..f6594182cd 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3946,4 +3946,10 @@ MGRS MGRS OsmAnd uzas MGRS, kiu estas simila al la formo UTM NATO. + Aldonu almenaŭ du punktojn. + Administri abonon + Okazis problemo pri via abono. Premu la butonon por iri al agordoj pri abonoj ĉe Google Play por korekti vian pagmanieron. + Abono OsmAnd Live senvalidiĝis + Abono OsmAnd Live estas paŭziigita + Abono OsmAnd Live estas ĉesigita \ No newline at end of file From 64ac78366fbe4004d4f081efffa5a59457953f91 Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Tue, 10 Nov 2020 10:03:59 +0000 Subject: [PATCH 22/47] Translated using Weblate (Arabic) Currently translated at 43.4% (1664 of 3830 strings) --- OsmAnd/res/values-ar/phrases.xml | 367 ++++++++++++++++--------------- 1 file changed, 188 insertions(+), 179 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index ea7008244a..3a9d249731 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -3,12 +3,12 @@ متجر نقل شخصي نقل عام - مركز صحّيّ + الرعاية الصحية مكتب نادي مطعم و مقهى ماليّة - ويكيبيديا + ويكيبديا متجر شوكلاته متجر قهوة مجمّع @@ -18,32 +18,32 @@ متجر هواتف نقّالة متجر درّاجات ناريّة طوارئ - النقل - محطة بنزين + وسائل النقل + محطة وقود نقل جوي نقل بحري من صنع الإنسان - الإمداد بالمياه + إمدادات المياه الطاقة الاتصالات - استخدام الأراضي - التعليم - الإدارية - الرياضة + الأراضي المستخدمة + تعليم + إداري + رياضة السياحة معالم سياحية - الوصول إلى شبكة الإنترنت + الوصول إلى الإنترنت المواد الغذائية الخدمات الحرف اليدوية - الطبيعية - العسكرية - المحددة من قبل المستخدم + طبيعة + عسكري + محددة من قبل المستخدم موقع الكتابات القديمة - مخبزة + مخبز محل الخمور متجر الجبن - متجر + بقالة - متجر صغير سوبر ماركت متجر المعكرونة متجر تحف @@ -58,25 +58,25 @@ الحد الأدنى للسن تربية الأحياء المائية محطة الضخ - عائق طريق - متجر وسوبرماركت - دراجات نقل - مخزن المزرعة + عوائق الطريق + متجر صغير وسووبر ماركت + نقل الدراجات + متجر المزرعة أماكن الإقامة أوقات الفراغ تربية الأحياء المائية: بلح البحر تربية الأحياء المائية: الأسماك تربية الأحياء المائية: الجمبري - مسارات المشي + مسارات المشي الخلوي متجر شاي متجر الحلويات آلة بيع متجر حقائب - متجر أفرشة + متجر مفارش متجر سجاد صيدلية ملابس أطفال - متجر الأحذية + متجر أحذية متجر شموع متجر كمبيوتر متجر الأقمشة @@ -91,26 +91,26 @@ دكان الهدايا متجر عام متجر اغراض الحدائق - متجر الغاز المسال + متجر الغاز السائل متجر مجوهرات - متجر ألأعشاب + محل عطارة معدات الصيد متجر الديكور الداخلي متجر الموسيقى معدات الموسيقى أغدية عضوية - متجر أغراض الكلاب - متجر الدهان - متجر ألألعاب + متجر الحيوانات الأليفة + متجر الدهانات + متجر ألعاب موقف سيارات موقف دراجات نارية مدخل موقف سيارات موقف دراجات هوائية تذاكر موقف السيارات تذاكر موقف سيارات و تذاكر للنقل العام - محل للمشروبات + متجر مرطبات صيدلية - مدرسة تعليم السياقة + مدرسة تعليم القيادة مدرسة نوع المبنى : مسجد مستشفى @@ -118,10 +118,10 @@ نوع العمل الفني : نافورة نجار سباك - تاجر سيارات - تصليح السيارات + معرض سيارات + ورشة تصليح السيارات خراطيش الطابعة - بطاريات السيارات + بطاريات سيارات سيارات موقع خاص للقوافل الإسم الدولي @@ -132,9 +132,9 @@ الإسم البديل الإسم الرسمي قرية - مدينة + مدينة صغيرة موقع إنترنت - هاتف النجدة + هاتف الطوارئ هواتف نقالة الهاتف قسائم تعبئة الهاتف @@ -142,23 +142,23 @@ طفاية حريق خرطوم إطفاء الحريق متجر الألعاب النارية - مطب + مطب خفيف مقهى مقهى إنترنت فندق جامعة قطار - النقل الجوي - نقاط شبكة التنزه/ركوب الدراجات - قوانين المرور جارية المفعول + النقل المعلق بالكيابل + مجموعة نقاط المشي الخلوي \"الهايكنق\"/ركوب الدراجات + كمائن و مراصد المرور بنية المواصلات - صرف القمامة + مكب النفايات بحري - أطعمة لذيذة - بقالة خضراء + محل أطعمة مستوردة + متجر خضروات متجر مأكولات بحرية - متجر الحلويات - ردهة مثلجات + متجر حلويات + ركن المثلجات متجر ألبان متجر نبيذ متجر كتب @@ -166,7 +166,7 @@ متجرفنون سلع أطفال متجر أزياء - متجر جمعيات خيرية + متجر خيري متجر ملابس محل نسخ متجر ستائر @@ -175,11 +175,11 @@ متجر لوازم الطيران الحر مركز الحديقة محل زجاج - متجر لواحق الحاسوب + متجر ملحقات الحاسوب محطة القطارات - أثاث مطبخ + أثاث المطبخ متجر جلود - إمدادات طبية + مستلزمات طبية بائع جرائد طبيب العيون متجر صور @@ -187,22 +187,22 @@ متجر بضائع الغوص سلع رياضية متجر هاي فاي - متجر في الهواء الطلق + متجر أدوات التنزه والرحلات طول خزان ماء قنصلية شرفية متجر تقنيات الراديو - متجر موائد + متجر أدوات المائدة بيع التذاكر متجر تبغ - محطة تجارية - مخزن إطارات + مبسط تجاري + متجر الاطارات متجر مكانس كهربائية متجر متنوع متجر فيديوتاك متجر متعدد الأقسام متجر إلكترونيات - متجر طاقة + متجر أدوات طاقة قطع غيار السيارات ألعاب نماذج مقياس @@ -214,13 +214,13 @@ صنبور مياه الإطفاء سلة حصى محطة إسعاف - منفذ طوارئ - فورد + نقطة وصول الطوارئ + مجرى الماء على الطريق فحص المركبات غسيل السيارات محطة بنزين: بترول، ديزل، غاز ديزل - ديزل جي تي أل + ديزل GTL ديزل حيوي أوكتان 80 أوكتان 91 @@ -241,11 +241,11 @@ محطة شحن هواء مضغوط كراجات - موقف النقل العمومي + موقف النقل العام موقف حافلات موقف حافلات - مكان توقف وسائل النقل العمومي - محطة النقل العمومي + مكان توقف وسائل النقل العام + محطة النقل العام محطة حافلات منصة سكك حديدية محطة سكك حديدية @@ -260,7 +260,7 @@ المنارة تأجير دراجات جدار مدينة - مدينة + مدينة كبيرة باب مدينة محكمة مطعم @@ -269,10 +269,10 @@ مبنى حلاق مرحاض; حمام - مطب + مطب قوي ممر الراجلين مكتب بريد - خزان مياه عمودي + برج مياه جسر حوض سباحة مولد طاقة @@ -316,8 +316,8 @@ نفق سكك حديدية وادي خياط - مُحَوِّل الطريق السيار - موقف ترامواي + تقاطع الطريق السريع + توقف الترام كتب أحذية ألومنيوم @@ -327,7 +327,7 @@ مصابيح منخفضة الطاقة أنابيب ضوء النيون معدن - عناصر كهربائية + أغراض الكترونية سلع بيضاء زيت الطهي زيت المحرك @@ -342,14 +342,14 @@ زيت مستعمل زجاجات صفائح معدنية - رقاقة معدنية + ورق قصدير مكتب التوظيف مكتب البحوث مكتب تكنولوجيا المعلومات مكتب جرائد مكتب مهندس معماري وكالة إعلانات - مؤسسة تربوية + مؤسسة تعليمية ستوديو مكتب شؤون دينية مكتب منظمة @@ -368,7 +368,7 @@ نوع المصعد لـ: كلب، قط نوع المصعد لـ: حصان طائرات تاريخية - متجرعسل + متجر عسل بالمصعد بدون مصعد مكتب التخييم @@ -426,107 +426,107 @@ مصدر المياه طريقة الدفع الصوت - نوع + النوع خدمة خدمة ذاتية - نوع - محطة مترو الإنفاق - نوع + النوع + محطة مترو + النوع تدفئة مضخة - نوع - نوع - نوع + النوع + النوع + النوع التخصص - نوع - الديانة - الطائفة - نوع - مخيم الكشافة - نوع + النوع + الدين + المذهب + النوع + مخيم كشافة + النوع صعوبة الطريق - رسوم + الرسوم التدخين - الوجبات الجاهزة + الطلب الخارجي كوكتيلات - نوع + النوع النفايات المقبولة - نوع + النوع موسمي خصائص المياه التخصص الصحي نوع التدليك - الخيام + خيام غسالة - البيوت المتنقلة - الإمداد بالطاقة + كارفان (مقطورة متنقلة) + مصدر الطاقة النظام الطبي نوع الوقود (افيا) إضافي نوع البيع - نوع + النوع نوع - موقع - رصيف ذوي الاحتياجات - بدون فرش + الموقع + مسار الرصيف البارز (للمكفوفين) + فرش آلي مغطى نقل البضائع - دراجات النقل - تعيين + دراجات التنقل + الصفة العاصمة - استغناء + استلام خاصية تصنيف النجوم المحتويات - إضافي + اضافية الريف نوع - جلوس في الهواء الطلق - التسليم + جلوس في الخارج + التوصيل مصنع الجعة مصغر خدمة موقد سطح العري - النظام الغذائي + حمية صحن نوع الدفع (نقل) - نوع + النوع نوع الوقود قيادة - سق عبر + مسار طلبات السيارة الفئة المستهدفة هواء مضغوط مكنسة كهربائية مميزة - محل وراقة + قرطاسية وأدوات مكتبية مستحضرات التجميل متجر الساعات متجر التوابل ممر جبلي مراقبة الحدود - وسادة سرعة + مطبات مركبات صغيرة غاز البترول المسال محطة وقود الطائرات محطة بنزين للقوارب - موقف ترامواي - رادار + موقف الترام + رادار سرعة تقاطع - مساحة للإستراحة - أشغال المياه + منطقة استراحة + أعمال المياه حوض سفن - محطة مياه الصرف الصحي + محطة الصرف الصحي سد طاحونة مائية محطة فرعية محول - محطة للطاقة + محطة توليد الطاقة صندوق البريد هاتف برج التبريد - إعادة التدوير - مركز لإعادة التدوير + إعادة تدوير + مركز إعادة التدوير حاوية زجاج ورق @@ -542,30 +542,30 @@ التعبئة والتغليف البلاستيكي جرائد كرتون - الورق المقوى - المجلات + ورق مقوى + مجلات تغليف ورقي أجهزة صغيرة - الخشب + خشب تتراباك - الطلاء - الأدوية - السماد العضوي + طلاء + أدوية + سماد عضوي أشجار عيد الميلاد - المصابيح الكهربائية - ألواح رقائقيه - النفايات الحيوانية + مصابيح كهربائية + ألواح خشبية - بلاكاش + نفايات حيوانية حفاضات الأطفال دراجات هوائية - مطمرة نفايات - النفايات النووية + مكب نفايات + نفايات نووية سلة المهملات مساحة تجارية - كروم + حقل عنب مزرعة - المرج + مرعى أو مرج قناة - المراقبة + مراقبة مرصد فلكي صاري @@ -586,21 +586,21 @@ الجمارك البلد نعم - قرية صغيرة + قرية صغيرة - هجرة بيت معزول ضاحية حي مزرعة الإسعافات الأولية - الطب البيطري + بيطري مصحة - الطب البديل + طب بديل بنك دم مركز طبي قابلة - أخصائي العلاج الطبيعي + أخصائي علاج طبيعي طبيب الأرجل - الطبيب النفساني + معالج نفسي إعادة التأهيل مرفق طبي طب الأطفال @@ -659,34 +659,34 @@ سفينة تاريخية نصب تذكاري حديقة الحيوانات - زيارة منزلية + الزيارة المنزلية أدوات مساعدة للسمع لوازم السفن والقوارب متجر ستائر متجر الدرجات الرباعية - سوق + سوق مباسط متجر لوازم المسبح متجر لوازم الفنون والحرف لوازم دينية - رفش اطفاء النار + أداة/مكنسة اطفاء النار معبر حجري بوابة بوابة برافعة كشك طريق مدفوع - مطب طريق تحذيري - جدول السرعة + مطب تحذيري + مطب مرتفع وطويل اشارة توقف ضوئية إطارات - نقل وقود الديزل + ديزل HGV استوديو صور قاطرة متجر السجائر الإلكترونية - متجر البضائع الجافة - سلسلة كبح السرعة - مكان وقوف المارة + متجر الأغذية المجففة + مهدئ السرعة + جزيرة مرورية غاز طبيعي مضغوط زيت نباتي - منحدر مركبة + جسر صيانة سيارات موقف حافلات حاجز سكة حديدية مركبة كهربائية @@ -807,10 +807,10 @@ سوق عيد الميلاد متجر عيد الميلاد شجرة عيد الميلاد - هياكل الإستعجالات + البنية التحتية للطوارئ متجر الأدوات المنزلية - احتياطي مياه الحرائق - ممهل + احتياطي مياه إطفاء الحرائق + منعطف صناعي محطة المطار بوابة الصعود نادي الفنون @@ -823,7 +823,7 @@ نادي الشطرنج نادي قدامى المحاربين نادي الصيد - أخصائي في معالجة الكلام + معالج النطق نحات إسكافي مبلط @@ -1393,11 +1393,11 @@ التجارة العادلة : لا يوجد منتجات التجارة العادلة فقط منطقة محمية - مقهى + كافتيريا الخدمات نوع الدراجة النارية موحد - نوع + النوع محطة Aerialway رافعة بالكرسي رافعة T @@ -1407,48 +1407,48 @@ رافعة مختلطة رافعة سحب رافعة سحب - بئر + بئر ماء صنبور - قفل البوابة + حوض نقل القوارب سدّ غاطس - حائل الأمواج + كاسر الأمواج مِرطَم مَوج كبينة توزيع الأسلاك عمود كهربائي برج جرس - مبدلة الخدمات الهاتفية + مقسم الهاتف فلين الستايروفوم بوليستر لوح جصي - ثلاجة ومجمد + ثلاجة وفريزر أثاث - صرف القمامة + مكب النفايات منطقة سكك حديدية - بيع أراضي بالتجزئة + منطقة محلات بيع بالتجزئة مقلع بستان - حوض + أرض حوضية رصيف بحري رافعة بناء الاتجاه: الكل الاتجاه: مخرج - مسار زحلقة - الحيوانات مسموح بها + مسار الزحلقة + الحيوانات المسموح بها الغرض الوجهة: مدخل - قوارب مستأجرة + قوارب مأجرة بئر نفط شبكات الكريكيت كلية مرفق اجتماعي - ربع + ربع (مجموع مربعات سكنية) موضع دار تمريض - اختصاصي السمع - أخصائي العلاج الوظيفي - طبيب العيون + أخصائي سمع + أخصائي علاج مهني + طبيب عيون ناشر ملعب غولف حلبة تزلج @@ -1456,7 +1456,7 @@ مضمار سباق الرماية دائرة دوران - نقطة دوران في مجرى مائي + نقطة دوران في المياة محمية أرض صناعية سابقة حقل أخضر @@ -1482,7 +1482,7 @@ ميدان معركة نوع إمدادات المياه تنقية المياه - نقطة دراسة استقصائية + نقطة الاستطلاع رسوم الموقف نوع الخريطة: شارع محطة شحن @@ -1491,20 +1491,20 @@ شقة مركز الدفع تحويل أموال - حالة التشغيل + الحالة التشغيلية الوصول إلى مكان المياه أسلوب التسلق - موصل + مقبس كهرباء مخرج CHAdeMO مخرج نوع 2 - خدمة سيارات + خدمة السيارات النوع الجليدي نوع نقطة التفتيش الشراء بالجملة النوع كتب - له دلالة - المخصصات + إشارة + أراضي مخصصات شاكتيزم مكان لمراقبة الطيور طريق تجاوز @@ -1624,15 +1624,15 @@ مصدر الطاقة: الكتلة الحيوية موقع Reddit اصطف واركب - فئة الصعوبة + تصنيف الصعوبة تسلق الصخور نعم منفذ للحافلة مدخل دراجات نارية - مدخل معاقين - سحب نقدي - عربة منزل متنقل - مدخل منازل متنقلة + مدخل المعاقين + السحب النقدي + مدخل المنزل المتنقل + مدخل الكارفان مدخل دراجة جليد مخرج Schuko مخرج CEE أزرق @@ -1644,10 +1644,10 @@ التوجيه مخزون الثلج كرة - المخصصات + أراضي مخصصات مكتب السجل المدني - مستودع بنكر - متشدد + غرفة تحميل + صلب برج الرفع الجوي الوقود: الفحم الوقود: فحم @@ -1655,16 +1655,25 @@ سائل عادم الديزل وقود الطائرات النفاثة A-1 أوتوجاز - 100 لتر وقود + وقود 100LL وقود 91UL - سهم + السهم الاهتزاز الضغط فيديو - رسالة قصيرة + رسالة SMS الحالة النوع الهواء الطلق النوع - دخول مركبات البضائع الخفيفة + مدخل مركبات البضائع الخفيفة + الأجهزة الكهربائية الصغيرة + طريق إخلاء + لوحة المغادرة + إعادة تعبئة مياه الشرب + مدخل HGV + مدخل الدراجة النارية + مدخل الدراجة + مدخل المقطورة + نوع 2 مخرج combo \ No newline at end of file From 2c78f4f0bfc35ffdc06d316c2b6f20a8f62b04a2 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Sun, 8 Nov 2020 02:17:31 +0000 Subject: [PATCH 23/47] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3530 of 3530 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index cfb72a0443..b45f168453 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3943,4 +3943,9 @@ MGRS OsmAnd 使用 MGRS,其類似於 UTM NATO 格式。 您必須新增至少兩個點。 + 管理訂閱 + 您的訂閱似乎有點問題。點擊按鈕以跳到 Google Play 訂閱設定以修復您的付款方式。 + OsmAnd Live 訂閱已過期 + OsmAnd Live 訂閱已暫停 + OsmAnd Live 訂閱已暫停 \ No newline at end of file From 1a2eb6626373ea86e566932b9a2c6bc5ed32d60e Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Tue, 10 Nov 2020 18:25:05 +0200 Subject: [PATCH 24/47] test --- OsmAnd/res/layout/send_gpx_fragment.xml | 198 ++++++++++++++++++ OsmAnd/res/values/strings.xml | 10 +- .../LoginBottomSheetFragment.java | 2 +- .../osmand/plus/osmedit/OsmEditingPlugin.java | 56 ++--- .../dialogs/SendGpxBottomSheetFragment.java | 121 +++++++++++ 5 files changed, 345 insertions(+), 42 deletions(-) create mode 100644 OsmAnd/res/layout/send_gpx_fragment.xml create mode 100644 OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java diff --git a/OsmAnd/res/layout/send_gpx_fragment.xml b/OsmAnd/res/layout/send_gpx_fragment.xml new file mode 100644 index 0000000000..234ccfb9dc --- /dev/null +++ b/OsmAnd/res/layout/send_gpx_fragment.xml @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index dc262a8b1b..8519838557 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,12 @@ Thx - Hardy --> + Trackable means that the trace will not show up in any public listings but trackpoints from it will still be available through the public GPS API with timestamps. Other users will only be able to download processed trackpoints from your trace which can\'t be associated with you directly. + Identifiable means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings, i.e. other users will be able to download the raw trace and associate it with your username. Data served via the trackpoints API will reference your original trace page. Timestamps of the trace points are available through the public GPS API. + Private means that the trace will not show up in any public listings, but trackpoints from it will still be available through the public GPS API without timestamps but will not be chronologically ordered. + Public means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings. Data served via the API does not reference your trace page. Timestamps of the trace points are not available through the public GPS API, and the points are not chronologically ordered. However, other users are still able to download the raw trace from the public trace list and any timestamps contained within. + Enter tags separated by comma. + Send GPX file to OpenStreetMap OsmAnd Live subscription is on hold OsmAnd Live subscription has been paused OsmAnd Live subscription has been expired @@ -22,11 +28,11 @@ Use login and password You need to login to upload new or modified changes. \n\nYou can log in using the safe OAuth method or use your login and password. You can view all your unloaded edits or OSM bugs in %1$s. Uploaded points don’t show in OsmAnd. - Sing in with OpenStreetMap + Sign in with OpenStreetMap Login to OpenStreetMap.org Login to OpenStreetMap These plugin setting are global, and apply to all profiles - You must add at least two points. + You need to add at least two points Travel Emergency Sport diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java index 44547815ce..5eed849b92 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/LoginBottomSheetFragment.java @@ -67,7 +67,7 @@ public class LoginBottomSheetFragment extends MenuBottomSheetDialogFragment { @Override protected int getThirdBottomButtonTextId() { - return R.string.sing_in_with_open_street_map; + return R.string.sign_in_with_open_street_map; } @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 71da65bf20..39ebaa4052 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -6,18 +6,14 @@ import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.graphics.Typeface; import android.graphics.drawable.Drawable; -import android.os.AsyncTask; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.StyleSpan; -import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.Spinner; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; +import androidx.annotation.StringRes; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; @@ -34,7 +30,6 @@ import net.osmand.plus.ContextMenuItem; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; -import net.osmand.plus.activities.EnumAdapter; import net.osmand.plus.activities.EnumAdapter.IEnumWithResource; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.TabActivity; @@ -45,6 +40,7 @@ import net.osmand.plus.myplaces.AvailableGPXFragment; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.osmedit.OsmPoint.Action; +import net.osmand.plus.osmedit.dialogs.SendGpxBottomSheetFragment; import net.osmand.plus.quickaction.QuickActionType; import net.osmand.plus.settings.backend.OsmandPreference; import net.osmand.plus.settings.backend.OsmandSettings; @@ -438,14 +434,16 @@ public class OsmEditingPlugin extends OsmandPlugin { } public enum UploadVisibility implements IEnumWithResource { - Public(R.string.gpxup_public), - Identifiable(R.string.gpxup_identifiable), - Trackable(R.string.gpxup_trackable), - Private(R.string.gpxup_private); + Public(R.string.gpxup_public, R.string.public_visibility), + Identifiable(R.string.gpxup_identifiable, R.string.identifiable_visibility), + Trackable(R.string.gpxup_trackable, R.string.trackable_visibility), + Private(R.string.gpxup_private, R.string.private_visibility); private final int resourceId; + private final int descriptionId; - UploadVisibility(int resourceId) { + UploadVisibility(int resourceId,int descriptionId ) { this.resourceId = resourceId; + this.descriptionId = descriptionId; } public String asURLparam() { @@ -456,6 +454,11 @@ public class OsmEditingPlugin extends OsmandPlugin { public int stringResource() { return resourceId; } + + @StringRes + public int getDescriptionId() { + return descriptionId; + } } public boolean sendGPXFiles(final FragmentActivity activity, AvailableGPXFragment fragment, final GpxInfo... info) { @@ -465,35 +468,10 @@ public class OsmEditingPlugin extends OsmandPlugin { if ((Algorithms.isEmpty(name) || Algorithms.isEmpty(pwd)) && Algorithms.isEmpty(authToken)) { LoginBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment()); return false; + } else { + SendGpxBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment()); + return true; } - AlertDialog.Builder builder = new AlertDialog.Builder(activity); - LayoutInflater inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - final View view = inflater.inflate(R.layout.send_gpx_osm, null); - final EditText descr = (EditText) view.findViewById(R.id.memory_size); - if (info.length > 0 && info[0].getFileName() != null) { - int dt = info[0].getFileName().indexOf('.'); - descr.setText(info[0].getFileName().substring(0, dt)); - } - final EditText tags = (EditText) view.findViewById(R.id.TagsText); - final Spinner visibility = ((Spinner) view.findViewById(R.id.Visibility)); - EnumAdapter adapter = new EnumAdapter<>(activity, android.R.layout.simple_spinner_item, UploadVisibility.values()); - adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - visibility.setAdapter(adapter); - visibility.setSelection(0); - - builder.setView(view); - builder.setNegativeButton(R.string.shared_string_no, null); - builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - new UploadGPXFilesTask(activity, descr.getText().toString(), tags.getText().toString(), - (UploadVisibility) visibility.getItemAtPosition(visibility.getSelectedItemPosition()) - ).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info); - } - }); - builder.show(); - return true; } @Override diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java new file mode 100644 index 0000000000..0ad89d1504 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -0,0 +1,121 @@ +package net.osmand.plus.osmedit.dialogs; + +import android.os.AsyncTask; +import android.os.Bundle; +import android.view.ContextThemeWrapper; +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.material.textfield.TextInputLayout; + +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; +import net.osmand.plus.UiUtilities; +import net.osmand.plus.base.MenuBottomSheetDialogFragment; +import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; +import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; +import net.osmand.plus.myplaces.AvailableGPXFragment; +import net.osmand.plus.osmedit.OsmEditingPlugin; +import net.osmand.plus.osmedit.UploadGPXFilesTask; +import net.osmand.plus.settings.backend.OsmandSettings; +import net.osmand.util.Algorithms; + +import java.util.ArrayList; +import java.util.List; + +public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { + + public static final String TAG = "SendGpxBottomSheetFragment"; + + protected OsmandSettings settings; + + private OsmEditingPlugin.UploadVisibility uploadVisibility; + private List info; + private String selectedVisibilityType; + + protected OsmandApplication getMyApplication() { + return (OsmandApplication) getActivity().getApplication(); + } + + private boolean isLoginOAuth() { + return !Algorithms.isEmpty(getMyApplication().getSettings().USER_DISPLAY_NAME.get()); + } + + @Override + public void createMenuItems(Bundle savedInstanceState) { + final View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_gpx_fragment, null); + final TextView accountName = sendOsmPoiView.findViewById(R.id.user_name); + settings = getMyApplication().getSettings(); + String userNameOAuth = settings.USER_DISPLAY_NAME.get(); + String userNameOpenID = settings.USER_NAME.get(); + String userName = isLoginOAuth() ? userNameOAuth : userNameOpenID; + accountName.setText(userName); + final TextView visibilityName = sendOsmPoiView.findViewById(R.id.visibility_name); + final TextView visibilityDescription = sendOsmPoiView.findViewById(R.id.visibility_description); + HorizontalSelectionAdapter horizontalSelectionAdapter = new HorizontalSelectionAdapter(getMyApplication(), nightMode); + List itemsVisibility = new ArrayList<>(); + for (OsmEditingPlugin.UploadVisibility visibilityType : OsmEditingPlugin.UploadVisibility.values()) { + String title = getMyApplication().getString(visibilityType.stringResource()); + HorizontalSelectionAdapter.HorizontalSelectionItem item = new HorizontalSelectionAdapter.HorizontalSelectionItem(title, visibilityType); + itemsVisibility.add(item); + } + horizontalSelectionAdapter.setItems(itemsVisibility); +// horizontalSelectionAdapter.setSelectedItemByTitle(selectedVisibilityType); + horizontalSelectionAdapter.setListener(new HorizontalSelectionAdapter.HorizontalSelectionAdapterListener() { + @Override + public void onItemSelected(HorizontalSelectionAdapter.HorizontalSelectionItem item) { + uploadVisibility = (OsmEditingPlugin.UploadVisibility) item.getObject(); + visibilityName.setText(uploadVisibility.stringResource()); + visibilityDescription.setText(uploadVisibility.getDescriptionId()); + } + + }); + RecyclerView iconCategoriesRecyclerView = sendOsmPoiView.findViewById(R.id.description_view); + iconCategoriesRecyclerView.setAdapter(horizontalSelectionAdapter); + iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(getMyApplication(), RecyclerView.HORIZONTAL, false)); + horizontalSelectionAdapter.notifyDataSetChanged(); + + final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() + .setCustomView(sendOsmPoiView) + .create(); + items.add(titleItem); + } + + public static void showInstance(@NonNull FragmentManager fragmentManager, @Nullable Fragment targetFragment, final AvailableGPXFragment.GpxInfo... info) { + if (!fragmentManager.isStateSaved()) { + SendGpxBottomSheetFragment fragment = new SendGpxBottomSheetFragment(); + fragment.setTargetFragment(targetFragment, 0); + fragment.show(fragmentManager, TAG); + } + } + + @Override + protected UiUtilities.DialogButtonType getRightBottomButtonType() { + return (UiUtilities.DialogButtonType.PRIMARY); + } + + @Override + protected void onRightBottomButtonClick() { + final View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_gpx_fragment, null); + final TextInputLayout descr = sendOsmPoiView.findViewById(R.id.message_field); + final TextInputLayout tags = sendOsmPoiView.findViewById(R.id.tags_field); + +// new UploadGPXFilesTask(getActivity(), descr.getEditText().toString(), tags.getEditText().toString(), +// uploadVisibility +// ).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info); + } + + @Override + protected int getRightBottomButtonTextId() { + return R.string.shared_string_upload; + } + +} + From c80a358b45320edcf4f1204d798069f7bda5e243 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 11 Nov 2020 00:12:17 +0200 Subject: [PATCH 25/47] OSM Renovation - Send GPX Final --- .../osmand/plus/osmedit/OsmEditingPlugin.java | 2 +- .../dialogs/SendGpxBottomSheetFragment.java | 123 +++++++++++------- 2 files changed, 74 insertions(+), 51 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 39ebaa4052..d8f1ac1423 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -469,7 +469,7 @@ public class OsmEditingPlugin extends OsmandPlugin { LoginBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment()); return false; } else { - SendGpxBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment()); + SendGpxBottomSheetFragment.showInstance(activity.getSupportFragmentManager(), fragment.getTargetFragment(), info); return true; } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index 0ad89d1504..6b3476670c 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -9,20 +9,23 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.material.textfield.TextInputLayout; +import com.google.android.material.textfield.TextInputEditText; -import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; -import net.osmand.plus.myplaces.AvailableGPXFragment; +import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionAdapterListener; +import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter.HorizontalSelectionItem; +import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; import net.osmand.plus.osmedit.OsmEditingPlugin; +import net.osmand.plus.osmedit.OsmEditingPlugin.UploadVisibility; import net.osmand.plus.osmedit.UploadGPXFilesTask; import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.util.Algorithms; @@ -32,68 +35,79 @@ import java.util.List; public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { - public static final String TAG = "SendGpxBottomSheetFragment"; + public static final String TAG = SendGpxBottomSheetFragment.class.getSimpleName(); - protected OsmandSettings settings; + private GpxInfo[] gpxInfos; + private UploadVisibility selectedUploadVisibility = UploadVisibility.Public; - private OsmEditingPlugin.UploadVisibility uploadVisibility; - private List info; - private String selectedVisibilityType; + private TextInputEditText tagsField; + private TextInputEditText messageField; - protected OsmandApplication getMyApplication() { - return (OsmandApplication) getActivity().getApplication(); - } - - private boolean isLoginOAuth() { - return !Algorithms.isEmpty(getMyApplication().getSettings().USER_DISPLAY_NAME.get()); + public void setGpxInfos(GpxInfo[] gpxInfos) { + this.gpxInfos = gpxInfos; } @Override public void createMenuItems(Bundle savedInstanceState) { - final View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_gpx_fragment, null); - final TextView accountName = sendOsmPoiView.findViewById(R.id.user_name); - settings = getMyApplication().getSettings(); - String userNameOAuth = settings.USER_DISPLAY_NAME.get(); - String userNameOpenID = settings.USER_NAME.get(); - String userName = isLoginOAuth() ? userNameOAuth : userNameOpenID; - accountName.setText(userName); + View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_gpx_fragment, null); + + messageField = sendOsmPoiView.findViewById(R.id.message_field); + tagsField = sendOsmPoiView.findViewById(R.id.tags_field); + + OsmandSettings settings = requiredMyApplication().getSettings(); + + TextView accountName = sendOsmPoiView.findViewById(R.id.user_name); + if (!Algorithms.isEmpty(settings.USER_DISPLAY_NAME.get())) { + accountName.setText(settings.USER_DISPLAY_NAME.get()); + } else { + accountName.setText(settings.USER_NAME.get()); + } + + if (gpxInfos.length > 0 && gpxInfos[0].getFileName() != null) { + int dt = gpxInfos[0].getFileName().indexOf('.'); + messageField.setText(gpxInfos[0].getFileName().substring(0, dt)); + } + tagsField.setText(R.string.app_name_osmand); + final TextView visibilityName = sendOsmPoiView.findViewById(R.id.visibility_name); final TextView visibilityDescription = sendOsmPoiView.findViewById(R.id.visibility_description); - HorizontalSelectionAdapter horizontalSelectionAdapter = new HorizontalSelectionAdapter(getMyApplication(), nightMode); - List itemsVisibility = new ArrayList<>(); - for (OsmEditingPlugin.UploadVisibility visibilityType : OsmEditingPlugin.UploadVisibility.values()) { - String title = getMyApplication().getString(visibilityType.stringResource()); - HorizontalSelectionAdapter.HorizontalSelectionItem item = new HorizontalSelectionAdapter.HorizontalSelectionItem(title, visibilityType); + visibilityName.setText(selectedUploadVisibility.stringResource()); + visibilityDescription.setText(selectedUploadVisibility.getDescriptionId()); + + List itemsVisibility = new ArrayList<>(); + for (UploadVisibility visibilityType : UploadVisibility.values()) { + String title = getString(visibilityType.stringResource()); + HorizontalSelectionItem item = new HorizontalSelectionAdapter.HorizontalSelectionItem(title, visibilityType); itemsVisibility.add(item); } + + final HorizontalSelectionAdapter horizontalSelectionAdapter = new HorizontalSelectionAdapter(getMyApplication(), nightMode); horizontalSelectionAdapter.setItems(itemsVisibility); -// horizontalSelectionAdapter.setSelectedItemByTitle(selectedVisibilityType); - horizontalSelectionAdapter.setListener(new HorizontalSelectionAdapter.HorizontalSelectionAdapterListener() { + horizontalSelectionAdapter.setSelectedItemByTitle(getString(selectedUploadVisibility.stringResource())); + horizontalSelectionAdapter.setListener(new HorizontalSelectionAdapterListener() { @Override public void onItemSelected(HorizontalSelectionAdapter.HorizontalSelectionItem item) { - uploadVisibility = (OsmEditingPlugin.UploadVisibility) item.getObject(); - visibilityName.setText(uploadVisibility.stringResource()); - visibilityDescription.setText(uploadVisibility.getDescriptionId()); + selectedUploadVisibility = (OsmEditingPlugin.UploadVisibility) item.getObject(); + visibilityName.setText(selectedUploadVisibility.stringResource()); + visibilityDescription.setText(selectedUploadVisibility.getDescriptionId()); + horizontalSelectionAdapter.notifyDataSetChanged(); } }); + RecyclerView iconCategoriesRecyclerView = sendOsmPoiView.findViewById(R.id.description_view); iconCategoriesRecyclerView.setAdapter(horizontalSelectionAdapter); iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(getMyApplication(), RecyclerView.HORIZONTAL, false)); horizontalSelectionAdapter.notifyDataSetChanged(); - final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() + SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() .setCustomView(sendOsmPoiView) .create(); items.add(titleItem); } - public static void showInstance(@NonNull FragmentManager fragmentManager, @Nullable Fragment targetFragment, final AvailableGPXFragment.GpxInfo... info) { - if (!fragmentManager.isStateSaved()) { - SendGpxBottomSheetFragment fragment = new SendGpxBottomSheetFragment(); - fragment.setTargetFragment(targetFragment, 0); - fragment.show(fragmentManager, TAG); - } + private boolean isLoginOAuth() { + return !Algorithms.isEmpty(getMyApplication().getSettings().USER_DISPLAY_NAME.get()); } @Override @@ -101,21 +115,30 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { return (UiUtilities.DialogButtonType.PRIMARY); } - @Override - protected void onRightBottomButtonClick() { - final View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_gpx_fragment, null); - final TextInputLayout descr = sendOsmPoiView.findViewById(R.id.message_field); - final TextInputLayout tags = sendOsmPoiView.findViewById(R.id.tags_field); - -// new UploadGPXFilesTask(getActivity(), descr.getEditText().toString(), tags.getEditText().toString(), -// uploadVisibility -// ).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info); - } - @Override protected int getRightBottomButtonTextId() { return R.string.shared_string_upload; } -} + @Override + protected void onRightBottomButtonClick() { + FragmentActivity activity = getActivity(); + if (activity != null) { + String tags = tagsField.getText().toString(); + String descr = messageField.getText().toString(); + UploadGPXFilesTask uploadGPXFilesTask = new UploadGPXFilesTask(activity, descr, tags, selectedUploadVisibility); + uploadGPXFilesTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, gpxInfos); + } + dismiss(); + } + + public static void showInstance(@NonNull FragmentManager fragmentManager, @Nullable Fragment targetFragment, GpxInfo[] info) { + if (!fragmentManager.isStateSaved()) { + SendGpxBottomSheetFragment fragment = new SendGpxBottomSheetFragment(); + fragment.setTargetFragment(targetFragment, 0); + fragment.setGpxInfos(info); + fragment.show(fragmentManager, TAG); + } + } +} \ No newline at end of file From a672849cdb407d3bbf5038f5c4898d2907891ec6 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Tue, 10 Nov 2020 15:21:02 +0000 Subject: [PATCH 26/47] Translated using Weblate (French) Currently translated at 99.8% (3533 of 3537 strings) --- OsmAnd/res/values-fr/strings.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index cb2623e4f9..21bd7fbc55 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -51,7 +51,7 @@ Paramètres globaux de l\'application Votre identifiant OSM Nécessaire pour les contributions à openstreetmap.org. - Votre mot de passe OSM + Mot de passe Mode arrière-plan OsmAnd s\'exécute en arrière-plan, écran éteint. Téléchargez une carte vectorielle hors-ligne pour ce lieu (depuis « Paramètres » > « Gérer les cartes ») ou utilisez le greffon « cartes en ligne ». @@ -3926,5 +3926,15 @@ OsmAnd utilise le système de référence MDRS de l\'OTAN dérivé des formats UTM et UPS. MGRS MGRS - Vous devez ajouter, au moins, deux points. + Vous devez, au moins, ajouter deux points. + L\'abonnement OsmAnd Live est en attente + L’abonnement OsmAnd Live a expiré + L\'abonnement OsmAnd Live a été suspendu + Se connecter à OpenStreetMap + Se connecter à OpenStreetMap.org + Se connecter avec OpenStreetMap + Identifiant + Utiliser un identifiant et un mot de passe + Compte + Gérer l\'abonnement \ No newline at end of file From 86c0bb75477139bba512b3f7aff2649f00a1ecc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Tue, 10 Nov 2020 15:46:46 +0000 Subject: [PATCH 27/47] Translated using Weblate (Turkish) Currently translated at 100.0% (3537 of 3537 strings) --- OsmAnd/res/values-tr/strings.xml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 12d01ce727..3a664f5aaa 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -261,7 +261,7 @@ Wikipedia (çevrim dışı) Kullanıcı tanımlı Öntanımlı profil - OSM şifreniz + Parola İndirme için yeterli yer yok: %1$s MB (free: %2$s). Animasyonu durdur Animasyonu başlat @@ -3382,9 +3382,9 @@ Rotanın yeniden hesaplanması Duyuru Kullanıcı adı ve parola - Bu ayarlar tüm profiller için geçerlidir. + Bu eklenti ayarları geneldir ve tüm profiller için geçerlidir OSM düzenleme - Karşıya yüklenmemiş tüm düzenlemelerinizi veya osm hatalarınızı %1$s içinde görüntüleyebilirsiniz. Yüklenen noktalar OsmAnd\'de gösterilmez. + Yüklenmemiş tüm düzenlemelerinizi veya OSM hatalarınızı %1$s\'de görüntüleyebilirsiniz. Karşıya yüklenen noktalar OsmAnd\'da gösterilmez. OSM Navigasyon sırasında veya harekete halindeyken gösterilen simge. Dinlenme anında gösterilen simge. @@ -3903,4 +3903,18 @@ Acil Seyahat En az iki nokta eklemelisiniz. + OpenStreetMap\'te oturum aç + OpenStreetMap.org\'da oturum aç + OpenStreetMap ile giriş yap + Yenilikleri veya değişiklikleri karşıya yüklemek için oturum açmanız gerekir. +\n +\nGüvenli OAuth yöntemini kullanarak oturum açabilir veya kullanıcı adı ve parolanızı kullanabilirsiniz. + Kullanıcı adı ve parola kullan + Kullanıcı adı + Hesap + Aboneliği yönet + Aboneliğinizle ilgili bir sorun var. Ödeme yönteminizi düzeltmek üzere Google Play abonelik ayarlarına gitmek için düğmeye tıklayın. + OsmAnd Live aboneliğinin süresi doldu + OsmAnd Live aboneliği duraklatıldı + OsmAnd Live aboneliği beklemede \ No newline at end of file From b87cefd8c325afc3a1b1adf86f824d5e86ac2a48 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Tue, 10 Nov 2020 20:18:03 +0000 Subject: [PATCH 28/47] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3537 of 3537 strings) --- OsmAnd/res/values-uk/strings.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 9a18b68263..96a5a994c9 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3425,9 +3425,9 @@ Перерахунок маршруту Оголошення Ім\'я користувача і пароль - Ці налаштування стосуються всіх профілів. + Ці налаштування втулка стосуються всіх профілів OSM-правлення - Ви можете переглянути всі не завантажені зміни або помилки в OSM в %1$s. Завантажені точки не відображаються в OsmAnd. + Ви можете переглянути всі вивантажені зміни або вади OSM у %1$s. Вивантажені точки не показано в OsmAnd. OSM Значок відображається під час навігації чи переміщення. Значок показано в спокої. @@ -3949,4 +3949,13 @@ Термін дії передплати OsmAnd Live закінчився Передплату OsmAnd Live зупинено Передплата OsmAnd Live на утриманні + Увійти до OpenStreetMap.org + Увійти до OpenStreetMap.org + Увійти за допомогою OpenStreetMap + Увійдіть, щоб вивантажити нові або внесені зміни. +\n +\nВи можете увійти, за допомогою безпечного методу OAuth, або скористатися своїм ім\'ям та паролем. + Використовувати ім\'я і пароль + Обліковий запис + Ім\'я користувача \ No newline at end of file From e4b622851b43eb04124c42903eea3873d0ed5538 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Tue, 10 Nov 2020 16:06:27 +0000 Subject: [PATCH 29/47] Translated using Weblate (Hebrew) Currently translated at 99.8% (3531 of 3537 strings) --- OsmAnd/res/values-iw/strings.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index b27a8291d6..9fe092ba76 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -303,7 +303,7 @@ הגדרות יישומים כלליות שם המשתמש שלך ב־OSM נדרש לטובת שליחת נתונים אל openstreetmap.org. - הססמה שלך ב־OSM + ססמה מצב רקע OsmAnd פועל ברקע בזמן שהמסך כבוי. אין די מקום כדי להוריד %1$s מ״ב (פנויים: %2$s). @@ -3951,4 +3951,14 @@ ב־OsmAnd נעשה שימוש ב־MGRS, שדומה לתצורת UTM NATO. MGRS MGRS + עליך להוסיף שתי נקודות לפחות. + כניסה ל־OpenStreetMap + כניסה ל־OpenStreetMap.org + כניסה עם OpenStreetMap + להשתמש בשם כניסה וססמה + חשבון + כניסה + ניהול מינוי + תוקף המינוי ל־OsmAnd Live פג + המינוי ל־OsmAnd Live הושהה \ No newline at end of file From 1b39cf9eb08ab714a2b3f4f367c76503f2b11d44 Mon Sep 17 00:00:00 2001 From: Zmicer Turok Date: Tue, 10 Nov 2020 18:02:55 +0000 Subject: [PATCH 30/47] Translated using Weblate (Belarusian) Currently translated at 99.0% (3504 of 3537 strings) --- OsmAnd/res/values-be/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 3d0aa6103d..cd41fe3d60 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -562,7 +562,7 @@ Агульныя налады праграмы Вашае імя карыстальніка OSM Патрэбна для падачы ў openstreetmap.org. - Ваш пароль OSM + Пароль Фонавы рэжым OsmAnd працуе ў фоне з адключаным экранам. Не стае вольнага месца для спампоўвання %1$s МБ (вольна: %2$s). @@ -905,7 +905,7 @@ Запампоўванне… Нічога не знойдзена Пошук… - Пошук адрасу… + Пошук адраса… Сеціўны пошук праз OSM Nominatim Сеціўны пошук: горад, вуліца, дом Пазасеціўны пошук @@ -3478,7 +3478,7 @@ Фотанататкі Пераразлік маршруту Імя карыстальніка і пароль - Гэтыя алады распаўсюджваюцца на ўсе профілі. + Гэтыя налады ўбудовы распаўсюджваюцца на ўсе профілі Рэдагаванне OSM OSM Значок будзе паказвацца падчас навігацыі або руху. From 275f508ce414ee484f2ded66487daf98847190ce Mon Sep 17 00:00:00 2001 From: Franco Date: Tue, 10 Nov 2020 16:20:58 +0000 Subject: [PATCH 31/47] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3536 of 3537 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 6358e33bbe..87ae4731c0 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -1033,7 +1033,7 @@ Ajustes globales de la aplicación Nombre de usuario de OSM Necesario para envíos a OpenStreetMap.org. - Contraseña de OSM + Contraseña Modo reposo OsmAnd se ejecuta en modo reposo con la pantalla apagada. Sin espacio suficiente para descargar %1$s MB (disponible: %2$s). @@ -3430,7 +3430,7 @@ Recálculo de la ruta Anunciar Nombre de usuario y contraseña - Estos ajustes se aplican a todos los perfiles. + Los ajustes de este complemento son globales y se aplican a todos los perfiles Edición de OSM Puedes ver todas tus ediciones no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd. OSM @@ -3957,4 +3957,13 @@ La suscripción a OsmAnd Live ha caducado La suscripción a OsmAnd Live se ha pausado La suscripción a OsmAnd Live está en espera + Ingresar con OpenStreetMap + Iniciar sesión en OpenStreetMap + Ingresar a OpenStreetMap.org + Necesitas iniciar sesión para subir cambios nuevos o modificados. +\n +\nPuedes ingresar usando el método seguro de OAuth o usar el nombre de usuario y contraseña. + Utilice nombre de usuario y contraseña + Cuenta + Iniciar sesión \ No newline at end of file From 1a650bcaf88415bfc2a57dc3c4c6bb585351f0b0 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Tue, 10 Nov 2020 15:56:58 +0000 Subject: [PATCH 32/47] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (3537 of 3537 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index ac13cb04f5..af75050e02 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -1020,7 +1020,7 @@ Configurações globais do aplicativo Seu nome de usuário OSM Necessário para envios ao openstreetmap.org. - Sua senha do OSM + Senha Modo em segundo plano OsmAnd é executado em segundo plano com a tela desligada. Atrasado @@ -3421,9 +3421,9 @@ Recálculo da rota Anunciar Usuário e senha - Essas configurações se aplicam a todos os perfis. + Essas configurações de plug-in são globais e se aplicam a todos os perfis Edição OSM - Você pode ver todos os erros de osm do editor carregado em %1$s. Os pontos enviados não são exibidos no OsmAnd. + Você pode ver todas as suas edições descarregadas ou erros do OSM em %1$s. Os pontos carregados não aparecem no OsmAnd. OSM Ícone mostrado ao navegar ou mover. Ícone mostrado em repouso. @@ -3947,4 +3947,14 @@ A assinatura do OsmAnd Live expirou A assinatura do OsmAnd Live foi pausada A assinatura do OsmAnd Live está em espera + Diferença + Entrar para OpenStreetMap + Entrar com OpenStreetMap.org + Entrar com OpenStreetMap + Você precisa entrar para enviar alterações novas ou modificadas. +\n +\nVocê pode entrar usando o método OAuth seguro ou usar sua entrada e senha. + Usar a entrada e senha + Conta + Entrar \ No newline at end of file From ea492715f6c13372e1b10fcd286a4a574fb5f520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Tue, 10 Nov 2020 20:35:02 +0000 Subject: [PATCH 33/47] Translated using Weblate (Estonian) Currently translated at 99.2% (3510 of 3537 strings) --- OsmAnd/res/values-et/strings.xml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index 8e43c4142f..c6bb81ed40 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -1943,7 +1943,7 @@ Seadista ekraan ja rakenduse üldised seaded. Rakenduse üldised seaded Sinu OSM kasutajanimi - Sinu OSM salasõna + Salasõna Taustarežiim OsmAnd töötab taustal, ekraan välja lülitatud. Kas laeme alla {0} fail(i)\? @@ -3358,7 +3358,7 @@ Teekonna ümberarvutamine Teata Kasutajanimi ja salasõna - Need seaded rakenduvad kõikidele profiilidele. + Need seaded on üldised ja rakenduvad kõikidele profiilidele OSM\'i andmete muutmine Kõiki üleslaadimata muudatusi või OSM vigu saad vaadata menüüs %1$s. Üleslaaditud punkte OsmAnd ei kuva. OSM @@ -3804,4 +3804,11 @@ OsmAnd Live tellimus on aegunud Sinu tellimusega on üks pisikene segadus. Selleks et Google Play seadistuses makseviisi parandada, palun klõpsi seda nuppu. Halda tellimusi + Logi sisse OpenStreetMapi kasutajakontoga + Kasutajanimi + Pruugi kasutajanime ja salasõna + Täienduste või muudatuste üleslaadimiseks pead sisse logima. +\n +\nSa võid selleks kasutada mõnd turvalust OAuth võimalust või oma kasutajanime ning salasõna. + Kasutajakonto \ No newline at end of file From 2a303bc33a7d2c5807f4784f036eab610ff36570 Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Tue, 10 Nov 2020 16:52:23 +0000 Subject: [PATCH 34/47] Translated using Weblate (Arabic) Currently translated at 43.4% (1666 of 3830 strings) --- OsmAnd/res/values-ar/phrases.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index 3a9d249731..9fe161678e 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -277,7 +277,7 @@ حوض سباحة مولد طاقة قمة جبلية - كرة القدم + كرة قدم بنك شركة تأمين أطباء @@ -648,7 +648,7 @@ تزلج سباحة تنس الطاولة - كرة المضرب + تنس الكرة الطائرة متحف موقع أثري @@ -658,7 +658,7 @@ أطلال تاريخية سفينة تاريخية نصب تذكاري - حديقة الحيوانات + حديقة حيوانات الزيارة المنزلية أدوات مساعدة للسمع لوازم السفن والقوارب @@ -772,10 +772,10 @@ منزلق مائي سكن بيت ضيافة - نزل + شقة نزل صغير كوخ بجبال الألب - تشاليه + شاليه شقة كوخ بري مقصورة @@ -1676,4 +1676,6 @@ مدخل الدراجة مدخل المقطورة نوع 2 مخرج combo + حديقه + حوض سمك \ No newline at end of file From 24a3d8fd53a15151981b20ff102d08a6f756f3cc Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 11 Nov 2020 03:15:17 +0200 Subject: [PATCH 35/47] Export markers and markers history to separate files --- OsmAnd/res/values/strings.xml | 1 + .../net/osmand/plus/mapmarkers/MapMarker.java | 20 ++- .../plus/mapmarkers/MapMarkersHelper.java | 37 ++-- .../settings/backend/ExportSettingsType.java | 3 +- .../backend/backup/FavoritesSettingsItem.java | 28 +-- .../backup/HistoryMarkersSettingsItem.java | 160 +++++++++++++++++ .../backend/backup/MarkersSettingsItem.java | 164 +++++------------- .../backend/backup/SettingsHelper.java | 57 +++++- .../settings/backend/backup/SettingsItem.java | 21 +++ .../backend/backup/SettingsItemType.java | 3 +- .../backend/backup/SettingsItemsFactory.java | 5 +- .../fragments/DuplicatesSettingsAdapter.java | 16 +- .../ExportImportSettingsAdapter.java | 18 +- .../fragments/ImportDuplicatesFragment.java | 15 +- .../fragments/ImportSettingsFragment.java | 39 ++++- .../ImportedSettingsItemsAdapter.java | 6 +- 16 files changed, 389 insertions(+), 204 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index dc262a8b1b..5209a248b3 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,7 @@ Thx - Hardy --> + Markers history OsmAnd Live subscription is on hold OsmAnd Live subscription has been paused OsmAnd Live subscription has been expired diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java index 172aea8a46..498c36f93c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarker.java @@ -2,9 +2,10 @@ package net.osmand.plus.mapmarkers; import android.content.Context; +import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; -import net.osmand.GPXUtilities; +import net.osmand.GPXUtilities.WptPt; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.LocationPoint; @@ -15,6 +16,7 @@ import net.osmand.util.Algorithms; import static net.osmand.data.PointDescription.POINT_TYPE_MAP_MARKER; public class MapMarker implements LocationPoint { + private static int[] colors; public String id; @@ -30,7 +32,7 @@ public class MapMarker implements LocationPoint { public String nextKey; public String groupKey; public String groupName; - public GPXUtilities.WptPt wptPt; + public WptPt wptPt; public FavouritePoint favouritePoint; public String mapObjectName; @@ -45,7 +47,7 @@ public class MapMarker implements LocationPoint { public int getType() { return favouritePoint == null ? (wptPt == null ? MapMarkersGroup.ANY_TYPE : MapMarkersGroup.GPX_TYPE) : - MapMarkersGroup.FAVORITES_TYPE; + MapMarkersGroup.FAVORITES_TYPE; } public PointDescription getPointDescription(Context ctx) { @@ -110,7 +112,7 @@ public class MapMarker implements LocationPoint { return result; } - private static final int[] colorsIds = new int[]{ + private static final int[] colorsIds = new int[] { R.color.marker_blue, R.color.marker_green, R.color.marker_orange, @@ -134,4 +136,14 @@ public class MapMarker implements LocationPoint { public static int getColorId(int colorIndex) { return (colorIndex >= 0 && colorIndex < colorsIds.length) ? colorsIds[colorIndex] : colorsIds[0]; } + + public static int getColorIndex(Context context, @ColorInt int color) { + int[] colors = getColors(context); + for (int i = 0; i < colors.length; i++) { + if (color == colors[i]) { + return i; + } + } + return 0; + } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java index dc3a25a61e..b0a13d8e44 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHelper.java @@ -59,11 +59,8 @@ public class MapMarkersHelper { public static final int BY_DATE_ADDED_ASC = 4; - public static final String GROUP_NAME = "group_name"; - public static final String GROUP_TYPE = "group_type"; - public static final String MARKER_HISTORY = "marker_history"; - public static final String CREATION_DATE = "creation_date"; public static final String VISITED_DATE = "visited_date"; + public static final String CREATION_DATE = "creation_date"; private static final Log LOG = PlatformUtil.getLog(MapMarkersHelper.class); @@ -1035,18 +1032,38 @@ public class MapMarkersHelper { wpt.name = marker.getOnlyName(); wpt.setColor(ContextCompat.getColor(ctx, MapMarker.getColorId(marker.colorIndex))); if (completeBackup) { - wpt.category = marker.groupKey; - wpt.getExtensionsToWrite().put(GROUP_NAME, marker.groupName); - wpt.getExtensionsToWrite().put(GROUP_TYPE, String.valueOf(marker.getType())); - wpt.getExtensionsToWrite().put(MARKER_HISTORY, String.valueOf(marker.history)); - wpt.getExtensionsToWrite().put(CREATION_DATE, String.valueOf(marker.creationDate)); - wpt.getExtensionsToWrite().put(VISITED_DATE, String.valueOf(marker.visitedDate)); + if (marker.creationDate != 0) { + wpt.getExtensionsToWrite().put(CREATION_DATE, String.valueOf(marker.creationDate)); + } + if (marker.visitedDate != 0) { + wpt.getExtensionsToWrite().put(VISITED_DATE, String.valueOf(marker.visitedDate)); + } } gpxFile.addPoint(wpt); } return gpxFile; } + public List readMarkersFromGpx(GPXFile gpxFile, boolean history) { + List mapMarkers = new ArrayList<>(); + for (WptPt point : gpxFile.getPoints()) { + LatLon latLon = new LatLon(point.lat, point.lon); + int colorIndex = MapMarker.getColorIndex(ctx, point.getColor()); + PointDescription name = new PointDescription(PointDescription.POINT_TYPE_LOCATION, point.name); + + MapMarker marker = new MapMarker(latLon, name, colorIndex, false, 0); + + String visitedDateStr = point.getExtensionsToRead().get(VISITED_DATE); + String creationDateStr = point.getExtensionsToRead().get(CREATION_DATE); + marker.visitedDate = Algorithms.parseLongSilently(visitedDateStr, 0); + marker.creationDate = Algorithms.parseLongSilently(creationDateStr, 0); + marker.nextKey = history ? MapMarkersDbHelper.HISTORY_NEXT_VALUE : MapMarkersDbHelper.TAIL_NEXT_VALUE; + + mapMarkers.add(marker); + } + return mapMarkers; + } + // --------------------------------------------------------------------------------------------- // accessors to active markers: diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java index a530ef5dcf..3dcb680b06 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java @@ -17,5 +17,6 @@ public enum ExportSettingsType { FAVORITES, TTS_VOICE, VOICE, - MARKERS + ACTIVE_MARKERS, + HISTORY_MARKERS } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java index 817ec38a49..acb96be110 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java @@ -16,10 +16,7 @@ import net.osmand.plus.R; import org.json.JSONException; import org.json.JSONObject; -import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -69,11 +66,6 @@ public class FavoritesSettingsItem extends CollectionSettingsItem return ctx.getString(R.string.shared_string_favorites); } - @NonNull - public String getDefaultFileName() { - return getName() + getDefaultFileExtension(); - } - @NonNull public String getDefaultFileExtension() { return GPX_FILE_EXT; @@ -177,21 +169,9 @@ public class FavoritesSettingsItem extends CollectionSettingsItem @Nullable @Override - SettingsItemWriter getWriter() { - return new SettingsItemWriter(this) { - - @Override - public boolean writeToStream(@NonNull OutputStream outputStream) throws IOException { - List favourites = getPointsFromGroups(items); - GPXFile gpxFile = favoritesHelper.asGpxFile(favourites); - Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); - if (error != null) { - warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); - SettingsHelper.LOG.error("Failed write to gpx file", error); - return false; - } - return true; - } - }; + SettingsItemWriter getWriter() { + List favourites = getPointsFromGroups(items); + GPXFile gpxFile = favoritesHelper.asGpxFile(favourites); + return getGpxWriter(gpxFile); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java new file mode 100644 index 0000000000..a07aeb07ea --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/HistoryMarkersSettingsItem.java @@ -0,0 +1,160 @@ +package net.osmand.plus.settings.backend.backup; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.GPXUtilities; +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.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersDbHelper; +import net.osmand.plus.mapmarkers.MapMarkersGroup; +import net.osmand.plus.mapmarkers.MapMarkersHelper; +import net.osmand.plus.settings.backend.ExportSettingsType; +import net.osmand.util.Algorithms; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import static net.osmand.IndexConstants.GPX_FILE_EXT; + +public class HistoryMarkersSettingsItem extends CollectionSettingsItem { + + private MapMarkersHelper markersHelper; + + public HistoryMarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { + super(app, null, items); + } + + public HistoryMarkersSettingsItem(@NonNull OsmandApplication app, @Nullable HistoryMarkersSettingsItem baseItem, @NonNull List items) { + super(app, baseItem, items); + } + + HistoryMarkersSettingsItem(@NonNull OsmandApplication app, @NonNull JSONObject json) throws JSONException { + super(app, json); + } + + @Override + protected void init() { + super.init(); + markersHelper = app.getMapMarkersHelper(); + existingItems = new ArrayList<>(markersHelper.getMapMarkersHistory()); + } + + @NonNull + @Override + public SettingsItemType getType() { + return SettingsItemType.HISTORY_MARKERS; + } + + @NonNull + @Override + public String getName() { + return "history_markers"; + } + + @NonNull + @Override + public String getPublicName(@NonNull Context ctx) { + return ctx.getString(R.string.markers_history); + } + + @NonNull + public String getDefaultFileExtension() { + return GPX_FILE_EXT; + } + + @Override + public void apply() { + List newItems = getNewItems(); + if (!newItems.isEmpty() || !duplicateItems.isEmpty()) { + appliedItems = new ArrayList<>(newItems); + + for (MapMarker duplicate : duplicateItems) { + if (shouldReplace) { + MapMarker existingMarker = markersHelper.getMapMarker(duplicate.point); + markersHelper.removeMarker(existingMarker); + } + appliedItems.add(shouldReplace ? duplicate : renameItem(duplicate)); + } + + for (MapMarker marker : appliedItems) { + markersHelper.moveMapMarkerToHistory(marker); + } + } + } + + @Override + public boolean isDuplicate(@NonNull MapMarker mapMarker) { + for (MapMarker marker : existingItems) { + if (marker.equals(mapMarker) + && Algorithms.objectEquals(marker.getOriginalPointDescription(), mapMarker.getOriginalPointDescription())) { + return true; + } + } + return false; + } + + @Override + public boolean shouldReadOnCollecting() { + return true; + } + + @NonNull + @Override + public MapMarker renameItem(@NonNull MapMarker item) { + int number = 0; + while (true) { + number++; + String name = item.getOnlyName() + "_" + number; + PointDescription description = new PointDescription(PointDescription.POINT_TYPE_LOCATION, name); + MapMarker renamedMarker = new MapMarker(item.point, description, item.getColor(), item.selected, item.index); + if (!isDuplicate(renamedMarker)) { + renamedMarker.nextKey = MapMarkersDbHelper.HISTORY_NEXT_VALUE; + return renamedMarker; + } + } + } + + public MapMarkersGroup getMarkersGroup() { + String name = app.getString(R.string.markers_history); + String groupId = ExportSettingsType.HISTORY_MARKERS.name(); + MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + markersGroup.setMarkers(items); + return markersGroup; + } + + @Nullable + @Override + SettingsItemReader getReader() { + return new SettingsItemReader(this) { + + @Override + public void readFromStream(@NonNull InputStream inputStream, String entryName) throws IllegalArgumentException { + GPXFile gpxFile = GPXUtilities.loadGPXFile(inputStream); + if (gpxFile.error != null) { + warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType()))); + SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error); + } else { + List mapMarkers = markersHelper.readMarkersFromGpx(gpxFile, true); + items.addAll(mapMarkers); + } + } + }; + } + + @Nullable + @Override + SettingsItemWriter getWriter() { + GPXFile gpxFile = markersHelper.generateGpx(items, true); + return getGpxWriter(gpxFile); + } +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java index 4a8026ea44..3fea648619 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MarkersSettingsItem.java @@ -7,8 +7,6 @@ import androidx.annotation.Nullable; import net.osmand.GPXUtilities; import net.osmand.GPXUtilities.GPXFile; -import net.osmand.GPXUtilities.WptPt; -import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -16,37 +14,27 @@ 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.settings.backend.ExportSettingsType; import net.osmand.util.Algorithms; import org.json.JSONException; import org.json.JSONObject; -import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import static net.osmand.IndexConstants.GPX_FILE_EXT; -import static net.osmand.plus.mapmarkers.MapMarkersHelper.CREATION_DATE; -import static net.osmand.plus.mapmarkers.MapMarkersHelper.GROUP_NAME; -import static net.osmand.plus.mapmarkers.MapMarkersHelper.GROUP_TYPE; -import static net.osmand.plus.mapmarkers.MapMarkersHelper.MARKER_HISTORY; -import static net.osmand.plus.mapmarkers.MapMarkersHelper.VISITED_DATE; -public class MarkersSettingsItem extends CollectionSettingsItem { +public class MarkersSettingsItem extends CollectionSettingsItem { private MapMarkersHelper markersHelper; - private Map flatGroups = new LinkedHashMap<>(); - public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { + public MarkersSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { super(app, null, items); } - public MarkersSettingsItem(@NonNull OsmandApplication app, @Nullable MarkersSettingsItem baseItem, @NonNull List items) { + public MarkersSettingsItem(@NonNull OsmandApplication app, @Nullable MarkersSettingsItem baseItem, @NonNull List items) { super(app, baseItem, items); } @@ -58,13 +46,13 @@ public class MarkersSettingsItem extends CollectionSettingsItem protected void init() { super.init(); markersHelper = app.getMapMarkersHelper(); - existingItems = new ArrayList<>(markersHelper.getMapMarkersGroups()); + existingItems = new ArrayList<>(markersHelper.getMapMarkers()); } @NonNull @Override public SettingsItemType getType() { - return SettingsItemType.MARKERS; + return SettingsItemType.ACTIVE_MARKERS; } @NonNull @@ -79,11 +67,6 @@ public class MarkersSettingsItem extends CollectionSettingsItem return ctx.getString(R.string.map_markers); } - @NonNull - public String getDefaultFileName() { - return getName() + getDefaultFileExtension(); - } - @NonNull public String getDefaultFileExtension() { return GPX_FILE_EXT; @@ -91,37 +74,29 @@ public class MarkersSettingsItem extends CollectionSettingsItem @Override public void apply() { - List newItems = getNewItems(); + List newItems = getNewItems(); if (!newItems.isEmpty() || !duplicateItems.isEmpty()) { appliedItems = new ArrayList<>(newItems); - for (MapMarkersGroup duplicate : duplicateItems) { + for (MapMarker duplicate : duplicateItems) { if (shouldReplace) { - MapMarkersGroup existingGroup = markersHelper.getMapMarkerGroupById(duplicate.getId(), duplicate.getType()); - if (existingGroup != null) { - List existingMarkers = new ArrayList<>(existingGroup.getMarkers()); - for (MapMarker marker : existingMarkers) { - markersHelper.removeMarker(marker); - } - } + MapMarker existingMarker = markersHelper.getMapMarker(duplicate.point); + markersHelper.removeMarker(existingMarker); } - appliedItems.add(duplicate); + appliedItems.add(shouldReplace ? duplicate : renameItem(duplicate)); } - for (MapMarkersGroup markersGroup : appliedItems) { - for (MapMarker marker : markersGroup.getMarkers()) { - markersHelper.addMarker(marker); - } + + for (MapMarker marker : appliedItems) { + markersHelper.addMarker(marker); } } } @Override - public boolean isDuplicate(@NonNull MapMarkersGroup markersGroup) { - String name = markersGroup.getName(); - for (MapMarkersGroup group : existingItems) { - if (Algorithms.stringsEqual(group.getName(), name) - && !Algorithms.isEmpty(group.getMarkers()) - && !Algorithms.isEmpty(markersGroup.getMarkers())) { + public boolean isDuplicate(@NonNull MapMarker mapMarker) { + for (MapMarker marker : existingItems) { + if (marker.equals(mapMarker) + && Algorithms.objectEquals(marker.getOriginalPointDescription(), mapMarker.getOriginalPointDescription())) { return true; } } @@ -135,8 +110,26 @@ public class MarkersSettingsItem extends CollectionSettingsItem @NonNull @Override - public MapMarkersGroup renameItem(@NonNull MapMarkersGroup item) { - return item; + public MapMarker renameItem(@NonNull MapMarker item) { + int number = 0; + while (true) { + number++; + String name = item.getOnlyName() + "_" + number; + PointDescription description = new PointDescription(PointDescription.POINT_TYPE_LOCATION, name); + MapMarker renamedMarker = new MapMarker(item.point, description, item.getColor(), item.selected, item.index); + if (!isDuplicate(renamedMarker)) { + renamedMarker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE; + return renamedMarker; + } + } + } + + public MapMarkersGroup getMarkersGroup() { + String name = app.getString(R.string.map_markers); + String groupId = ExportSettingsType.ACTIVE_MARKERS.name(); + MapMarkersGroup markersGroup = new MapMarkersGroup(groupId, name, MapMarkersGroup.ANY_TYPE); + markersGroup.setMarkers(items); + return markersGroup; } @Nullable @@ -151,88 +144,17 @@ public class MarkersSettingsItem extends CollectionSettingsItem warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType()))); SettingsHelper.LOG.error("Failed read gpx file", gpxFile.error); } else { - List markerColors = getMarkersColors(); - for (WptPt point : gpxFile.getPoints()) { - LatLon latLon = new LatLon(point.lat, point.lon); - - int colorIndex = markerColors.indexOf(point.getColor()); - if (colorIndex == -1) { - colorIndex = 0; - } - - PointDescription pointDescription = new PointDescription(PointDescription.POINT_TYPE_LOCATION, point.name); - MapMarker marker = new MapMarker(latLon, pointDescription, colorIndex, false, 0); - - String historyStr = point.getExtensionsToRead().get(MARKER_HISTORY); - String creationDateStr = point.getExtensionsToRead().get(CREATION_DATE); - String visitedDateStr = point.getExtensionsToRead().get(VISITED_DATE); - marker.creationDate = Algorithms.parseLongSilently(creationDateStr, 0); - marker.visitedDate = Algorithms.parseLongSilently(visitedDateStr, 0); - marker.history = Boolean.parseBoolean(historyStr); - marker.nextKey = MapMarkersDbHelper.TAIL_NEXT_VALUE; - - MapMarkersGroup group = getOrCreateGroup(point); - group.getMarkers().add(marker); - } + List mapMarkers = markersHelper.readMarkersFromGpx(gpxFile, false); + items.addAll(mapMarkers); } } }; } - private MapMarkersGroup getOrCreateGroup(WptPt point) { - MapMarkersGroup markersGroup = flatGroups.get(point.category); - if (markersGroup != null) { - return markersGroup; - } - Map extensions = point.getExtensionsToRead(); - String groupName = extensions.get(GROUP_NAME); - String groupType = extensions.get(GROUP_TYPE); - int type = Algorithms.parseIntSilently(groupType, MapMarkersGroup.ANY_TYPE); - - if (point.category != null && groupName != null) { - markersGroup = new MapMarkersGroup(point.category, groupName, type); - } else { - markersGroup = new MapMarkersGroup(); - } - flatGroups.put(markersGroup.getId(), markersGroup); - items.add(markersGroup); - - return markersGroup; - } - - private List getMarkersColors() { - List colors = new ArrayList<>(); - for (int color : MapMarker.getColors(app)) { - colors.add(color); - } - return colors; - } - @Nullable @Override - SettingsItemWriter getWriter() { - return new SettingsItemWriter(this) { - - @Override - public boolean writeToStream(@NonNull OutputStream outputStream) throws IOException { - List mapMarkers = getMarkersFromGroups(items); - GPXFile gpxFile = markersHelper.generateGpx(mapMarkers, true); - Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); - if (error != null) { - warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); - SettingsHelper.LOG.error("Failed write to gpx file", error); - return false; - } - return true; - } - }; - } - - private List getMarkersFromGroups(List markersGroups) { - List mapMarkers = new ArrayList<>(); - for (MapMarkersGroup group : markersGroups) { - mapMarkers.addAll(group.getMarkers()); - } - return mapMarkers; + SettingsItemWriter getWriter() { + GPXFile gpxFile = markersHelper.generateGpx(items, true); + return getGpxWriter(gpxFile); } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java index be32a12370..35f85b8ee8 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -16,9 +16,9 @@ import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; +import net.osmand.plus.R; import net.osmand.plus.SQLiteTileSource; import net.osmand.plus.activities.LocalIndexHelper; import net.osmand.plus.activities.LocalIndexInfo; @@ -29,6 +29,8 @@ 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.mapmarkers.MapMarker; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.osmedit.OpenstreetmapPoint; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.osmedit.OsmNotesPoint; @@ -595,9 +597,21 @@ public class SettingsHelper { if (!files.isEmpty()) { dataList.put(ExportSettingsType.VOICE, files); } - List markersGroups = app.getMapMarkersHelper().getMapMarkersGroups(); - if (!markersGroups.isEmpty()) { - dataList.put(ExportSettingsType.MARKERS, markersGroups); + List mapMarkers = app.getMapMarkersHelper().getMapMarkers(); + 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); + markersGroup.setMarkers(mapMarkers); + dataList.put(ExportSettingsType.ACTIVE_MARKERS, Collections.singletonList(markersGroup)); + } + List markersHistory = app.getMapMarkersHelper().getMapMarkersHistory(); + 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); + markersGroup.setMarkers(markersHistory); + dataList.put(ExportSettingsType.HISTORY_MARKERS, Collections.singletonList(markersGroup)); } return dataList; } @@ -639,6 +653,7 @@ public class SettingsHelper { List osmNotesPointList = new ArrayList<>(); List osmEditsPointList = new ArrayList<>(); List markersGroups = new ArrayList<>(); + List markersHistoryGroups = new ArrayList<>(); for (Object object : data) { if (object instanceof QuickAction) { @@ -664,7 +679,12 @@ public class SettingsHelper { } else if (object instanceof FavoriteGroup) { favoriteGroups.add((FavoriteGroup) object); } else if (object instanceof MapMarkersGroup) { - markersGroups.add((MapMarkersGroup) object); + MapMarkersGroup markersGroup = (MapMarkersGroup) object; + if (ExportSettingsType.ACTIVE_MARKERS.name().equals(markersGroup.getId())) { + markersGroups.add((MapMarkersGroup) object); + } else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) { + markersHistoryGroups.add((MapMarkersGroup) object); + } } } if (!quickActions.isEmpty()) { @@ -697,7 +717,18 @@ public class SettingsHelper { settingsItems.add(new FavoritesSettingsItem(app, favoriteGroups)); } if (!markersGroups.isEmpty()) { - settingsItems.add(new MarkersSettingsItem(app, markersGroups)); + List mapMarkers = new ArrayList<>(); + for (MapMarkersGroup group : markersGroups) { + mapMarkers.addAll(group.getMarkers()); + } + settingsItems.add(new MarkersSettingsItem(app, mapMarkers)); + } + if (!markersHistoryGroups.isEmpty()) { + List mapMarkers = new ArrayList<>(); + for (MapMarkersGroup group : markersHistoryGroups) { + mapMarkers.addAll(group.getMarkers()); + } + settingsItems.add(new HistoryMarkersSettingsItem(app, mapMarkers)); } return settingsItems; } @@ -721,6 +752,7 @@ public class SettingsHelper { List editsPointList = new ArrayList<>(); List favoriteGroups = new ArrayList<>(); List markersGroups = new ArrayList<>(); + List markersHistoryGroups = new ArrayList<>(); for (SettingsItem item : settingsItems) { switch (item.getType()) { @@ -800,9 +832,13 @@ public class SettingsHelper { FavoritesSettingsItem favoritesSettingsItem = (FavoritesSettingsItem) item; favoriteGroups.addAll(favoritesSettingsItem.getItems()); break; - case MARKERS: + case ACTIVE_MARKERS: MarkersSettingsItem markersSettingsItem = (MarkersSettingsItem) item; - markersGroups.addAll(markersSettingsItem.getItems()); + markersGroups.add(markersSettingsItem.getMarkersGroup()); + break; + case HISTORY_MARKERS: + HistoryMarkersSettingsItem historyMarkersSettingsItem = (HistoryMarkersSettingsItem) item; + markersHistoryGroups.add(historyMarkersSettingsItem.getMarkersGroup()); break; default: break; @@ -858,7 +894,10 @@ public class SettingsHelper { settingsToOperate.put(ExportSettingsType.VOICE, voiceFilesList); } if (!markersGroups.isEmpty()) { - settingsToOperate.put(ExportSettingsType.MARKERS, markersGroups); + settingsToOperate.put(ExportSettingsType.ACTIVE_MARKERS, markersGroups); + } + if (!markersGroups.isEmpty()) { + settingsToOperate.put(ExportSettingsType.HISTORY_MARKERS, markersHistoryGroups); } return settingsToOperate; } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItem.java index afe776db09..8b6736bf1d 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItem.java @@ -5,7 +5,10 @@ import android.content.Context; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import net.osmand.GPXUtilities; +import net.osmand.GPXUtilities.GPXFile; import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; import net.osmand.util.Algorithms; import org.json.JSONException; @@ -17,6 +20,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.List; @@ -205,6 +209,7 @@ public abstract class SettingsItem { String s = json.toString(2); outputStream.write(s.getBytes("UTF-8")); } catch (JSONException e) { + warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); SettingsHelper.LOG.error("Failed to write json to stream", e); } return true; @@ -214,6 +219,22 @@ public abstract class SettingsItem { }; } + @NonNull + SettingsItemWriter getGpxWriter(@NonNull final GPXFile gpxFile) { + return new SettingsItemWriter(this) { + @Override + public boolean writeToStream(@NonNull OutputStream outputStream) throws IOException { + Exception error = GPXUtilities.writeGpx(new OutputStreamWriter(outputStream, "UTF-8"), gpxFile); + if (error != null) { + warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType()))); + SettingsHelper.LOG.error("Failed write to gpx file", error); + return false; + } + return true; + } + }; + } + @Override public int hashCode() { return (getType().name() + getName()).hashCode(); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java index bc254e28ca..2fed0b2645 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java @@ -16,5 +16,6 @@ public enum SettingsItemType { OSM_NOTES, OSM_EDITS, FAVOURITES, - MARKERS + ACTIVE_MARKERS, + HISTORY_MARKERS } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java index 3012cc3dd8..5160000d0c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java @@ -134,9 +134,12 @@ class SettingsItemsFactory { case FAVOURITES: item = new FavoritesSettingsItem(app, json); break; - case MARKERS: + case ACTIVE_MARKERS: item = new MarkersSettingsItem(app, json); break; + case HISTORY_MARKERS: + item = new HistoryMarkersSettingsItem(app, json); + break; } return item; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java index 12f491e21a..798b29a476 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java @@ -14,18 +14,14 @@ import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; -import net.osmand.plus.audionotes.AudioVideoNotesPlugin; -import net.osmand.plus.helpers.FileNameTranslationHelper; -import net.osmand.plus.helpers.GpxUiHelper; -import net.osmand.plus.settings.backend.ApplicationMode; -import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; -import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; +import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.GpxUiHelper; +import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.profiles.ProfileIconColors; import net.osmand.plus.profiles.RoutingProfileDataObject.RoutingProfilesResources; @@ -40,7 +36,7 @@ import org.apache.commons.logging.Log; import java.io.File; import java.util.List; -import static net.osmand.plus.settings.backend.backup.FileSettingsItem.*; +import static net.osmand.plus.settings.backend.backup.FileSettingsItem.FileSubtype; public class DuplicatesSettingsAdapter extends RecyclerView.Adapter { @@ -162,11 +158,7 @@ public class DuplicatesSettingsAdapter extends RecyclerView.Adapter voiceFilesList = new ArrayList<>(); List mapFilesList = new ArrayList<>(); List markersGroups = new ArrayList<>(); + List markersHistoryGroups = new ArrayList<>(); for (Object object : duplicatesList) { if (object instanceof ApplicationMode.ApplicationModeBean) { @@ -239,7 +241,12 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment { } else if (object instanceof OpenstreetmapPoint) { osmEditsPointList.add((OpenstreetmapPoint) object); } else if (object instanceof MapMarkersGroup) { - markersGroups.add((MapMarkersGroup) object); + MapMarkersGroup markersGroup = (MapMarkersGroup) object; + if (ExportSettingsType.ACTIVE_MARKERS.name().equals(markersGroup.getId())) { + markersGroups.add(markersGroup); + } else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) { + markersHistoryGroups.add(markersGroup); + } } } if (!profiles.isEmpty()) { @@ -306,6 +313,10 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment { duplicates.add(getString(R.string.map_markers)); duplicates.addAll(markersGroups); } + if (!markersHistoryGroups.isEmpty()) { + duplicates.add(getString(R.string.markers_history)); + duplicates.addAll(markersHistoryGroups); + } return duplicates; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index d7ae7eb77b..48b8e7a6ee 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -41,6 +41,7 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; +import net.osmand.plus.mapmarkers.MapMarker; import net.osmand.plus.mapmarkers.MapMarkersGroup; import net.osmand.plus.osmedit.OpenstreetmapPoint; import net.osmand.plus.osmedit.OsmNotesPoint; @@ -48,20 +49,21 @@ import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.quickaction.QuickAction; import net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean; import net.osmand.plus.settings.backend.ExportSettingsType; +import net.osmand.plus.settings.backend.backup.AvoidRoadsSettingsItem; import net.osmand.plus.settings.backend.backup.FavoritesSettingsItem; +import net.osmand.plus.settings.backend.backup.FileSettingsItem; import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; +import net.osmand.plus.settings.backend.backup.HistoryMarkersSettingsItem; +import net.osmand.plus.settings.backend.backup.MapSourcesSettingsItem; import net.osmand.plus.settings.backend.backup.MarkersSettingsItem; import net.osmand.plus.settings.backend.backup.OsmEditsSettingsItem; import net.osmand.plus.settings.backend.backup.OsmNotesSettingsItem; -import net.osmand.plus.settings.backend.backup.SettingsHelper; -import net.osmand.plus.settings.backend.backup.AvoidRoadsSettingsItem; -import net.osmand.plus.settings.backend.backup.FileSettingsItem; -import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportAsyncTask; -import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportType; -import net.osmand.plus.settings.backend.backup.MapSourcesSettingsItem; import net.osmand.plus.settings.backend.backup.PoiUiFiltersSettingsItem; import net.osmand.plus.settings.backend.backup.ProfileSettingsItem; import net.osmand.plus.settings.backend.backup.QuickActionsSettingsItem; +import net.osmand.plus.settings.backend.backup.SettingsHelper; +import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportAsyncTask; +import net.osmand.plus.settings.backend.backup.SettingsHelper.ImportType; import net.osmand.plus.settings.backend.backup.SettingsItem; import net.osmand.plus.settings.backend.backup.SettingsItemType; import net.osmand.plus.widgets.TextViewEx; @@ -439,6 +441,7 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { List osmEditsPointList = new ArrayList<>(); List favoriteGroups = new ArrayList<>(); List markersGroups = new ArrayList<>(); + List markersHistoryGroups = new ArrayList<>(); for (Object object : data) { if (object instanceof ApplicationModeBean) { appModeBeans.add((ApplicationModeBean) object); @@ -463,7 +466,12 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { } else if (object instanceof GlobalSettingsItem) { settingsItems.add((GlobalSettingsItem) object); } else if (object instanceof MapMarkersGroup) { - markersGroups.add((MapMarkersGroup) object); + MapMarkersGroup markersGroup = (MapMarkersGroup) object; + if (ExportSettingsType.ACTIVE_MARKERS.name().equals(markersGroup.getId())) { + markersGroups.add((MapMarkersGroup) object); + } else if (ExportSettingsType.HISTORY_MARKERS.name().equals(markersGroup.getId())) { + markersHistoryGroups.add((MapMarkersGroup) object); + } } } if (!appModeBeans.isEmpty()) { @@ -496,9 +504,22 @@ public class ImportSettingsFragment extends BaseOsmAndFragment { settingsItems.add(new FavoritesSettingsItem(app, baseItem, favoriteGroups)); } if (!markersGroups.isEmpty()) { - MarkersSettingsItem baseItem = getBaseItem(SettingsItemType.MARKERS, MarkersSettingsItem.class); - settingsItems.add(new MarkersSettingsItem(app, baseItem, markersGroups)); + List mapMarkers = new ArrayList<>(); + for (MapMarkersGroup group : markersGroups) { + mapMarkers.addAll(group.getMarkers()); + } + MarkersSettingsItem baseItem = getBaseItem(SettingsItemType.ACTIVE_MARKERS, MarkersSettingsItem.class); + settingsItems.add(new MarkersSettingsItem(app, baseItem, mapMarkers)); } + if (!markersHistoryGroups.isEmpty()) { + List mapMarkers = new ArrayList<>(); + for (MapMarkersGroup group : markersHistoryGroups) { + mapMarkers.addAll(group.getMarkers()); + } + HistoryMarkersSettingsItem baseItem = getBaseItem(SettingsItemType.HISTORY_MARKERS, HistoryMarkersSettingsItem.class); + settingsItems.add(new HistoryMarkersSettingsItem(app, baseItem, mapMarkers)); + } + return settingsItems; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java index fd8bc5a781..9114c430b9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java @@ -142,10 +142,14 @@ public class ImportedSettingsItemsAdapter extends holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_settings, activeColorRes)); holder.title.setText(R.string.general_settings_2); break; - case MARKERS: + case ACTIVE_MARKERS: holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_flag, activeColorRes)); holder.title.setText(R.string.map_markers); break; + case HISTORY_MARKERS: + holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_flag, activeColorRes)); + holder.title.setText(R.string.markers_history); + break; } } From a6f65b066fd25f71a8647282157790561b606c0a Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Wed, 11 Nov 2020 12:20:22 +0200 Subject: [PATCH 36/47] Refactor: enum, unnecessary method, delete unnecessary files, screen rotate support, null fix, strinf name fix --- OsmAnd/res/layout/send_gpx_fragment.xml | 5 +- OsmAnd/res/layout/send_gpx_osm.xml | 76 ------------------- OsmAnd/res/values/strings.xml | 8 +- .../osmand/plus/activities/EnumAdapter.java | 38 ---------- .../osmand/plus/osmedit/OsmEditingPlugin.java | 26 ++++--- .../plus/osmedit/UploadGPXFilesTask.java | 2 +- .../dialogs/SendGpxBottomSheetFragment.java | 42 +++++----- 7 files changed, 44 insertions(+), 153 deletions(-) delete mode 100644 OsmAnd/res/layout/send_gpx_osm.xml delete mode 100644 OsmAnd/src/net/osmand/plus/activities/EnumAdapter.java diff --git a/OsmAnd/res/layout/send_gpx_fragment.xml b/OsmAnd/res/layout/send_gpx_fragment.xml index 234ccfb9dc..333030a190 100644 --- a/OsmAnd/res/layout/send_gpx_fragment.xml +++ b/OsmAnd/res/layout/send_gpx_fragment.xml @@ -59,7 +59,8 @@ android:id="@+id/tags_field" android:layout_width="match_parent" android:layout_height="wrap_content" - android:imeOptions="actionDone" /> + android:imeOptions="actionDone" + android:text="osmand"/> @@ -98,9 +99,9 @@ android:paddingTop="@dimen/context_menu_first_line_top_margin" android:paddingRight="@dimen/content_padding" android:paddingBottom="@dimen/context_menu_first_line_top_margin" - android:text="@string/gpx_visibility_txt" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" + tools:text="@string/gpx_visibility_txt" osmand:typeface="@string/font_roboto_medium" /> diff --git a/OsmAnd/res/layout/send_gpx_osm.xml b/OsmAnd/res/layout/send_gpx_osm.xml deleted file mode 100644 index 2fd9794b7f..0000000000 --- a/OsmAnd/res/layout/send_gpx_osm.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 8519838557..ffb7b686d8 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,10 +11,10 @@ Thx - Hardy --> - Trackable means that the trace will not show up in any public listings but trackpoints from it will still be available through the public GPS API with timestamps. Other users will only be able to download processed trackpoints from your trace which can\'t be associated with you directly. - Identifiable means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings, i.e. other users will be able to download the raw trace and associate it with your username. Data served via the trackpoints API will reference your original trace page. Timestamps of the trace points are available through the public GPS API. - Private means that the trace will not show up in any public listings, but trackpoints from it will still be available through the public GPS API without timestamps but will not be chronologically ordered. - Public means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings. Data served via the API does not reference your trace page. Timestamps of the trace points are not available through the public GPS API, and the points are not chronologically ordered. However, other users are still able to download the raw trace from the public trace list and any timestamps contained within. + Trackable means that the trace will not show up in any public listings but trackpoints from it will still be available through the public GPS API with timestamps. Other users will only be able to download processed trackpoints from your trace which can\'t be associated with you directly. + Identifiable means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings, i.e. other users will be able to download the raw trace and associate it with your username. Data served via the trackpoints API will reference your original trace page. Timestamps of the trace points are available through the public GPS API. + Private means that the trace will not show up in any public listings, but trackpoints from it will still be available through the public GPS API without timestamps but will not be chronologically ordered. + Public means that the trace will be shown publicly in Your GPS traces and in public GPS trace listings. Data served via the API does not reference your trace page. Timestamps of the trace points are not available through the public GPS API, and the points are not chronologically ordered. However, other users are still able to download the raw trace from the public trace list and any timestamps contained within. Enter tags separated by comma. Send GPX file to OpenStreetMap OsmAnd Live subscription is on hold diff --git a/OsmAnd/src/net/osmand/plus/activities/EnumAdapter.java b/OsmAnd/src/net/osmand/plus/activities/EnumAdapter.java deleted file mode 100644 index 519952b8e3..0000000000 --- a/OsmAnd/src/net/osmand/plus/activities/EnumAdapter.java +++ /dev/null @@ -1,38 +0,0 @@ -package net.osmand.plus.activities; - -import net.osmand.plus.activities.EnumAdapter.IEnumWithResource; -import android.content.Context; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ArrayAdapter; -import android.widget.TextView; - -public class EnumAdapter - extends ArrayAdapter -{ - - public EnumAdapter(Context context, int textViewResourceId, T[] enums) - { - super(context, textViewResourceId, enums); - } - - @Override - public View getDropDownView(int position, View convertView, ViewGroup parent) { - TextView textView = (TextView) super.getDropDownView(position, convertView, parent); - T item = getItem(position); - textView.setText(item.stringResource()); - return textView; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - TextView textView = (TextView) super.getView(position, convertView, parent); - T item = getItem(position); - textView.setText(item.stringResource()); - return textView; - } - - public static interface IEnumWithResource { - int stringResource(); - } -} diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index d8f1ac1423..3b11e7a309 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -30,7 +30,6 @@ import net.osmand.plus.ContextMenuItem; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; -import net.osmand.plus.activities.EnumAdapter.IEnumWithResource; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.TabActivity; import net.osmand.plus.dashboard.DashboardOnMap.DashboardType; @@ -433,16 +432,19 @@ public class OsmEditingPlugin extends OsmandPlugin { } } - public enum UploadVisibility implements IEnumWithResource { - Public(R.string.gpxup_public, R.string.public_visibility), - Identifiable(R.string.gpxup_identifiable, R.string.identifiable_visibility), - Trackable(R.string.gpxup_trackable, R.string.trackable_visibility), - Private(R.string.gpxup_private, R.string.private_visibility); - private final int resourceId; + public enum UploadVisibility { + PUBLIC(R.string.gpxup_public, R.string.gpx_upload_public_visibility_descr), + IDENTIFIABLE(R.string.gpxup_identifiable, R.string.gpx_upload_identifiable_visibility_descr), + TRACKABLE(R.string.gpxup_trackable, R.string.gpx_upload_trackable_visibility_descr), + PRIVATE(R.string.gpxup_private, R.string.gpx_upload_private_visibility_descr); + + @StringRes + private final int titleId; + @StringRes private final int descriptionId; - UploadVisibility(int resourceId,int descriptionId ) { - this.resourceId = resourceId; + UploadVisibility(int titleId, int descriptionId) { + this.titleId = titleId; this.descriptionId = descriptionId; } @@ -450,9 +452,9 @@ public class OsmEditingPlugin extends OsmandPlugin { return name().toLowerCase(); } - @Override - public int stringResource() { - return resourceId; + @StringRes + public int getTitleId() { + return titleId; } @StringRes diff --git a/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java b/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java index c49b49aad0..6f3807609a 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java @@ -22,7 +22,7 @@ public class UploadGPXFilesTask extends AsyncTask { this.la = la; this.description = description; this.tagstring = tagstring; - this.visibility = visibility != null ? visibility.asURLparam() : UploadVisibility.Private.asURLparam(); + this.visibility = visibility != null ? visibility.asURLparam() : UploadVisibility.PRIVATE.asURLparam(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index 6b3476670c..c47f757a92 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -2,7 +2,9 @@ package net.osmand.plus.osmedit.dialogs; import android.os.AsyncTask; import android.os.Bundle; +import android.text.Editable; import android.view.ContextThemeWrapper; +import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; @@ -16,6 +18,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.textfield.TextInputEditText; +import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.base.MenuBottomSheetDialogFragment; @@ -32,13 +35,14 @@ import net.osmand.util.Algorithms; import java.util.ArrayList; import java.util.List; +import java.util.Optional; public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { public static final String TAG = SendGpxBottomSheetFragment.class.getSimpleName(); private GpxInfo[] gpxInfos; - private UploadVisibility selectedUploadVisibility = UploadVisibility.Public; + private UploadVisibility selectedUploadVisibility = UploadVisibility.PUBLIC; private TextInputEditText tagsField; private TextInputEditText messageField; @@ -49,12 +53,14 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { @Override public void createMenuItems(Bundle savedInstanceState) { - View sendOsmPoiView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.send_gpx_fragment, null); + LayoutInflater themedInflater = UiUtilities.getInflater(requireContext(), nightMode); + View sendOsmPoiView = themedInflater.inflate(R.layout.send_gpx_fragment, null); messageField = sendOsmPoiView.findViewById(R.id.message_field); tagsField = sendOsmPoiView.findViewById(R.id.tags_field); - OsmandSettings settings = requiredMyApplication().getSettings(); + OsmandApplication app = requiredMyApplication(); + OsmandSettings settings = app.getSettings(); TextView accountName = sendOsmPoiView.findViewById(R.id.user_name); if (!Algorithms.isEmpty(settings.USER_DISPLAY_NAME.get())) { @@ -63,32 +69,29 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { accountName.setText(settings.USER_NAME.get()); } - if (gpxInfos.length > 0 && gpxInfos[0].getFileName() != null) { - int dt = gpxInfos[0].getFileName().indexOf('.'); - messageField.setText(gpxInfos[0].getFileName().substring(0, dt)); - } - tagsField.setText(R.string.app_name_osmand); + String fileName = gpxInfos[0].getFileName(); + messageField.setText(Algorithms.getFileNameWithoutExtension(fileName)); final TextView visibilityName = sendOsmPoiView.findViewById(R.id.visibility_name); final TextView visibilityDescription = sendOsmPoiView.findViewById(R.id.visibility_description); - visibilityName.setText(selectedUploadVisibility.stringResource()); + visibilityName.setText(selectedUploadVisibility.getTitleId()); visibilityDescription.setText(selectedUploadVisibility.getDescriptionId()); List itemsVisibility = new ArrayList<>(); for (UploadVisibility visibilityType : UploadVisibility.values()) { - String title = getString(visibilityType.stringResource()); + String title = getString(visibilityType.getTitleId()); HorizontalSelectionItem item = new HorizontalSelectionAdapter.HorizontalSelectionItem(title, visibilityType); itemsVisibility.add(item); } - final HorizontalSelectionAdapter horizontalSelectionAdapter = new HorizontalSelectionAdapter(getMyApplication(), nightMode); + final HorizontalSelectionAdapter horizontalSelectionAdapter = new HorizontalSelectionAdapter(app, nightMode); horizontalSelectionAdapter.setItems(itemsVisibility); - horizontalSelectionAdapter.setSelectedItemByTitle(getString(selectedUploadVisibility.stringResource())); + horizontalSelectionAdapter.setSelectedItemByTitle(getString(selectedUploadVisibility.getTitleId())); horizontalSelectionAdapter.setListener(new HorizontalSelectionAdapterListener() { @Override public void onItemSelected(HorizontalSelectionAdapter.HorizontalSelectionItem item) { selectedUploadVisibility = (OsmEditingPlugin.UploadVisibility) item.getObject(); - visibilityName.setText(selectedUploadVisibility.stringResource()); + visibilityName.setText(selectedUploadVisibility.getTitleId()); visibilityDescription.setText(selectedUploadVisibility.getDescriptionId()); horizontalSelectionAdapter.notifyDataSetChanged(); } @@ -97,17 +100,14 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { RecyclerView iconCategoriesRecyclerView = sendOsmPoiView.findViewById(R.id.description_view); iconCategoriesRecyclerView.setAdapter(horizontalSelectionAdapter); - iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(getMyApplication(), RecyclerView.HORIZONTAL, false)); + iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false)); horizontalSelectionAdapter.notifyDataSetChanged(); SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder() .setCustomView(sendOsmPoiView) .create(); items.add(titleItem); - } - - private boolean isLoginOAuth() { - return !Algorithms.isEmpty(getMyApplication().getSettings().USER_DISPLAY_NAME.get()); + setRetainInstance(true); } @Override @@ -124,8 +124,10 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { protected void onRightBottomButtonClick() { FragmentActivity activity = getActivity(); if (activity != null) { - String tags = tagsField.getText().toString(); - String descr = messageField.getText().toString(); + Editable tagsText = tagsField.getText(); + Editable descrText = messageField.getText(); + String tags = tagsText != null ? tagsText.toString() : ""; + String descr = descrText != null ? descrText.toString() : ""; UploadGPXFilesTask uploadGPXFilesTask = new UploadGPXFilesTask(activity, descr, tags, selectedUploadVisibility); uploadGPXFilesTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, gpxInfos); From ec8e778b6a6387ea1c0b322a63a5da9e6c7c0d8c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 11 Nov 2020 16:48:43 +0200 Subject: [PATCH 37/47] Small fixes in send gpx task --- OsmAnd/res/layout/send_gpx_fragment.xml | 14 +++--- .../plus/osmedit/UploadGPXFilesTask.java | 49 ++++++++++++------- .../dialogs/SendGpxBottomSheetFragment.java | 21 ++++---- 3 files changed, 48 insertions(+), 36 deletions(-) diff --git a/OsmAnd/res/layout/send_gpx_fragment.xml b/OsmAnd/res/layout/send_gpx_fragment.xml index 333030a190..5e7edddd7b 100644 --- a/OsmAnd/res/layout/send_gpx_fragment.xml +++ b/OsmAnd/res/layout/send_gpx_fragment.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" - android:layout_width="fill_parent" + android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> @@ -27,7 +27,6 @@ android:textSize="@dimen/default_list_text_size" osmand:typeface="@string/font_roboto_medium" /> - + + android:text="osmand" /> + @@ -101,8 +102,9 @@ android:paddingBottom="@dimen/context_menu_first_line_top_margin" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" - tools:text="@string/gpx_visibility_txt" - osmand:typeface="@string/font_roboto_medium" /> + osmand:typeface="@string/font_roboto_medium" + tools:text="@string/gpx_visibility_txt" /> + - + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java b/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java index 6f3807609a..7ef392acf9 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/UploadGPXFilesTask.java @@ -1,29 +1,36 @@ package net.osmand.plus.osmedit; -import java.io.File; +import android.app.Activity; +import android.os.AsyncTask; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import net.osmand.AndroidUtils; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo; import net.osmand.plus.osmedit.OsmEditingPlugin.UploadVisibility; -import android.app.Activity; -import android.os.AsyncTask; -import android.widget.Toast; + +import java.io.File; +import java.lang.ref.WeakReference; public class UploadGPXFilesTask extends AsyncTask { + private final OsmandApplication app; + private final WeakReference activityRef; + private final String visibility; private final String description; private final String tagstring; - private Activity la; - public UploadGPXFilesTask(Activity la, - String description, String tagstring, UploadVisibility visibility) { - this.la = la; + public UploadGPXFilesTask(@NonNull Activity activity, String description, String tagsString, + @Nullable UploadVisibility visibility) { + app = (OsmandApplication) activity.getApplication(); + this.activityRef = new WeakReference<>(activity); this.description = description; - this.tagstring = tagstring; + this.tagstring = tagsString; this.visibility = visibility != null ? visibility.asURLparam() : UploadVisibility.PRIVATE.asURLparam(); - } @Override @@ -32,10 +39,9 @@ public class UploadGPXFilesTask extends AsyncTask { int total = 0; for (GpxInfo info : params) { if (!isCancelled() && info.file != null) { - String warning = null; File file = info.file; - warning = new OpenstreetmapRemoteUtil((OsmandApplication) la.getApplication()).uploadGPXFile(tagstring, description, visibility, - file); + OpenstreetmapRemoteUtil remoteUtil = new OpenstreetmapRemoteUtil(app); + String warning = remoteUtil.uploadGPXFile(tagstring, description, visibility, file); total++; if (warning == null) { count++; @@ -44,7 +50,7 @@ public class UploadGPXFilesTask extends AsyncTask { } } } - return la.getString(R.string.local_index_items_uploaded, count, total); + return app.getString(R.string.local_index_items_uploaded, count, total); } @Override @@ -57,19 +63,24 @@ public class UploadGPXFilesTask extends AsyncTask { } b.append(values[i]); } - Toast.makeText(la, b.toString(), Toast.LENGTH_LONG).show(); + app.showToastMessage(b.toString()); } } @Override protected void onPreExecute() { - la.setProgressBarIndeterminateVisibility(true); + Activity activity = activityRef.get(); + if (AndroidUtils.isActivityNotDestroyed(activity)) { + activity.setProgressBarIndeterminateVisibility(true); + } } @Override protected void onPostExecute(String result) { - la.setProgressBarIndeterminateVisibility(false); - Toast.makeText(la, result, Toast.LENGTH_LONG).show(); + Activity activity = activityRef.get(); + if (AndroidUtils.isActivityNotDestroyed(activity)) { + activity.setProgressBarIndeterminateVisibility(false); + } + app.showToastMessage(result); } - } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java index c47f757a92..f9e8e6d00a 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/SendGpxBottomSheetFragment.java @@ -3,7 +3,6 @@ package net.osmand.plus.osmedit.dialogs; import android.os.AsyncTask; import android.os.Bundle; import android.text.Editable; -import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; @@ -21,6 +20,7 @@ import com.google.android.material.textfield.TextInputEditText; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; +import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; @@ -35,7 +35,6 @@ import net.osmand.util.Algorithms; import java.util.ArrayList; import java.util.List; -import java.util.Optional; public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { @@ -53,15 +52,15 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { @Override public void createMenuItems(Bundle savedInstanceState) { - LayoutInflater themedInflater = UiUtilities.getInflater(requireContext(), nightMode); - View sendOsmPoiView = themedInflater.inflate(R.layout.send_gpx_fragment, null); - - messageField = sendOsmPoiView.findViewById(R.id.message_field); - tagsField = sendOsmPoiView.findViewById(R.id.tags_field); - OsmandApplication app = requiredMyApplication(); OsmandSettings settings = app.getSettings(); + LayoutInflater themedInflater = UiUtilities.getInflater(app, nightMode); + View sendOsmPoiView = themedInflater.inflate(R.layout.send_gpx_fragment, null); + + tagsField = sendOsmPoiView.findViewById(R.id.tags_field); + messageField = sendOsmPoiView.findViewById(R.id.message_field); + TextView accountName = sendOsmPoiView.findViewById(R.id.user_name); if (!Algorithms.isEmpty(settings.USER_DISPLAY_NAME.get())) { accountName.setText(settings.USER_DISPLAY_NAME.get()); @@ -107,12 +106,11 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { .setCustomView(sendOsmPoiView) .create(); items.add(titleItem); - setRetainInstance(true); } @Override - protected UiUtilities.DialogButtonType getRightBottomButtonType() { - return (UiUtilities.DialogButtonType.PRIMARY); + protected DialogButtonType getRightBottomButtonType() { + return DialogButtonType.PRIMARY; } @Override @@ -140,6 +138,7 @@ public class SendGpxBottomSheetFragment extends MenuBottomSheetDialogFragment { SendGpxBottomSheetFragment fragment = new SendGpxBottomSheetFragment(); fragment.setTargetFragment(targetFragment, 0); fragment.setGpxInfos(info); + fragment.setRetainInstance(true); fragment.show(fragmentManager, TAG); } } From 287f01737e43dfa0feb2c1756d91a283aac955e4 Mon Sep 17 00:00:00 2001 From: ssantos Date: Wed, 11 Nov 2020 12:21:48 +0000 Subject: [PATCH 38/47] Translated using Weblate (Portuguese) Currently translated at 100.0% (3537 of 3537 strings) --- OsmAnd/res/values-pt/strings.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 4c09d5f26f..6bb28cfe09 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -269,7 +269,7 @@ Concluído Utilize a Internet para calcular uma rota. Utilizar navegação online - A sua palavra-passe no OSM + Palavra-passe Especifique as configurações de OpenStreetMap.org (OSM) necessárias para envios ao OSM. Especifique o idioma, descarregar/enviar dados. Dados @@ -3566,9 +3566,9 @@ Verifique e compartilhe registos detalhados da app Ícone mostrado em repouso. Ícone mostrado ao navegar ou mover. - Pode ver todos os erros de OSM do editor carregado em %1$s. Os pontos enviados não são exibidos no OsmAnd. + Pode ver todas as suas edições descarregadas ou bugs OSM em %1$s. Pontos enviados não aparecem no OsmAnd. Edição OSM - Essas configurações aplicam-se a todos os perfis. + Estas configurações de extensão são globais e aplicam-se a todos os perfis Utilizador e palavra-passe Anunciar Recálculo da rota @@ -3955,4 +3955,13 @@ A assinatura do OsmAnd Live expirou A assinatura do OsmAnd Live foi pausada A assinatura do OsmAnd Live está em espera + Precisa fazer login para enviar alterações novas ou modificadas. +\n +\nPode entrar a usar o método seguro OAuth ou usar o seu nome de utilizador e a sua palavra-passe. + Fazer login ao OpenStreetMap + Entrar com OpenStreetMap.org + Entrar com OpenStreetMap + Usar nome do utilizador e palavra-passe + Conta + Entrar \ No newline at end of file From eb7c7f1bd70e5877cd9dff168925313c1e012152 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Wed, 11 Nov 2020 12:16:36 +0000 Subject: [PATCH 39/47] Translated using Weblate (French) Currently translated at 99.9% (3534 of 3537 strings) --- OsmAnd/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 21bd7fbc55..debdabd062 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3406,7 +3406,7 @@ Recalcul de l\'itinéraire Annonce Nom d\'utilisateur et mot de passe - Ces paramètres s\'appliquent à tous les profils. + Les paramètres du greffon sont globaux et s\'appliquent à tous les profils. Édition OSM Vous pouvez consulter vos modifications non téléversées comme vos bugs OSM dans %1$s. Les points envoyés ne sont plus affichés dans OsmAnd. OSM From 0b2e2e87f928e7b46ddb1590a2f9cdc879ae46fb Mon Sep 17 00:00:00 2001 From: Athoss Date: Wed, 11 Nov 2020 13:55:01 +0000 Subject: [PATCH 40/47] Translated using Weblate (Hungarian) Currently translated at 99.6% (3525 of 3537 strings) --- OsmAnd/res/values-hu/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 59663098d2..007f5b576c 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -114,7 +114,7 @@ Globális beállítások az alkalmazáshoz OSM felhasználóneved Az openstreetmap.org felé történő adatküldéshez szükséges. - OSM jelszavad + Jelszó Háttérmód Az OsmAnd háttérben fut kikapcsolt kijelzővel. Erre a területre letölthet offline vektoros térképet a Beállításokban (Térképfájlok kezelése), vagy váltson át az Online térképek bővítményre. @@ -3420,7 +3420,7 @@ Útvonal újraszámítása Bejelentés Felhasználónév és jelszó - Ezek a beállítások minden profilra vonatkoznak. + Ezek a bővítménybeállítások globálisak, és minden profilra vonatkoznak OSM-szerkesztés Az összes még fel nem töltött szerkesztés vagy OSM-hiba megtalálható a %1$s helyen. A már feltöltött pontok nem láthatók az OsmAndban. OSM From 8527f9eb343dc86e2fbf3e10d21dc62b38c2f900 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Wed, 11 Nov 2020 12:52:14 +0000 Subject: [PATCH 41/47] Translated using Weblate (Hebrew) Currently translated at 99.9% (3534 of 3537 strings) --- OsmAnd/res/values-iw/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 9fe092ba76..2c978cb344 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -3961,4 +3961,9 @@ ניהול מינוי תוקף המינוי ל־OsmAnd Live פג המינוי ל־OsmAnd Live הושהה + עליך להיכנס כדי להעלות דברים חדשים או כאלו ששינית. +\n +\nניתן להיכנס בשיטת OAuth המאובטחת או להשתמש בשם הכניסה והססמה שלך. + יש בעיה עם המינוי שלך. יש ללחוץ על הכפתור כדי לגשת להגדרות המינוי של Google Play ולתקן את שיטת התשלום שלך. + המינוי ל־OsmAnd Live מוחזק \ No newline at end of file From 24ed49b282be0e572d997ae844c6c47cb5108069 Mon Sep 17 00:00:00 2001 From: Michal L Date: Wed, 11 Nov 2020 11:08:45 +0000 Subject: [PATCH 42/47] Translated using Weblate (Polish) Currently translated at 99.6% (3524 of 3537 strings) --- OsmAnd/res/values-pl/strings.xml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 49300cabce..67afa977f2 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -127,7 +127,7 @@ Systemowy Wybiera język interfejsu (po zmianie należy uruchomić OsmAnd ponownie). Język interfejsu - Naprzód + Dalej Poprzedni Zmienia jednostki długości. Jednostki długości @@ -422,7 +422,7 @@ Zakończono Użyj Internetu do wyznaczenia trasy. Użyj nawigacji online - Hasło konta OSM + Hasło Skonfiguruj ustawienia potrzebne do wysyłania danych do Openstreetmap.org (OSM). Ustaw język, pobierz/wczytaj ponownie dane. Dane @@ -3426,7 +3426,7 @@ Ponowne wyliczenie trasy Zapowiedź Nazwa użytkownika i hasło - Te ustawienia mają zastosowanie do wszystkich profilów. + Ustawienia tej wtyczki są globalne i dotyczą wszystkich profili Edycja OSM OSM Ikona wyświetlana podczas nawigacji lub ruchu. @@ -3549,7 +3549,7 @@ Szybka czynność Zatrzymaj oba Styl renderowania - Zobacz swoje zmiany lub błędy OSM, które nie zostały jeszcze przesłane w %1$s. Przesłane punkty nie będą już wyświetlane. + Możesz zobaczyć wszystkie nieopublikowane edycje lub błędy OSM w %1$s. Przesłane punkty nie są wyświetlane w OsmAnd. Importowanie pliku renderowania Przywrócić wszystkie ustawienia profilu\? Zapisywanie nowego profilu @@ -3813,7 +3813,7 @@ Wybierz szerokość Wybierz żądaną opcję podziału: według czasu lub odległości. Stałe - OsmAnd GPX nie jest dobrze uformowany, prosimy o kontakt z zespołem wsparcia technicznego w celu dalszego zbadania sprawy. + Plik OsmAnd GPX nie jest poprawnie skonstruowany, prosimy o kontakt z zespołem wsparcia technicznego w celu dalszego zbadania sprawy. Wybierz limit czasu ekranu po przebudzeniu. (\"%1$s\" nie powoduje przekroczenia limitu czasu.) Pokaż ikony początku i końca Wybierz przedział czasowy, w którym będą wyświetlane znaki z odległością lub czasem na torze. @@ -3958,4 +3958,13 @@ Należy dodać co najmniej dwa punkty. Wystąpił problem z Twoją subskrypcją. Kliknij przycisk, aby przejść do ustawień subskrypcji Google Play i naprawić metodę płatności. Subskrypcja OsmAnd Live jest wstrzymana + Login + Zaloguj się do OpenStreetMap + Zaloguj się do OpenStreetMap.org + Zaloguj się za pomocą OpenStreetMap + Musisz się zalogować, aby przesłać nowe lub zmodyfikowane zmiany. +\n +\nMożesz zalogować się za pomocą bezpiecznej metody autoryzacji OAuth lub użyć swojego loginu i hasła. + Użyj loginu i hasła + Konto \ No newline at end of file From 2404a1897b3907b17507db09fa86d20db5d33f53 Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Wed, 11 Nov 2020 08:45:26 +0000 Subject: [PATCH 43/47] Translated using Weblate (Arabic) Currently translated at 100.0% (3537 of 3537 strings) --- OsmAnd/res/values-ar/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 68aee33373..76ee8ba0cd 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3940,4 +3940,13 @@ انتهت صلاحية اشتراك OsmAnd Live تم إيقاف اشتراك OsmAnd Live مؤقتًا اشتراك OsmAnd Live معلق + تسجيل الدخول إلى خريطة الشارع المفتوح + تسجيل الدخول إلى OpenStreetMap.org + تسجيل الخروج + تحتاج إلى تسجيل الدخول لرفع التغييرات الجديدة أو المعدلة. +\n +\nيمكنك تسجيل الدخول باستخدام طريقة التفويض الآمنة أو استخدام تسجيل الدخول وكلمة المرور. + استخدام تسجيل الدخول وكلمة المرور + الحساب + تسجيل الدخول \ No newline at end of file From f9e4bf5ab2c10a086e02580114f95fa9fe9ef93f Mon Sep 17 00:00:00 2001 From: Ammuu5 Date: Wed, 11 Nov 2020 05:54:08 +0000 Subject: [PATCH 44/47] Translated using Weblate (Finnish) Currently translated at 60.8% (2154 of 3537 strings) --- OsmAnd/res/values-fi/strings.xml | 77 +++++++++++++++++++------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/OsmAnd/res/values-fi/strings.xml b/OsmAnd/res/values-fi/strings.xml index c848f4392b..4cd281d671 100644 --- a/OsmAnd/res/values-fi/strings.xml +++ b/OsmAnd/res/values-fi/strings.xml @@ -174,7 +174,8 @@ Tarvitaan openstreetmap.org ehdotuksia varten OSM salasanasi Ei ole tarpeeksi tilaa jotta voitaisiin ladata %1$s MB (vapaana: %2$s). - Lataa {0} tiedosto(a)\? {1} Mt (/ {2} Mt) käytetään. + Lataa {0} tiedosto(a)\? +\n{1} Mt (/ {2} Mt) käytetään. Poista %1$s? Lähiö Kylä @@ -315,7 +316,7 @@ Virhe reitin laskennassa Uusi reitti laskettu, etäisyys Olet saapunut perille. - Koordinaatit ovat virheelliset! + Virheelliset koordinaatit Sulje Ladataan tietoja… Luetaan paikallista dataa… @@ -510,7 +511,7 @@ Paikallinen versio Poista {0} (lisää kommentti)? Tekijän nimi - "Tiet " + Vain tiet Tavalliset kartat Rakennuksia ei löytynyt. Etsi lisää paikkakuntia/postinumeroita @@ -579,7 +580,7 @@ Nauhoitus %1$s %2$s / %3$s Kohde %1$s Valitse määränpääksi - Valitse kaupunki tai katu ensin + Aseta kaupunki tai katu ensin Etsi katua lähikaupungeista Lajittele ovelta ovelle OSM muutostiedosto luotiin onnistuneesti %1$s @@ -608,8 +609,8 @@ Japani Yhdysvallat Kanada - Eurooppa & Aasia - Iso Britannia, Intia, Australia ja vastaavat + Eurooppa, Aasia, Latinalainen Amerikka ja vastaavat + Iso Britannia, Intia ja vastaavat Merimerkki Valitse näkyvät profiilit. Avoinna nyt @@ -730,7 +731,7 @@ Käy ennen Simuloi sijaintisi Lev %1$s -Pit %2$s +\nPit %2$s Usein kysytyt kysymykset, viimeaikaiset muutokset, ja muut. Yleiset asetukset @@ -824,7 +825,7 @@ Maailmanlaajuiset tiedot (välillä 70 astetta pohjoista ja 70 astetta eteläist Reitin laskenta Sinulla ei ole vielä yhtään GPX-tiedostoa Voit myös lisätä GPX-tiedostoja hakemistoon - Lisää jälki + Lisää enemmän… Ulkoasu Ota pikanauhoitus käyttöön Näytä ilmoitus, josta voi aloittaa matkan tallennuksen painamalla Nauhoita-näppäintä. @@ -1008,7 +1009,9 @@ Maailmanlaajuiset tiedot (välillä 70 astetta pohjoista ja 70 astetta eteläist \n- hallita ryhmiä ja laitteita henkilökohtaisella hallintapaneelilla websivustolla. Muokkauksia %1$s, sijoitus %2$s, muokkaukset yhteensä %3$s OSM-muokkaajien sijoitukset - Tilaa ei ole tarpeeksi! {3} Mt tarvitaan väliaikaisesti, {1} Mt pysyvästi. (Vain {2} Mt on käytettävissä.) + Tilaa ei ole tarpeeksi! +\n{3} Mt tarvitaan väliaikaisesti, {1} Mt pysyvästi. +\n(Vain {2} Mt on käytettävissä.) Lataa {0} tiedosto(a)? Tallennnustilaa käytetään {3} Mt hetkellisesti, {1} Mt pysyvästi. (Vapaata tilaa on {2} Mt.) @@ -1058,7 +1061,7 @@ Maailmanlaajuiset tiedot (välillä 70 astetta pohjoista ja 70 astetta eteläist Korkein laatu Video tulosteen laatu Valitse videon laatu. - "Ääni tulosteen laatu" + Ääni tulosteen laatu Valitse äänilähdön muoto. Ole hyvä ja valitse oikea KP tyyppi tai ohita se. Valikkonäppäin käynnistää hallintapaneelin eikä valikkoa @@ -1179,8 +1182,8 @@ Maailmanlaajuiset tiedot (välillä 70 astetta pohjoista ja 70 astetta eteläist OSM muokkaus Jaa huomautus Sijainti: - Lat %1$s - Lon %2$s +\nLev %1$s +\nPit %2$s Katso Online kartta Laskettelurinteet @@ -1388,10 +1391,10 @@ Maailmanlaajuiset tiedot (välillä 70 astetta pohjoista ja 70 astetta eteläist AIkajänne: %1$s Aika liikkeessä: %1$s Segmentti - " %1$s pistettä" + %1$s pistettä Piste %1$s - %1$s -Reitin pisteet %2$s + %1$s +\nReitin pisteet %2$s %1$s \nPisteet %1$s @@ -1444,10 +1447,10 @@ Reitin pisteet %2$s OsmAnd kartat & suunnistus OsmAnd+ kartat ja suunnistus Suorita - sovellutus taustalla +\nsovellus taustalla Karttatyyli Pysäytä - sovellutuksen suoritus taustalta +\nsovelluksen suoritus taustalta Pienoisreittikartta Aseta virkistyksen aikaväli: Aseta nopeus reitin simuloinnille @@ -1472,7 +1475,7 @@ Reitin pisteet %2$s Aikaisin Normaali Myöhään - "Viime metreillä" + Viime metreillä Saapumisilmoitus Kuinka aikaisin haluat saapumisilmoituksen? Ei tarpeeksi prosessointimuistia valitun alueen näyttämiseksi @@ -1537,7 +1540,7 @@ Reitin pisteet %2$s Sovellusprofiilit Retkeily Olet poistamassa %1$d OSM muutosta. Oletko varma? - "Kartta: " + Kartta: Pit %1$.3f, lev %2$.3f Päämäärä Kautta: @@ -1645,12 +1648,12 @@ Reitin pisteet %2$s Ladataan %1$s… Aika nyt Väyläpiste - "Väyläpisteet: %1$s " - "Etäisyys: %1$s (%2$s pistettä) " - "Lähtöaika: %1$tF, %1$tT " - "Saapumisaika: %1$tF, %1$tT " - "Keskinopeus: %1$s " - "Maksiminopeus: %1$s " + Väyläpisteet: %1$s + Etäisyys: %1$s (%2$s pistettä) + Lähtöaika: %1$tF, %1$tT + Saapumisaika: %1$tF, %1$tT + Keskinopeus: %1$s + Maksiminopeus: %1$s Keskikorkeus: %1$s Korkeusväli: %1$s Kiina @@ -1718,9 +1721,9 @@ Reitin pisteet %2$s Aseta tekstin koko kartalle. OsmAnd taustapalvelu on vielä suorituksessa. Haluatko puysäyttää myös sen? Jäljen kirjaus tarpeen vaatiessa - - -Paina ja pidä nähdäksesi kartalla + " +\n +\nPaina pitkään nähdäksesi kartalla" Paina ja pidä nähdäksesi kartalla @@ -1760,7 +1763,7 @@ Paina ja pidä nähdäksesi kartalla Keskeytä musiikki täydellisesti ääniohjeiden ajaksi (ei ainoastaan hiljennystä) Toinen käännös Sovelluksen varaama natiivi muisti yhteensä %1$s MB (Dalvik %2$s MB, muut %3$s MB). - Suhteellinen muisti %4$s MB (Android raja %5$s MB, Dalvik %6$s MB). +\nSuhteellinen muisti %4$s MB (Android raja %5$s MB, Dalvik %6$s MB). Tee kaikki maankäyttäominaisuudet läpikuultaviksi kartalla. Sivuittain (8 sektoria) Valitse tyyli ilmaistaksesi suhteelliset suunnat liikuttaessa @@ -1846,7 +1849,7 @@ Jos pidät OsmAndista ja OSMsta ja haluat tukea niitä, on tämä täydellinen t epätäydellinen Jaa sijainti käyttäen Sijainti: %1$s -%2$s +\n%2$s GPX väyläpiste \'\'{0}\'\' lisätty Lisää väyläpiste tallennettuun GPX jälkeen Hallinnollinen @@ -1881,7 +1884,7 @@ Jos pidät OsmAndista ja OSMsta ja haluat tukea niitä, on tämä täydellinen t Vieminen epäonnistui Viety {0}/{1} Offline Kartat -& Suunnistus +\n& Suunnistus Vain tiet-karttaa ei tarvita, koska sinulla on jo vakio (täysi) kartta. Ladataanko se silti\? @@ -2545,7 +2548,7 @@ Jos pidät OsmAndista ja OSMsta ja haluat tukea niitä, on tämä täydellinen t Sädeviivain Ei tuettu toiminto %1$s Matkailu (Wikivoyage ja Wikipedia) - "Valitse reitti tiedosto " + Valitse reitti tiedosto Lisäkarttoja tarvitaan Wikipedian erikoiskohteiden tarkastelemiseen kartalla. Valitse kielet, joilla Wikipedia-artikkelit näkyvät kartalla. Voit vaihtaa kaikkien käytettävissä olevien kielten välillä lukiessasi artikkelia. Jotkut Wikipedia-artikkelit eivät välttämättä ole saatavilla omalla kielelläsi. @@ -2560,4 +2563,14 @@ Jos pidät OsmAndista ja OSMsta ja haluat tukea niitä, on tämä täydellinen t Ei voitu lukea \'%1$s\'. Ei voitu kirjoittaa \'%1$s\'. Ei voitu tuoda kohteesta \'%1$s\'. + Päivää + Päivää + Päivä + Viikkoa + Viikkoa + Viikko + Suuntima + Suunnittele reitti + Viimeksi muokattu + Luo uusi reitti \ No newline at end of file From d6393d2f9a42813d86926988e464f0c0e2586eec Mon Sep 17 00:00:00 2001 From: Ammuu5 Date: Wed, 11 Nov 2020 04:57:41 +0000 Subject: [PATCH 45/47] Translated using Weblate (Finnish) Currently translated at 39.2% (1504 of 3830 strings) --- OsmAnd/res/values-fi/phrases.xml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/OsmAnd/res/values-fi/phrases.xml b/OsmAnd/res/values-fi/phrases.xml index 1f7d639c51..002a995140 100644 --- a/OsmAnd/res/values-fi/phrases.xml +++ b/OsmAnd/res/values-fi/phrases.xml @@ -1494,4 +1494,32 @@ Suurlähetystö Siilo Tuulimylly + Tasoristeys + Rautatien ylitys + Liikennevaloilla + Valtatien ylitys + Rakennuksen tyyppi: pyramidi + Rakennuksen tyyppi: pyhäkkö + Rakennuksen tyyppi: synagoga + Rakennuksen tyyppi: basilika + Rakennuksen tyyppi: luostari + Rakennuksen tyyppi: katedraali + Rakennuksen tyyppi: temppeli + Rakennuksen tyyppi: moskeija + Rakennuksen tyyppi: kappeli + Rakennuksen tyyppi: kirkko + Rakennus + Näköalapaikka + Latausasema + Venesatama + Nuotiopaikka + Urheilurata + Koirapuisto + Urheilukenttä + Pakanuus + Jainalaisuus + Alppimaja + Vieras talo + Majapaikka + Vuoristorata \ No newline at end of file From 04560187fdc55c40ae47f7cf20072b1279d4608f Mon Sep 17 00:00:00 2001 From: abdullah abdulrhman Date: Wed, 11 Nov 2020 11:00:31 +0000 Subject: [PATCH 46/47] Translated using Weblate (Arabic) Currently translated at 45.4% (1742 of 3830 strings) --- OsmAnd/res/values-ar/phrases.xml | 139 ++++++++++++++++++++++++------- 1 file changed, 108 insertions(+), 31 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index 9fe161678e..691a54e02e 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -123,7 +123,7 @@ خراطيش الطابعة بطاريات سيارات سيارات - موقع خاص للقوافل + موقع خاص للمقطورات الإسم الدولي الإسم الوطني الإسم الإقليمي @@ -264,11 +264,11 @@ باب مدينة محكمة مطعم - مكان للعبادة + مكان عبادة حكومة مبنى حلاق - مرحاض; حمام + دورة مياة; حمام مطب قوي ممر الراجلين مكتب بريد @@ -314,7 +314,7 @@ نفق مياه نفق ممر الراجلين نفق سكك حديدية - وادي + نهر خياط تقاطع الطريق السريع توقف الترام @@ -695,7 +695,7 @@ رافعة سجاد منجد صانع ساعات - بناء إطار النوافذ + بناء النوافذ إدارة الجنائز تركيب الحواسيب صالون تجميل @@ -704,13 +704,13 @@ صالون وشم التنظيف الجاف غسيل الملابس - تأجير السيارات + تأجير سيارات مشاركة السيارات مشاركة القوارب دش بيت دعارة منطقة للتدخين - مشرحة + ثلاجة الموتى محرقة صراف آلي قرض المال @@ -724,7 +724,7 @@ قمة نهر جليدي شلال - تيار + مجرى مائي منحدر نهر حجر تذكاري شاطئ @@ -746,7 +746,7 @@ محفل ماسوني نادي الإبحار نادي الكشافة - حديقة ثلجية + حديقة الثلج تزلج على الجليد استئجار لوازم التزلج مركز الفنون @@ -768,7 +768,7 @@ حديقة مائية منتزه أرض للترفيه - أكل خفيف + وجبات سريعة منزلق مائي سكن بيت ضيافة @@ -814,8 +814,8 @@ محطة المطار بوابة الصعود نادي الفنون - نادي علم الفلك - نادي الإعلام الآلي + نادي فلكي + نادي الكمبيوتر نادي الدراجات النارية نادي للرياضة نادي للألعاب @@ -829,23 +829,23 @@ مبلط حفرة ماء - الأراضي الرطبة + أراضي رطبة خشب و غابة شجرة - حضيرة طبيعية محمية + محمية طبيعية جزيرة جزيرة صغيرة مرسى - منارة المياه المأمونة - منارة ﻷغراض خاصة + منارة المياه الآمنة + منارة خاصة علامة المسافة مرفق الحرف الصغيرة ثكنة عسكرية منطقة خطرة موقع انفجار نووي ويكيبيديا - ويكي بالإنجليزية - ويكي بالعربية + ويكي بالإنجليزي + ويكي بالعربي ويكي بالبلاروسية ويكي البلغارية ويكي الكاتالونية @@ -925,9 +925,9 @@ ساعة وكيل سفر موقع تخييم - موقع نزهة + موقع تنزه ينبوع ساخن - مقبرة + مقبرة داخل الكنيسة قبر مأوى منتجع @@ -939,28 +939,28 @@ ملعب للأطفال حانة حانة - مياه الشرب + مياه شرب الشواء محركات زراعية صانع السلال - النحال + نحال حداد مصنع الجعة ساعاتي - خياطة + خياط كهربائي - البستاني - الحرف اليدوية - التدفئة والتهوية وتكييف الهواء - العزل - تاجر المجوهرات + بستاني + حرف يدوية + تدفئة، تهوية، تكييف + عزل + صائغ مجوهرات مختبر التصوير الفوتوغرافي حرفة الفخار منارة - إشارة الضباب + إشارة ضباب حوض الميناء - الميناء - محطة إشارة، وتحذير + ميناء + محطة إشارة، تحذير وقود السفن العسكرية ويكي الشيشان ويكي الأردية @@ -1678,4 +1678,81 @@ نوع 2 مخرج combo حديقه حوض سمك + ويكي أفريقيا + النرويجية نينورسك ويكي + ويكي نيوار + النطاق العسكري + العرض المسموح به + الارتفاع المسموح به (مفتوح) + الارتفاع المسموح به (مغلق) + الارتفاع المسموح به، علامة بحرية + حطام, علامة بحريّة + صخرة, علامة بحريّة + علامة علوية، علامة بحرية + محطة إشارة، حركة المرور + محطة إذاعية، علامة مائية + جهاز إرسال واستقبال راداري، علامة بحرية + كومة + إشعار، علامة مائية + حوض مقفول + رباط + ضوء السفينة ، علامة مائية + عوامة منيرة، علامة مائية + ضوء رئيسي، علامة البحر + ضوء رئيسي، علامة البحر + ضوء, علامة بحريّة + علامة + رصيف عائم + حاجز علامة البحر + حوض جاف + علامة النهار + عوامة الأغراض الخاصة + عوامة جانبية + عوامة ، خطر معزول + عوامة التثبيت + جسر اتجاهات البحر + مبنى اتجاهات البحر + عوامة الاتجاهات + رصيف Berth + منارة جانبية + منارة الكاردينال + مرساة مرسى + مضيق + وادي + رأس (بحري) + محطة دفع + صراف آلي ATM + ساونا + خط مقطوع في الغابة + رصيف + مكان استلام السيارات + سمكري + مسح + صانع حامي الشمس + بَناء + سقالات + منشرة + صانع الشراع + صانع السرج + سقاف + ريجر + جصاص + طبقة الباركيه + دهان + أخصائي بصريات + حرفة الصناعات المعدنية + ناسخ مفاتيح + صانع ومصلح المفاتيح + زجاج + سجاد وموكيت + تجليد الكتب + بناة القوارب + صالة طعام + مساحة خضراء في المناطق المأهولة + نادي ألعاب اللوح + قطار جبلي + فوارة حارة + ‮‮نبع + الرافضية + ملحق ملاصق للمبنى \ No newline at end of file From b17bd286167a9f1c17bb5c383853466f53fb61d2 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Wed, 11 Nov 2020 01:54:30 +0000 Subject: [PATCH 47/47] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3537 of 3537 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index b45f168453..00f0afe23d 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -335,7 +335,7 @@ 整體程式設定 您 OSM 的使用者名稱 需要向 openstreetmap.org 提出意見。 - 您 OSM 的密碼 + 密碼 背景模式 當螢幕關閉後,讓 OsmAnd 在背景運行。 空間不足以下載 %1$s MB (空間剩餘:%2$s)。 @@ -3420,7 +3420,7 @@ 路徑重新計算 公告 使用者名稱與密碼 - 這些設定會套用到所有設定檔中。 + 這些外掛程式是全域的,會套用到所有設定檔中 OSM 編輯 OSM 在導航或移動時顯示的圖示。 @@ -3429,7 +3429,7 @@ 無法解析地理含義「%s」。 您已紀錄的軌跡位於 %1$s,或是 OsmAnd 資料夾。 您的 OSM 註記位於 %1$s。 - 檢視您的編輯或 OSM 臭蟲尚未上傳到 %1$s。已上傳的點將不會再顯示。 + 您可以在 %1$s 中檢視您所有未上傳的編輯或 OSM 臭蟲。已上傳的點不會在 OsmAnd 中顯示。 使用此選項需要權限。 這是一個低速過濾器,不記錄低於特定速度的點。在地圖上查看時,這可能會使記錄的軌跡看起來更平滑。 副作用:您的軌跡將會遺失所有未達到最低速度標準的部份(例如,您將自行車推上陡峭的山坡)。此外,也將沒有其餘的資訊,如休息等。這會影響任何分析或後處理,例如試圖確定行程的總長度,運動時間或平均速度時。 @@ -3948,4 +3948,13 @@ OsmAnd Live 訂閱已過期 OsmAnd Live 訂閱已暫停 OsmAnd Live 訂閱已暫停 + 登入到 OpenStreetMap + 登入到 OpenStreetMap.org + 以 OpenStreetMap 登入 + 您必須登入以上傳新的或修正過的變更。 +\n +\n您可以使用安全的 OAuth 方法或使用您的登入與密碼來登入。 + 使用登入與密碼 + 帳號 + 登入 \ No newline at end of file