From e2cf56dd85f17d0bd00d25a2cf6b42bbba97a6ea Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 26 Oct 2020 18:16:57 +0200 Subject: [PATCH 01/60] temp --- OsmAnd/res/layout/follow_track_options.xml | 22 +++++++ .../FollowTrackFragment.java | 64 ++++++++++++++++++- 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/layout/follow_track_options.xml b/OsmAnd/res/layout/follow_track_options.xml index 60c6a885b3..7e7843d510 100644 --- a/OsmAnd/res/layout/follow_track_options.xml +++ b/OsmAnd/res/layout/follow_track_options.xml @@ -55,6 +55,20 @@ android:textSize="@dimen/default_list_text_size" osmand:typeface="@string/font_roboto_medium" /> + + + @@ -81,6 +95,14 @@ android:orientation="vertical" android:paddingBottom="@dimen/dialog_button_ex_height"> + + diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index 8537c8df7a..fcfa4ab68f 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -24,12 +24,16 @@ import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.fragment.app.FragmentManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import net.osmand.AndroidUtils; import net.osmand.CallbackWithObject; +import net.osmand.Collator; import net.osmand.GPXUtilities.GPXFile; import net.osmand.GPXUtilities.WptPt; import net.osmand.IndexConstants; +import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; import net.osmand.ValueHolder; import net.osmand.data.QuadRect; @@ -37,6 +41,7 @@ import net.osmand.data.RotatedTileBox; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; +import net.osmand.plus.SimplePopUpMenuItemAdapter; import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.activities.MapActivity; @@ -44,6 +49,7 @@ import net.osmand.plus.base.ContextMenuScrollFragment; import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXInfo; +import net.osmand.plus.helpers.enums.TracksSortByMode; import net.osmand.plus.importfiles.ImportHelper; import net.osmand.plus.importfiles.ImportHelper.OnGpxImportCompleteListener; import net.osmand.plus.measurementtool.GpxData; @@ -71,6 +77,9 @@ import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; @@ -89,10 +98,12 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private GPXFile gpxFile; private View buttonsShadow; + protected boolean nightMode; private boolean editingTrack; private boolean selectingTrack; private int menuTitleHeight; + TracksSortByMode sortByMode = TracksSortByMode.BY_DATE; @Override public int getMainLayoutId() { @@ -151,6 +162,36 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); if (view != null) { + final ImageButton sortButton = view.findViewById(R.id.sort_button); + Drawable background = app.getUIUtilities().getIcon(R.drawable.bg_dash_line_dark, + nightMode + ? R.color.inactive_buttons_and_links_bg_dark + : R.color.inactive_buttons_and_links_bg_light); + sortButton.setImageResource(sortByMode.getIconId()); + AndroidUtils.setBackground(sortButton, background); + sortButton.setVisibility(View.VISIBLE); + final RecyclerView filesRecyclerView = view.findViewById(R.id.gpx_track_list); + filesRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); + sortButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + final List items = new ArrayList<>(); + for (final TracksSortByMode mode : TracksSortByMode.values()) { + items.add(new SimplePopUpMenuItemAdapter.SimplePopUpMenuItem( + getString(mode.getNameId()), + app.getUIUtilities().getThemedIcon(mode.getIconId()), + new View.OnClickListener() { + @Override + public void onClick(View v) { + sortByMode = mode; + sortGPXInfoItems(list); + } + }, sortByMode == mode + )); + } + UiUtilities.showPopUpMenu(v, items); + } + }); ImageButton closeButton = view.findViewById(R.id.close_button); buttonsShadow = view.findViewById(R.id.buttons_shadow); closeButton.setImageDrawable(getContentIcon(AndroidUtils.getNavigationIconResId(app))); @@ -204,7 +245,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca if (gpxFile == null || selectingTrack) { ImportTrackCard importTrackCard = new ImportTrackCard(mapActivity); importTrackCard.setListener(this); - cardsContainer.addView(importTrackCard.build(mapActivity)); setupTracksCard(); } else { @@ -264,6 +304,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca List selectedTrackNames = GpxUiHelper.getSelectedTrackPaths(app); List list = GpxUiHelper.getSortedGPXFilesInfo(dir, selectedTrackNames, false); if (list.size() > 0) { + sortGPXInfoItems(list); String defaultCategory = app.getString(R.string.shared_string_all); TracksToFollowCard tracksCard = new TracksToFollowCard(mapActivity, list, defaultCategory); tracksCard.setListener(FollowTrackFragment.this); @@ -272,6 +313,27 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca } } + public void sortGPXInfoItems(List gpxInfoList) { + final Collator collator = OsmAndCollator.primaryCollator(); + Collections.sort(gpxInfoList, new Comparator() { + @Override + public int compare(GPXInfo i1, GPXInfo i2) { + if (sortByMode == TracksSortByMode.BY_NAME_ASCENDING) { + return collator.compare(i1.getFileName(), i2.getFileName()); + } else if (sortByMode == TracksSortByMode.BY_NAME_DESCENDING) { + return -collator.compare(i1.getFileName(), i2.getFileName()); + } else { + long time1 = i1.getLastModified(); + long time2 = i2.getLastModified(); + if (time1 == time2) { + return collator.compare(i1.getFileName(), i2.getFileName()); + } + return -((time1 < time2) ? -1 : ((time1 == time2) ? 0 : 1)); + } + } + }); + } + private void setupNavigateOptionsCard(GPXRouteParamsBuilder rparams) { MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { From bee69a9a187bc6671f43bda0b7fcfe4c04693c94 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 26 Oct 2020 18:18:38 +0200 Subject: [PATCH 02/60] 2 --- .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index fcfa4ab68f..a6411f2c46 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -184,7 +184,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca @Override public void onClick(View v) { sortByMode = mode; - sortGPXInfoItems(list); + setupTracksCard(); } }, sortByMode == mode )); From 62995c120fa4d9fff48c49d72546edf37ffc4078 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Tue, 27 Oct 2020 10:04:17 +0200 Subject: [PATCH 03/60] update card --- .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index a6411f2c46..b8446e9ac7 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -184,7 +184,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca @Override public void onClick(View v) { sortByMode = mode; - setupTracksCard(); + setupCards(); } }, sortByMode == mode )); From 06ecfe7e8c5de2d667f6762d5d3a970b2431f395 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Tue, 27 Oct 2020 12:25:21 +0200 Subject: [PATCH 04/60] redo --- .../FollowTrackFragment.java | 33 +++++---------- .../cards/TracksToFollowCard.java | 40 ++++++++++++++++++- 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index b8446e9ac7..6184c6bd54 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -99,6 +99,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private View buttonsShadow; protected boolean nightMode; + private TracksToFollowCard tracksCard; private boolean editingTrack; private boolean selectingTrack; @@ -184,7 +185,13 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca @Override public void onClick(View v) { sortByMode = mode; - setupCards(); + sortButton.setImageResource(mode.getIconId()); + if (tracksCard != null) { + List list = tracksCard.getGpxInfoList(); + tracksCard.setSortByMode(mode); + tracksCard.setGpxInfoList(list); + + } } }, sortByMode == mode )); @@ -304,35 +311,15 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca List selectedTrackNames = GpxUiHelper.getSelectedTrackPaths(app); List list = GpxUiHelper.getSortedGPXFilesInfo(dir, selectedTrackNames, false); if (list.size() > 0) { - sortGPXInfoItems(list); String defaultCategory = app.getString(R.string.shared_string_all); - TracksToFollowCard tracksCard = new TracksToFollowCard(mapActivity, list, defaultCategory); + tracksCard = new TracksToFollowCard(mapActivity, list, defaultCategory); tracksCard.setListener(FollowTrackFragment.this); getCardsContainer().addView(tracksCard.build(mapActivity)); } } } - public void sortGPXInfoItems(List gpxInfoList) { - final Collator collator = OsmAndCollator.primaryCollator(); - Collections.sort(gpxInfoList, new Comparator() { - @Override - public int compare(GPXInfo i1, GPXInfo i2) { - if (sortByMode == TracksSortByMode.BY_NAME_ASCENDING) { - return collator.compare(i1.getFileName(), i2.getFileName()); - } else if (sortByMode == TracksSortByMode.BY_NAME_DESCENDING) { - return -collator.compare(i1.getFileName(), i2.getFileName()); - } else { - long time1 = i1.getLastModified(); - long time2 = i2.getLastModified(); - if (time1 == time2) { - return collator.compare(i1.getFileName(), i2.getFileName()); - } - return -((time1 < time2) ? -1 : ((time1 == time2) ? 0 : 1)); - } - } - }); - } + private void setupNavigateOptionsCard(GPXRouteParamsBuilder rparams) { MapActivity mapActivity = getMapActivity(); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java index c21b508116..c6cfe7247d 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java @@ -3,16 +3,21 @@ package net.osmand.plus.routepreparationmenu.cards; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import net.osmand.Collator; import net.osmand.IndexConstants; +import net.osmand.OsmAndCollator; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.GpxTrackAdapter; import net.osmand.plus.helpers.GpxUiHelper.GPXInfo; +import net.osmand.plus.helpers.enums.TracksSortByMode; import net.osmand.plus.mapcontextmenu.other.HorizontalSelectionAdapter; import net.osmand.util.Algorithms; import java.io.File; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -25,6 +30,11 @@ public class TracksToFollowCard extends BaseCard { private String selectedCategory; private String defaultCategory; private String visibleCategory; + TracksSortByMode sortByMode = TracksSortByMode.BY_DATE; + + public void setSortByMode(TracksSortByMode sortByMode) { + this.sortByMode = sortByMode; + } private GpxTrackAdapter tracksAdapter; @@ -34,18 +44,24 @@ public class TracksToFollowCard extends BaseCard { this.selectedCategory = selectedCategory; defaultCategory = app.getString(R.string.shared_string_all); visibleCategory = app.getString(R.string.shared_string_visible); + sortGPXInfoItems(gpxInfoList); gpxInfoCategories = getGpxInfoCategories(); } public void setGpxInfoList(List gpxInfoList) { this.gpxInfoList = gpxInfoList; + sortGPXInfoItems(gpxInfoList); gpxInfoCategories = getGpxInfoCategories(); + List items = gpxInfoCategories.get(selectedCategory); + tracksAdapter.setGpxInfoList(items != null ? items : new ArrayList()); + tracksAdapter.notifyDataSetChanged(); } public List getGpxInfoList() { return gpxInfoList; } + public String getSelectedCategory() { return selectedCategory; } @@ -141,4 +157,26 @@ public class TracksToFollowCard extends BaseCard { } items.add(info); } -} \ No newline at end of file + + public void sortGPXInfoItems(List gpxInfoList) { + final Collator collator = OsmAndCollator.primaryCollator(); + Collections.sort(gpxInfoList, new Comparator() { + @Override + public int compare(GPXInfo i1, GPXInfo i2) { + if (sortByMode == TracksSortByMode.BY_NAME_ASCENDING) { + return collator.compare(i1.getFileName(), i2.getFileName()); + } else if (sortByMode == TracksSortByMode.BY_NAME_DESCENDING) { + return -collator.compare(i1.getFileName(), i2.getFileName()); + } else { + long time1 = i1.getLastModified(); + long time2 = i2.getLastModified(); + if (time1 == time2) { + return collator.compare(i1.getFileName(), i2.getFileName()); + } + return -((time1 < time2) ? -1 : ((time1 == time2) ? 0 : 1)); + } + } + }); + } +} + From 040616144d7ac9e9b5bf003c59dddc5875142d9c Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Tue, 27 Oct 2020 13:01:16 +0200 Subject: [PATCH 05/60] fix icon colors --- .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index 6184c6bd54..f304123de8 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -98,7 +98,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private GPXFile gpxFile; private View buttonsShadow; - protected boolean nightMode; private TracksToFollowCard tracksCard; private boolean editingTrack; @@ -165,7 +164,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca if (view != null) { final ImageButton sortButton = view.findViewById(R.id.sort_button); Drawable background = app.getUIUtilities().getIcon(R.drawable.bg_dash_line_dark, - nightMode + isNightMode() ? R.color.inactive_buttons_and_links_bg_dark : R.color.inactive_buttons_and_links_bg_light); sortButton.setImageResource(sortByMode.getIconId()); From 750a7169f0f582b6886a0854557b25e6533412f0 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 29 Oct 2020 01:43:14 +0200 Subject: [PATCH 06/60] Add export and import favourites via osf file --- .../net/osmand/plus/FavouritesDbHelper.java | 18 +- .../osmand/plus/importfiles/ImportHelper.java | 18 +- .../osmand/plus/osmedit/OsmEditingPlugin.java | 4 +- .../settings/backend/ExportSettingsType.java | 3 +- .../backend/backup/FavoritesSettingsItem.java | 197 ++++++++++++++++++ .../backend/backup/SettingsHelper.java | 22 +- .../backend/backup/SettingsItemType.java | 1 + .../backend/backup/SettingsItemsFactory.java | 3 + .../fragments/DuplicatesSettingsAdapter.java | 5 + .../ExportImportSettingsAdapter.java | 14 +- .../fragments/ImportCompleteFragment.java | 10 +- .../fragments/ImportDuplicatesFragment.java | 8 + .../fragments/ImportSettingsFragment.java | 9 + .../ImportedSettingsItemsAdapter.java | 4 + 14 files changed, 298 insertions(+), 18 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java diff --git a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java index 4aaca14bb3..22beca7cbe 100644 --- a/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/FavouritesDbHelper.java @@ -76,6 +76,22 @@ public class FavouritesDbHelper { private int color; private List points = new ArrayList<>(); + public FavoriteGroup() { + } + + public FavoriteGroup(String name, boolean visible, int color) { + this.name = name; + this.visible = visible; + this.color = color; + } + + public FavoriteGroup(String name, List points, int color, boolean visible) { + this.name = name; + this.color = color; + this.points = points; + this.visible = visible; + } + public boolean isPersonal() { return isPersonal(name); } @@ -640,7 +656,7 @@ public class FavouritesDbHelper { return asGpxFile(cachedFavoritePoints); } - private GPXFile asGpxFile(List favoritePoints) { + public GPXFile asGpxFile(List favoritePoints) { GPXFile gpx = new GPXFile(Version.getFullVersion(context)); for (FavouritePoint p : favoritePoints) { context.getSelectedGpxHelper().addPoint(p.toWpt(context), gpx); diff --git a/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java b/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java index 541300a7ec..16fb083f13 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/ImportHelper.java @@ -650,8 +650,8 @@ public class ImportHelper { } } - protected static List asFavourites(OsmandApplication app, List wptPts, String fileName, boolean forceImportFavourites) { - final List favourites = new ArrayList<>(); + public static List asFavourites(OsmandApplication app, List wptPts, String fileName, boolean forceImportFavourites) { + List favourites = new ArrayList<>(); for (WptPt p : wptPts) { if (p.name != null) { final String fpCat; @@ -664,18 +664,18 @@ public class ImportHelper { } else { fpCat = p.category; } - final FavouritePoint fp = new FavouritePoint(p.lat, p.lon, p.name, fpCat); + FavouritePoint point = new FavouritePoint(p.lat, p.lon, p.name, fpCat); if (p.desc != null) { - fp.setDescription(p.desc); + point.setDescription(p.desc); } - fp.setAddress(p.getExtensionsToRead().get("address")); - fp.setColor(p.getColor(0)); + point.setAddress(p.getExtensionsToRead().get("address")); + point.setColor(p.getColor(0)); String iconName = p.getIconName(); if (iconName != null) { - fp.setIconIdFromName(app, iconName); + point.setIconIdFromName(app, iconName); } - fp.setBackgroundType(BackgroundType.getByTypeName(p.getBackgroundType(), DEFAULT_BACKGROUND_TYPE)); - favourites.add(fp); + point.setBackgroundType(BackgroundType.getByTypeName(p.getBackgroundType(), DEFAULT_BACKGROUND_TYPE)); + favourites.add(point); } } return favourites; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 5b9b9eb7ce..285e323867 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -323,9 +323,9 @@ public class OsmEditingPlugin extends OsmandPlugin { @Override public void addMyPlacesTab(FavoritesActivity favoritesActivity, List mTabs, Intent intent) { - mTabs.add(favoritesActivity.getTabIndicator(R.string.osm_edits, OsmEditsFragment.class)); + mTabs.add(favoritesActivity.getTabIndicator(OSM_EDIT_TAB, OsmEditsFragment.class)); if (intent != null && "OSM".equals(intent.getStringExtra("TAB"))) { - app.getSettings().FAVORITES_TAB.set(R.string.osm_edits); + app.getSettings().FAVORITES_TAB.set(OSM_EDIT_TAB); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java index 17901458ec..591e5ae55b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/ExportSettingsType.java @@ -13,5 +13,6 @@ public enum ExportSettingsType { GLOBAL, OSM_NOTES, OSM_EDITS, - OFFLINE_MAPS + OFFLINE_MAPS, + FAVORITES } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java new file mode 100644 index 0000000000..8e8c4c6f36 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/FavoritesSettingsItem.java @@ -0,0 +1,197 @@ +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.FavouritePoint; +import net.osmand.plus.FavouritesDbHelper; +import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; +import net.osmand.plus.OsmandApplication; +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; +import java.util.Map; + +import static net.osmand.IndexConstants.GPX_FILE_EXT; +import static net.osmand.plus.importfiles.ImportHelper.asFavourites; + +public class FavoritesSettingsItem extends CollectionSettingsItem { + + private FavouritesDbHelper favoritesHelper; + + public FavoritesSettingsItem(@NonNull OsmandApplication app, @NonNull List items) { + super(app, null, items); + } + + public FavoritesSettingsItem(@NonNull OsmandApplication app, @Nullable FavoritesSettingsItem baseItem, @NonNull List items) { + super(app, baseItem, items); + } + + FavoritesSettingsItem(@NonNull OsmandApplication app, @NonNull JSONObject json) throws JSONException { + super(app, json); + } + + @Override + protected void init() { + super.init(); + favoritesHelper = app.getFavorites(); + existingItems = new ArrayList<>(favoritesHelper.getFavoriteGroups()); + } + + @NonNull + @Override + public SettingsItemType getType() { + return SettingsItemType.FAVOURITES; + } + + @NonNull + @Override + public String getName() { + return "favourites"; + } + + @NonNull + @Override + public String getPublicName(@NonNull Context ctx) { + return ctx.getString(R.string.shared_string_favorites); + } + + @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 (FavoriteGroup duplicate : duplicateItems) { + if (shouldReplace) { + FavoriteGroup existingGroup = favoritesHelper.getGroup(duplicate.getName()); + if (existingGroup != null) { + List favouritePoints = new ArrayList<>(existingGroup.getPoints()); + for (FavouritePoint favouritePoint : favouritePoints) { + favoritesHelper.deleteFavourite(favouritePoint, false); + } + } + } + appliedItems.add(shouldReplace ? duplicate : renameItem(duplicate)); + } + List favourites = getPointsFromGroups(appliedItems); + for (FavouritePoint favourite : favourites) { + favoritesHelper.addFavourite(favourite, false); + } + favoritesHelper.sortAll(); + favoritesHelper.saveCurrentPointsIntoFile(); + } + } + + @Override + public boolean isDuplicate(@NonNull FavoriteGroup favoriteGroup) { + String name = favoriteGroup.getName(); + for (FavoriteGroup group : existingItems) { + if (group.getName().equals(name)) { + return true; + } + } + return false; + } + + @Override + public boolean shouldReadOnCollecting() { + return true; + } + + @NonNull + @Override + public FavoriteGroup renameItem(@NonNull FavoriteGroup item) { + int number = 0; + while (true) { + number++; + String name = item.getName() + " (" + number + ")"; + FavoriteGroup renamedItem = new FavoriteGroup(name, item.getPoints(), item.getColor(), item.isVisible()); + if (!isDuplicate(renamedItem)) { + for (FavouritePoint point : renamedItem.getPoints()) { + point.setCategory(renamedItem.getName()); + } + return renamedItem; + } + } + } + + @Nullable + @Override + SettingsItemReader getReader() { + return new SettingsItemReader(this) { + + @Override + public void readFromStream(@NonNull InputStream inputStream) 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 favourites = asFavourites(app, gpxFile.getPoints(), fileName, false); + for (FavouritePoint point : favourites) { + FavoriteGroup group = flatGroups.get(point.getCategory()); + if (group == null) { + group = new FavoriteGroup(point.getCategory(), point.isVisible(), point.getColor()); + flatGroups.put(group.getName(), group); + items.add(group); + } + group.getPoints().add(point); + } + } + } + }; + } + + private List getPointsFromGroups(List groups) { + List favouritePoints = new ArrayList<>(); + for (FavoriteGroup group : groups) { + favouritePoints.addAll(group.getPoints()); + } + return favouritePoints; + } + + @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; + } + }; + } +} \ 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 0cfa472ef0..7d79ef3481 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -13,6 +13,7 @@ import net.osmand.data.LatLon; 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.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.SQLiteTileSource; @@ -47,7 +48,7 @@ import java.util.Map; import java.util.Set; import static net.osmand.IndexConstants.OSMAND_SETTINGS_FILE_EXT; -import static net.osmand.plus.activities.LocalIndexHelper.*; +import static net.osmand.plus.activities.LocalIndexHelper.LocalIndexType; /* Usage: @@ -535,6 +536,10 @@ public class SettingsHelper { if (!files.isEmpty()) { dataList.put(ExportSettingsType.OFFLINE_MAPS, files); } + List favoriteGroups = app.getFavorites().getFavoriteGroups(); + if (!favoriteGroups.isEmpty()) { + dataList.put(ExportSettingsType.FAVORITES, favoriteGroups); + } return dataList; } @@ -562,6 +567,7 @@ public class SettingsHelper { List tileSourceTemplates = new ArrayList<>(); List avoidRoads = new ArrayList<>(); List appModeBeans = new ArrayList<>(); + List favoriteGroups = new ArrayList<>(); List osmNotesPointList = new ArrayList<>(); List osmEditsPointList = new ArrayList<>(); @@ -586,6 +592,8 @@ public class SettingsHelper { osmNotesPointList.add((OsmNotesPoint) object); } else if (object instanceof OpenstreetmapPoint) { osmEditsPointList.add((OpenstreetmapPoint) object); + } else if (object instanceof FavoriteGroup) { + favoriteGroups.add((FavoriteGroup) object); } } if (!quickActions.isEmpty()) { @@ -614,6 +622,9 @@ public class SettingsHelper { if (!osmEditsPointList.isEmpty()) { settingsItems.add(new OsmEditsSettingsItem(app, osmEditsPointList)); } + if (!favoriteGroups.isEmpty()) { + settingsItems.add(new FavoritesSettingsItem(app, favoriteGroups)); + } return settingsItems; } @@ -632,6 +643,8 @@ public class SettingsHelper { List globalSettingsItems = new ArrayList<>(); List notesPointList = new ArrayList<>(); List editsPointList = new ArrayList<>(); + List favoriteGroups = new ArrayList<>(); + for (SettingsItem item : settingsItems) { switch (item.getType()) { case PROFILE: @@ -705,6 +718,10 @@ public class SettingsHelper { editsPointList.addAll(osmEditsSettingsItem.getItems()); } break; + case FAVOURITES: + FavoritesSettingsItem favoritesSettingsItem = (FavoritesSettingsItem) item; + favoriteGroups.addAll(favoritesSettingsItem.getItems()); + break; default: break; } @@ -749,6 +766,9 @@ public class SettingsHelper { if (!mapFilesList.isEmpty()) { settingsToOperate.put(ExportSettingsType.OFFLINE_MAPS, mapFilesList); } + if (!favoriteGroups.isEmpty()) { + settingsToOperate.put(ExportSettingsType.FAVORITES, favoriteGroups); + } 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 a513dc748c..bb6b68b3ce 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemType.java @@ -15,4 +15,5 @@ public enum SettingsItemType { DOWNLOADS, OSM_NOTES, OSM_EDITS, + FAVOURITES } \ 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 8545b37503..9c8faf4f9b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java @@ -131,6 +131,9 @@ class SettingsItemsFactory { case OSM_EDITS: item = new OsmEditsSettingsItem(app, json); break; + case FAVOURITES: + item = new FavoritesSettingsItem(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 8160e81e6e..d90f4b7429 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/DuplicatesSettingsAdapter.java @@ -13,6 +13,7 @@ import net.osmand.AndroidUtils; 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; @@ -148,6 +149,10 @@ public class DuplicatesSettingsAdapter extends RecyclerView.Adapter multimediaFilesList = new ArrayList<>(); List trackFilesList = new ArrayList<>(); List avoidRoads = new ArrayList<>(); + List favoriteGroups = new ArrayList<>(); for (Object object : duplicatesList) { if (object instanceof ApplicationMode.ApplicationModeBean) { @@ -201,6 +203,8 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment implements View } } else if (object instanceof AvoidRoadInfo) { avoidRoads.add((AvoidRoadInfo) object); + } else if (object instanceof FavoriteGroup) { + favoriteGroups.add((FavoriteGroup) object); } } if (!profiles.isEmpty()) { @@ -239,6 +243,10 @@ public class ImportDuplicatesFragment extends BaseOsmAndFragment implements View duplicates.add(getString(R.string.avoid_road)); duplicates.addAll(avoidRoads); } + if (!favoriteGroups.isEmpty()) { + duplicates.add(getString(R.string.shared_string_favorites)); + duplicates.addAll(favoriteGroups); + } 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 8250477d20..64eabd6277 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -33,6 +33,7 @@ import net.osmand.PlatformUtil; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.AppInitializer; +import net.osmand.plus.FavouritesDbHelper.FavoriteGroup; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.SQLiteTileSource; @@ -46,6 +47,7 @@ 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.FavoritesSettingsItem; import net.osmand.plus.settings.backend.backup.OsmEditsSettingsItem; import net.osmand.plus.settings.backend.backup.OsmNotesSettingsItem; import net.osmand.plus.settings.backend.backup.SettingsHelper; @@ -437,6 +439,7 @@ public class ImportSettingsFragment extends BaseOsmAndFragment List avoidRoads = new ArrayList<>(); List osmNotesPointList = new ArrayList<>(); List osmEditsPointList = new ArrayList<>(); + List favoriteGroups = new ArrayList<>(); for (Object object : data) { if (object instanceof ApplicationModeBean) { appModeBeans.add((ApplicationModeBean) object); @@ -456,6 +459,8 @@ public class ImportSettingsFragment extends BaseOsmAndFragment osmNotesPointList.add((OsmNotesPoint) object); } else if (object instanceof OpenstreetmapPoint) { osmEditsPointList.add((OpenstreetmapPoint) object); + } else if (object instanceof FavoriteGroup) { + favoriteGroups.add((FavoriteGroup) object); } } if (!appModeBeans.isEmpty()) { @@ -483,6 +488,10 @@ public class ImportSettingsFragment extends BaseOsmAndFragment OsmEditsSettingsItem baseItem = getBaseItem(SettingsItemType.OSM_EDITS, OsmEditsSettingsItem.class); settingsItems.add(new OsmEditsSettingsItem(app, baseItem, osmEditsPointList)); } + if (!favoriteGroups.isEmpty()) { + FavoritesSettingsItem baseItem = getBaseItem(SettingsItemType.FAVOURITES, FavoritesSettingsItem.class); + settingsItems.add(new FavoritesSettingsItem(app, baseItem, favoriteGroups)); + } 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 7acd88ee4b..5be4735a55 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java @@ -122,6 +122,10 @@ public class ImportedSettingsItemsAdapter extends holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_info_dark, activeColorRes)); holder.title.setText(R.string.osm_edit_modified_poi); break; + case FAVORITES: + holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_favorite, activeColorRes)); + holder.title.setText(R.string.shared_string_favorites); + break; } } From 0c03cb36d6c44089d9b1590a301b308c809dc95f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 29 Oct 2020 03:12:23 +0200 Subject: [PATCH 07/60] Export json items to separate files --- .../net/osmand/plus/activities/SettingsBaseActivity.java | 0 .../settings/backend/backup/AvoidRoadsSettingsItem.java | 2 +- .../plus/settings/backend/backup/DownloadsItem.java | 2 +- .../plus/settings/backend/backup/GlobalSettingsItem.java | 4 ++++ .../settings/backend/backup/MapSourcesSettingsItem.java | 2 +- .../settings/backend/backup/OsmEditsSettingsItem.java | 2 +- .../settings/backend/backup/OsmNotesSettingsItem.java | 2 +- .../settings/backend/backup/PoiUiFiltersSettingsItem.java | 2 +- .../settings/backend/backup/QuickActionsSettingsItem.java | 2 +- .../osmand/plus/settings/backend/backup/SettingsItem.java | 1 - .../settings/backend/backup/SettingsItemsFactory.java | 2 +- .../settings/backend/backup/SuggestedDownloadsItem.java | 2 +- .../plus/settings/fragments/ImportSettingsFragment.java | 3 +++ .../settings/fragments/ImportedSettingsItemsAdapter.java | 8 ++++++++ 14 files changed, 24 insertions(+), 10 deletions(-) delete mode 100644 OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java index 3088d9e86f..61b5f28541 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java @@ -174,6 +174,6 @@ public class AvoidRoadsSettingsItem extends CollectionSettingsItem getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/DownloadsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/DownloadsItem.java index 67b9d5812e..7c9318ad37 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/DownloadsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/DownloadsItem.java @@ -97,6 +97,6 @@ public class DownloadsItem extends SettingsItem { @Nullable @Override SettingsItemWriter getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/GlobalSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/GlobalSettingsItem.java index d30c4d94d8..bcf837de54 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/GlobalSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/GlobalSettingsItem.java @@ -19,6 +19,10 @@ public class GlobalSettingsItem extends OsmandSettingsItem { super(settings); } + public GlobalSettingsItem(@NonNull OsmandSettings settings, @NonNull JSONObject json) throws JSONException { + super(SettingsItemType.GLOBAL, settings, json); + } + @NonNull @Override public SettingsItemType getType() { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MapSourcesSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MapSourcesSettingsItem.java index 82cf840b94..4c38a07892 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/MapSourcesSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/MapSourcesSettingsItem.java @@ -236,6 +236,6 @@ public class MapSourcesSettingsItem extends CollectionSettingsItem @Nullable @Override SettingsItemWriter getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmEditsSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmEditsSettingsItem.java index 03e1e39ad5..287f6dc9de 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmEditsSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmEditsSettingsItem.java @@ -194,6 +194,6 @@ public class OsmEditsSettingsItem extends CollectionSettingsItem getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmNotesSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmNotesSettingsItem.java index afe23c2059..edcaa350e3 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmNotesSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/OsmNotesSettingsItem.java @@ -167,6 +167,6 @@ public class OsmNotesSettingsItem extends CollectionSettingsItem @Nullable @Override SettingsItemWriter getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/PoiUiFiltersSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/PoiUiFiltersSettingsItem.java index 8d1c464761..29e20679d9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/PoiUiFiltersSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/PoiUiFiltersSettingsItem.java @@ -173,6 +173,6 @@ public class PoiUiFiltersSettingsItem extends CollectionSettingsItem getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/QuickActionsSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/QuickActionsSettingsItem.java index b2e597ab60..499ac2a833 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/QuickActionsSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/QuickActionsSettingsItem.java @@ -178,6 +178,6 @@ public class QuickActionsSettingsItem extends CollectionSettingsItem getWriter() { - return null; + return getJsonWriter(); } } 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 caf2d57301..c80eb4cec2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItem.java @@ -142,7 +142,6 @@ public abstract class SettingsItem { } json.put("file", fileName); } - writeItemsToJson(json); } String toJson() throws JSONException { 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 9c8faf4f9b..9669099003 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsItemsFactory.java @@ -90,7 +90,7 @@ class SettingsItemsFactory { OsmandSettings settings = app.getSettings(); switch (type) { case GLOBAL: - item = new GlobalSettingsItem(settings); + item = new GlobalSettingsItem(settings, json); break; case PROFILE: item = new ProfileSettingsItem(app, json); diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SuggestedDownloadsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SuggestedDownloadsItem.java index d2dd9a8554..d6411fb89d 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SuggestedDownloadsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SuggestedDownloadsItem.java @@ -123,6 +123,6 @@ public class SuggestedDownloadsItem extends SettingsItem { @Nullable @Override SettingsItemWriter getWriter() { - return null; + return getJsonWriter(); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index 64eabd6277..5cffbf5898 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -48,6 +48,7 @@ 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.FavoritesSettingsItem; +import net.osmand.plus.settings.backend.backup.GlobalSettingsItem; import net.osmand.plus.settings.backend.backup.OsmEditsSettingsItem; import net.osmand.plus.settings.backend.backup.OsmNotesSettingsItem; import net.osmand.plus.settings.backend.backup.SettingsHelper; @@ -461,6 +462,8 @@ public class ImportSettingsFragment extends BaseOsmAndFragment osmEditsPointList.add((OpenstreetmapPoint) object); } else if (object instanceof FavoriteGroup) { favoriteGroups.add((FavoriteGroup) object); + } else if (object instanceof GlobalSettingsItem) { + settingsItems.add((GlobalSettingsItem) object); } } if (!appModeBeans.isEmpty()) { diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java index 5be4735a55..d50b00ae6f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportedSettingsItemsAdapter.java @@ -126,6 +126,14 @@ public class ImportedSettingsItemsAdapter extends holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_favorite, activeColorRes)); holder.title.setText(R.string.shared_string_favorites); break; + case OFFLINE_MAPS: + holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_map, activeColorRes)); + holder.title.setText(R.string.shared_string_local_maps); + break; + case GLOBAL: + holder.icon.setImageDrawable(uiUtils.getIcon(R.drawable.ic_action_settings, activeColorRes)); + holder.title.setText(R.string.general_settings_2); + break; } } From e9925fbddddb8958acafd5531583df8718ba89f0 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 29 Oct 2020 11:58:08 +0200 Subject: [PATCH 08/60] Clean up sorting in tracks to follow --- OsmAnd/res/layout/follow_track_options.xml | 19 +--- .../FollowTrackFragment.java | 86 +++++++------------ .../cards/TracksToFollowCard.java | 40 ++++----- 3 files changed, 54 insertions(+), 91 deletions(-) diff --git a/OsmAnd/res/layout/follow_track_options.xml b/OsmAnd/res/layout/follow_track_options.xml index 7e7843d510..0877fcc307 100644 --- a/OsmAnd/res/layout/follow_track_options.xml +++ b/OsmAnd/res/layout/follow_track_options.xml @@ -60,14 +60,11 @@ android:layout_width="@dimen/wikipedia_options_button_width" android:layout_height="@dimen/dialog_button_height" android:layout_gravity="center" - osmand:srcCompat="@drawable/ic_sort_waypoint_dark" - android:tint="?attr/color_dialog_buttons" - android:background="?attr/bg_dash_line" - android:visibility="gone" - tools:visibility="visible" android:layout_marginEnd="@dimen/content_padding" - android:layout_marginRight="@dimen/content_padding" /> - + android:layout_marginRight="@dimen/content_padding" + android:background="?attr/bg_dash_line" + android:tint="?attr/color_dialog_buttons" + osmand:srcCompat="@drawable/ic_sort_waypoint_dark" /> @@ -95,14 +92,6 @@ android:orientation="vertical" android:paddingBottom="@dimen/dialog_button_ex_height"> - - diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index f304123de8..b01e49bd12 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -1,11 +1,8 @@ package net.osmand.plus.routepreparationmenu; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; -import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; @@ -19,21 +16,16 @@ import android.view.ViewGroup.MarginLayoutParams; import android.view.ViewTreeObserver.OnScrollChangedListener; import android.widget.FrameLayout; import android.widget.ImageButton; -import android.widget.ImageView; import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.fragment.app.FragmentManager; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; import net.osmand.AndroidUtils; import net.osmand.CallbackWithObject; -import net.osmand.Collator; import net.osmand.GPXUtilities.GPXFile; import net.osmand.GPXUtilities.WptPt; import net.osmand.IndexConstants; -import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; import net.osmand.ValueHolder; import net.osmand.data.QuadRect; @@ -41,7 +33,7 @@ import net.osmand.data.RotatedTileBox; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.SimplePopUpMenuItemAdapter; +import net.osmand.plus.SimplePopUpMenuItemAdapter.SimplePopUpMenuItem; import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities.DialogButtonType; import net.osmand.plus.activities.MapActivity; @@ -78,8 +70,6 @@ import org.apache.commons.logging.Log; import java.io.File; import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; import java.util.List; @@ -98,12 +88,14 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca private GPXFile gpxFile; private View buttonsShadow; + private ImageButton sortButton; + private TracksToFollowCard tracksCard; + private TracksSortByMode sortByMode = TracksSortByMode.BY_DATE; private boolean editingTrack; private boolean selectingTrack; private int menuTitleHeight; - TracksSortByMode sortByMode = TracksSortByMode.BY_DATE; @Override public int getMainLayoutId() { @@ -162,42 +154,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = super.onCreateView(inflater, container, savedInstanceState); if (view != null) { - final ImageButton sortButton = view.findViewById(R.id.sort_button); - Drawable background = app.getUIUtilities().getIcon(R.drawable.bg_dash_line_dark, - isNightMode() - ? R.color.inactive_buttons_and_links_bg_dark - : R.color.inactive_buttons_and_links_bg_light); - sortButton.setImageResource(sortByMode.getIconId()); - AndroidUtils.setBackground(sortButton, background); - sortButton.setVisibility(View.VISIBLE); - final RecyclerView filesRecyclerView = view.findViewById(R.id.gpx_track_list); - filesRecyclerView.setLayoutManager(new LinearLayoutManager(getContext())); - sortButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - final List items = new ArrayList<>(); - for (final TracksSortByMode mode : TracksSortByMode.values()) { - items.add(new SimplePopUpMenuItemAdapter.SimplePopUpMenuItem( - getString(mode.getNameId()), - app.getUIUtilities().getThemedIcon(mode.getIconId()), - new View.OnClickListener() { - @Override - public void onClick(View v) { - sortByMode = mode; - sortButton.setImageResource(mode.getIconId()); - if (tracksCard != null) { - List list = tracksCard.getGpxInfoList(); - tracksCard.setSortByMode(mode); - tracksCard.setGpxInfoList(list); - - } - } - }, sortByMode == mode - )); - } - UiUtilities.showPopUpMenu(v, items); - } - }); ImageButton closeButton = view.findViewById(R.id.close_button); buttonsShadow = view.findViewById(R.id.buttons_shadow); closeButton.setImageDrawable(getContentIcon(AndroidUtils.getNavigationIconResId(app))); @@ -213,6 +169,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca } setupCards(); setupButtons(view); + setupSortButton(view); setupScrollShadow(); if (!isPortrait()) { int widthNoShadow = getLandscapeNoShadowWidth(); @@ -249,9 +206,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca cardsContainer.removeAllViews(); if (gpxFile == null || selectingTrack) { - ImportTrackCard importTrackCard = new ImportTrackCard(mapActivity); - importTrackCard.setListener(this); - setupTracksCard(); } else { String fileName = null; @@ -318,8 +272,6 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca } } - - private void setupNavigateOptionsCard(GPXRouteParamsBuilder rparams) { MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { @@ -649,6 +601,34 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca } } + private void setupSortButton(View view) { + final ImageButton sortButton = view.findViewById(R.id.sort_button); + int colorId = isNightMode() ? R.color.inactive_buttons_and_links_bg_dark : R.color.inactive_buttons_and_links_bg_light; + Drawable background = app.getUIUtilities().getIcon(R.drawable.bg_dash_line_dark, colorId); + sortButton.setImageResource(sortByMode.getIconId()); + AndroidUtils.setBackground(sortButton, background); + sortButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + List items = new ArrayList<>(); + for (final TracksSortByMode mode : TracksSortByMode.values()) { + items.add(new SimplePopUpMenuItem(getString(mode.getNameId()), + app.getUIUtilities().getThemedIcon(mode.getIconId()), + new View.OnClickListener() { + @Override + public void onClick(View v) { + sortByMode = mode; + tracksCard.setSortByMode(mode); + sortButton.setImageResource(mode.getIconId()); + } + }, sortByMode == mode + )); + } + UiUtilities.showPopUpMenu(v, items); + } + }); + } + private void setupButtons(View view) { View buttonsContainer = view.findViewById(R.id.buttons_container); buttonsContainer.setBackgroundColor(AndroidUtils.getColorFromAttr(view.getContext(), R.attr.bg_color)); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java index c6cfe7247d..0897894730 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksToFollowCard.java @@ -24,19 +24,15 @@ import java.util.Map; public class TracksToFollowCard extends BaseCard { + private List gpxInfoList; private Map> gpxInfoCategories; - private List gpxInfoList; - private String selectedCategory; + private GpxTrackAdapter tracksAdapter; + private TracksSortByMode sortByMode = TracksSortByMode.BY_DATE; + private String defaultCategory; private String visibleCategory; - TracksSortByMode sortByMode = TracksSortByMode.BY_DATE; - - public void setSortByMode(TracksSortByMode sortByMode) { - this.sortByMode = sortByMode; - } - - private GpxTrackAdapter tracksAdapter; + private String selectedCategory; public TracksToFollowCard(MapActivity mapActivity, List gpxInfoList, String selectedCategory) { super(mapActivity); @@ -44,24 +40,19 @@ public class TracksToFollowCard extends BaseCard { this.selectedCategory = selectedCategory; defaultCategory = app.getString(R.string.shared_string_all); visibleCategory = app.getString(R.string.shared_string_visible); - sortGPXInfoItems(gpxInfoList); gpxInfoCategories = getGpxInfoCategories(); } - public void setGpxInfoList(List gpxInfoList) { - this.gpxInfoList = gpxInfoList; - sortGPXInfoItems(gpxInfoList); + public void setSortByMode(TracksSortByMode sortByMode) { + this.sortByMode = sortByMode; gpxInfoCategories = getGpxInfoCategories(); - List items = gpxInfoCategories.get(selectedCategory); - tracksAdapter.setGpxInfoList(items != null ? items : new ArrayList()); - tracksAdapter.notifyDataSetChanged(); + updateTracksAdapter(); } public List getGpxInfoList() { return gpxInfoList; } - public String getSelectedCategory() { return selectedCategory; } @@ -107,11 +98,8 @@ public class TracksToFollowCard extends BaseCard { @Override public void onItemSelected(HorizontalSelectionAdapter.HorizontalSelectionItem item) { selectedCategory = item.getTitle(); - List items = gpxInfoCategories.get(selectedCategory); tracksAdapter.setShowFolderName(showFoldersName()); - tracksAdapter.setGpxInfoList(items != null ? items : new ArrayList()); - tracksAdapter.notifyDataSetChanged(); - + updateTracksAdapter(); selectionAdapter.notifyDataSetChanged(); } }); @@ -122,6 +110,12 @@ public class TracksToFollowCard extends BaseCard { selectionAdapter.notifyDataSetChanged(); } + private void updateTracksAdapter() { + List items = gpxInfoCategories.get(selectedCategory); + tracksAdapter.setGpxInfoList(items != null ? items : new ArrayList()); + tracksAdapter.notifyDataSetChanged(); + } + private boolean showFoldersName() { return defaultCategory.equals(selectedCategory) || visibleCategory.equals(selectedCategory); } @@ -132,6 +126,7 @@ public class TracksToFollowCard extends BaseCard { gpxInfoCategories.put(visibleCategory, new ArrayList()); gpxInfoCategories.put(defaultCategory, new ArrayList()); + sortGPXInfoItems(gpxInfoList); for (GPXInfo info : gpxInfoList) { if (info.isSelected()) { addGpxInfoCategory(gpxInfoCategories, info, visibleCategory); @@ -178,5 +173,4 @@ public class TracksToFollowCard extends BaseCard { } }); } -} - +} \ No newline at end of file From f1597a3a1c743045306faa6198bfdb351439982c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 29 Oct 2020 12:28:23 +0200 Subject: [PATCH 09/60] Fix possible npe --- .../osmand/plus/routepreparationmenu/FollowTrackFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java index b01e49bd12..d805cde0df 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/FollowTrackFragment.java @@ -618,8 +618,10 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca @Override public void onClick(View v) { sortByMode = mode; - tracksCard.setSortByMode(mode); sortButton.setImageResource(mode.getIconId()); + if (tracksCard != null) { + tracksCard.setSortByMode(mode); + } } }, sortByMode == mode )); From 4484451771f08d22060f6897701ef406ba4bb4c4 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Wed, 28 Oct 2020 06:43:29 +0000 Subject: [PATCH 10/60] Translated using Weblate (French) Currently translated at 100.0% (3512 of 3512 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 2a4458f148..3dda9b8adc 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3801,7 +3801,7 @@ Sélectionnez un fichier de trace à ouvrir. Terminé Remplacer la trace - Sélectionnez comment relier les points : par une ligne droite ou en calculant un itinéraire reliant les points comme indiqué ci-dessous. + Définissez comment relier les points : par une ligne droite ou en calculant un itinéraire avec le profil ci-dessous. Toute la trace sera recalculée en utilisant le profil sélectionné. Seul le prochain segment sera recalculé en utilisant le profil sélectionné. Ensuite, sélectionnez le profil de navigation pour détecter les routes autorisées et le seuil de distance afin de déplacer votre trace. From 1c84be59c6f8995f82ed506914564049c46410f4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 29 Oct 2020 08:41:44 +0000 Subject: [PATCH 11/60] Translated using Weblate (German) Currently translated at 99.9% (3509 of 3512 strings) --- OsmAnd/res/values-de/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 697326c31c..397bf22044 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3933,4 +3933,5 @@ Für das Schneemobilfahren mit speziellen Straßen und Tracks. Durchführen eines OAuth-Logins zur Nutzung der osmedit-Funktionen 2-Phasen-A*-Routing-Algorithmus verwenden + %1$s Daten sind nur auf den Straßen verfügbar, Sie müssen eine Route mit \"Route zwischen Punkten\" berechnen, um sie zu erhalten. \ No newline at end of file From d1221c8c2de2e5027a17b5a7fdb6abb043c2efbc Mon Sep 17 00:00:00 2001 From: nautilusx Date: Thu, 29 Oct 2020 06:23:21 +0000 Subject: [PATCH 12/60] Translated using Weblate (German) Currently translated at 99.9% (3509 of 3512 strings) --- OsmAnd/res/values-de/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 397bf22044..20b7fd68f2 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -3934,4 +3934,5 @@ Durchführen eines OAuth-Logins zur Nutzung der osmedit-Funktionen 2-Phasen-A*-Routing-Algorithmus verwenden %1$s Daten sind nur auf den Straßen verfügbar, Sie müssen eine Route mit \"Route zwischen Punkten\" berechnen, um sie zu erhalten. + %1$s — %2$s \ No newline at end of file From 1cf419391c80545fd7c91f13e904ec65d4adb5f7 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Thu, 29 Oct 2020 08:11:37 +0000 Subject: [PATCH 13/60] Translated using Weblate (Italian) Currently translated at 89.8% (3155 of 3512 strings) --- OsmAnd/res/values-it/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 7b4c8ad764..e950feca34 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3718,7 +3718,7 @@ Questi elementi sono nascosti dal menu, ma le opzioni rappresentate o i plugins continueranno a funzionare. Nascondere le opzioni le reimposta al loro valore originale. Azioni principali - Puoi accedere a queste azioni toccando il pulsante \"Azioni aggiuntive\". + Puoi accedere a queste azioni toccando il pulsante “%1$s”. Puoi spostare gli elementi solo all\'interno di questa categoria. Seleziona i linguaggi in cui gli articoli di Wikipedia appariranno sulla mappa. Puoi cambiare fra tutte le lingue disponibili mentre leggi questo articolo. Alcuni articoli di Wikipedia potrebbero non essere disponibili nella tua lingua. From 13fd8cf31bd8f677c741aa70230501701b39a964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Thu, 29 Oct 2020 10:23:32 +0000 Subject: [PATCH 14/60] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 48.2% (1696 of 3512 strings) --- OsmAnd/res/values-nb/strings.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 85f13702a1..12e10abaef 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -628,7 +628,7 @@ Oversiktskart (verden) Skikart (verden) Kroatisk - Nettfrakoblet beregning av OsmAnd-rutesegment + Frakoblet beregning av OsmAnd-rutesegment Beregn OsmAnd-rute for første og siste rutesegment Statuslinje Foretrukket språk for påskrifter på kartet (hvis utilgjengelig brukes engelsk eller lokale navn). @@ -3694,7 +3694,7 @@ Egendefinert Retningspiler tonn - Rute mellom punkter + Rut mellom punkter Enduro-motorsykkel Skjermkontroll Bruk systemets skjermtidsavbrudd @@ -3706,7 +3706,7 @@ Snu rute Overskriv spor Hele sporet blir beregnet på nytt med den valgte profilen. - Velg hvordan punkter skal forbindes; med en rett linje, eller beregn en rute mellom dem som spesifisert nedenfor. + Velg hvordan punktene skal forbindes; med en rett linje, eller beregn en rute mellom dem som spesifisert nedenfor. Kun det neste segmentet blir beregnet på nytt med den valgte profilen. Hele sporet Neste segment @@ -3872,4 +3872,6 @@ \nGraf vil være tilgjengelig etter omberegning. %1$s — %2$s Graf + %1$s-data er tilgjengelig kun på veiene, du må beregne en rute med “Rut mellom punkter”. + Spor rute \ No newline at end of file From 07b9c263fc523f769f3f6d714350ae46c7621ac0 Mon Sep 17 00:00:00 2001 From: ffff23 Date: Wed, 28 Oct 2020 15:20:48 +0000 Subject: [PATCH 15/60] Translated using Weblate (Japanese) Currently translated at 99.2% (3802 of 3829 strings) --- OsmAnd/res/values-ja/phrases.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-ja/phrases.xml b/OsmAnd/res/values-ja/phrases.xml index 865fa35edc..495b894b2c 100644 --- a/OsmAnd/res/values-ja/phrases.xml +++ b/OsmAnd/res/values-ja/phrases.xml @@ -1479,7 +1479,7 @@ 持ち帰り不可 テイクアウト・持ち帰りのみ 遺跡の種類 - 医療機関 + 専門分野 総合診療医 眼科 婦人科 @@ -1487,7 +1487,7 @@ 整形外科 耳鼻咽喉科 小児科 - 医療機関:小児科:無し + 専門分野:小児科:無し 皮膚科 泌尿器科 一般外科 From 5ddbc7677dbfe9914614d7f551bd98e7cc7c0445 Mon Sep 17 00:00:00 2001 From: Franco Date: Wed, 28 Oct 2020 21:53:25 +0000 Subject: [PATCH 16/60] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3510 of 3512 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 4da8d4966b..ad60cd64f0 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3551,14 +3551,14 @@ Guardando el nuevo perfil No se pudo respaldar el perfil. ¿Borrar los datos registrados\? - Importación de datos de %1$s - Importación + Importando de datos de «%1$s» + Importando OsmAnd comprueba %1$s para ver si hay duplicados con los elementos existentes en la aplicación. \n \nPuede llevar algún tiempo. Elementos añadidos Importación completa - Todos los datos de %1$s son importados, puedes usar los botones de abajo para abrir la parte necesaria de la aplicación para manejarla. + Todos los datos de «%1$s» fueron importados. Puedes usar los botones de abajo para gestionar la sección necesaria de la aplicación. Min %1$s de %2$s Terreno From 1aeed646798889774992709268d27e75a699ce8c Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Tue, 27 Oct 2020 23:19:58 +0000 Subject: [PATCH 17/60] Translated using Weblate (Portuguese (Brazil)) Currently translated at 99.9% (3511 of 3512 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 43ef613eb1..f6e3fc9f64 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3819,7 +3819,7 @@ Rota reversa A trilha inteira será recalculada usando o perfil selecionado. Apenas o próximo segmento será recalculado usando o perfil selecionado. - Selecione como conectar pontos, por uma linha reta, ou calcular uma rota entre eles conforme especificado abaixo. + Escolha como conectar os pontos, por uma linha reta, ou calcular uma rota entre eles conforme especificado abaixo. Trilha inteira Próximo segmento Para usar esta opção, OsmAnd precisa ajustar sua trilha para as estradas do mapa. From 52472493b7cfa523e9b4fb83d5fad2a1726e9597 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Wed, 28 Oct 2020 18:35:44 +0000 Subject: [PATCH 18/60] Translated using Weblate (Esperanto) Currently translated at 99.9% (3511 of 3512 strings) --- OsmAnd/res/values-eo/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index ece67180a8..c469f7f4bd 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3932,4 +3932,6 @@ Datumoj de %1$s estas disponeblaj nur por vojoj, vi devas kalkuli la kurson uzante “kalkuli kurson inter punktoj” por akiri ĝin. Atendado ĝis la kurso estos rekalkulita. \nDiagramo estos videbla post rekalkulado. + %1$s — %2$s + Manko \ No newline at end of file From a92181d3ab0fe431ce9a4e031275bb89d08b3ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Wed, 28 Oct 2020 18:08:00 +0000 Subject: [PATCH 19/60] Translated using Weblate (Icelandic) Currently translated at 100.0% (3512 of 3512 strings) --- OsmAnd/res/values-is/strings.xml | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index c5ce396f03..182d438a1c 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -3777,7 +3777,7 @@ \n \nVeldu %2$s: öllum gögnum sem tengjast hraðamyndavélum; t.d. aðvaranir, tilkynningar, staðsetningar o.fl. verður eytt þar til OsmAnd er sett inn aftur frá grunni. Veldu ferilskrá þar sem nýjum bút verður bætt inn. - Veldu hvernig eigi að tengja punkta; með beinni línu eða reikna leið milli þeirra eins og tiltekið er hér að neðan. + Veldu hvernig eigi að tengja punktana; með beinni línu eða reikna leið milli þeirra eins og tiltekið er hér að neðan. Allur ferillinn verður endurreiknaður með völdu sniði. Lokaður OSM-minnispunktur Allur ferillinn @@ -3914,4 +3914,35 @@ Veldu millibil skráninga í almenna leiðarskráningu (virkjað með viðmótshlutanum fyrir GPX-skráningu á kortinu). Setja skráningu í bið Halda áfram með skráningu + • Uppfærðar aðgerðir í skipulagningu leiða: mismunandi leiðsögn á hverjum bút auk slóða +\n +\n • Ný útlitsvalmynd fyrir slóðir: val á lit, þykkt, birting stefnuörva, táknmynda við upphaf/endi +\n +\n • Bættur sýnileiki hjólreiðahnúta. +\n +\n • Hægt að ýta á slóðir, hafa samhengisvalmynd með grunnupplýsingum. +\n +\n • Bætt reiknirit leitar +\n +\n • Bættir valkostir fyrir \'Fylgja slóð\' í leiðsögn +\n +\n • Lagfærð vandamál við inn/útflutning á stillingum sniða +\n +\n + Bíddu eftir endurútreikningi leiðar. +\nGrafið verður tiltækt eftir endurútreikning. + Fyrir akstur vélsleða á sérstökum vegum og slóðum. + %1$s gögn aðeins tiltæk á vegunum, þú þarft að reikna leið með “Leið milli punkta” til að fá hana. + Skrá hefur þegar verið flutt inn í OsmAnd + Bil + Takk fyrir að kaupa \'Hæðarlínur\' + Áskriftargjaldið verður rukkað miðað við valið tímabil. Þú getur sagt áskriftinni upp hvenær sem er á AppGallery. + Nota 2-umferða A* leiðararútreikning + Greiðsla verður gjaldfærð á AppGallery reikninginn þinn við staðfestingu á kaupunum. +\n +\n Áskrift endurnýjast sjálfkrafa nema hún sé felld niður fyrir endurnýjunardag. Reikningur þinn verður einungis gjaldfærður fyrir endurnýjunartímabil (mánuður / þrír mánuðir / ár) á endurnýjunardegi. +\n +\n Þú getur stýrt og aflýst áskriftunum þínum með því að fara í AppGallery stillingarnar þínar. + Graf + %1$s — %2$s \ No newline at end of file From a267ff4b9c1354ae3dd96dabc59c2e3b935f35e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Wed, 28 Oct 2020 14:26:11 +0000 Subject: [PATCH 20/60] Translated using Weblate (Icelandic) Currently translated at 100.0% (3829 of 3829 strings) --- OsmAnd/res/values-is/phrases.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-is/phrases.xml b/OsmAnd/res/values-is/phrases.xml index 07ff354d7e..564d5dfea5 100644 --- a/OsmAnd/res/values-is/phrases.xml +++ b/OsmAnd/res/values-is/phrases.xml @@ -3802,7 +3802,7 @@ Vatnsyfirborð: í kafi Vatnsyfirborð: að hluta í kafi Gróft - Merki til að finna staurinn + Internetaðgangur: viðskiptavinir Staða dælu: vantar bita Sog Undir þrýstingi @@ -3830,4 +3830,8 @@ LNG Brottfaratafla: nei Brottfaratafla + Meðfram götu + Skýli + Á þaki + GPX-punktur \ No newline at end of file From 245192bceaf88637883e8ac8cbac5908f48ec311 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Wed, 28 Oct 2020 07:47:15 +0000 Subject: [PATCH 21/60] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3512 of 3512 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index e01741d9c3..c25c031f20 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3821,7 +3821,7 @@ 反向路線 整個軌跡都會使用選定的設定檔重新計算。 僅下一個片段會使用選定的設定檔重新計算。 - 選取如何連接點,透過直線或以下面選定的方法計算其間的路徑。 + 選擇如何連接點,透過直線或以下面選定的方法計算其間的路徑。 整個軌道 下一段 接下來,使用您其中一個導航設定檔來將路線貼齊到最近可用的道路上以使用此選項。 From 2fe577601308255f510065762be77d860f9f4f55 Mon Sep 17 00:00:00 2001 From: Franco Date: Wed, 28 Oct 2020 21:58:27 +0000 Subject: [PATCH 22/60] Translated using Weblate (Spanish) Currently translated at 100.0% (271 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/es/ --- OsmAnd-telegram/res/values-es/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-telegram/res/values-es/strings.xml b/OsmAnd-telegram/res/values-es/strings.xml index 63c0fcf19b..29442e4212 100644 --- a/OsmAnd-telegram/res/values-es/strings.xml +++ b/OsmAnd-telegram/res/values-es/strings.xml @@ -268,4 +268,8 @@ Última respuesta: hace %1$s hace %1$s ERR + Exportar + Búfer de Logcat + Selecciona y comparte logs detallados de la app + Enviar informe \ No newline at end of file From 2d5f5e13486d1a38c6b531d3dd2e9e663f8bce9f Mon Sep 17 00:00:00 2001 From: Gilbert Lowel Date: Wed, 28 Oct 2020 15:02:37 +0000 Subject: [PATCH 23/60] Translated using Weblate (Dutch) Currently translated at 95.5% (3357 of 3512 strings) --- OsmAnd/res/values-nl/strings.xml | 92 +++++++++++++++++--------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index ee068917d6..6557da422c 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -12,7 +12,7 @@ Kijkrichting Transparante widgets continu - Vectorkaarten worden vaak sneller weergegeven. Werkt niet op sommige apparaten. + Vectorkaarten worden vaak sneller weergegeven. Werkt niet op alle toestellen. Kies een stem en test door aankondigingen af te spelen: OsmAnd fout-opsporing en ontwikkeling Interne kaartgeneratie @@ -218,7 +218,7 @@ Taal niet ondersteund De gekozen taal wordt niet ondersteund door de geïnstalleerde Android TTS (tekst-naar-spraak) stemgenerator. De standaard TTS taal zal worden gebruikt. Zoek een andere TTS stemgenerator op de markt\? Ontbrekende gegevens - Geen gegevens voor de geselecteerde taal geïnstalleerd. Wil je naar de Play-store gaan om deze te installeren? + Geen gegevens voor de geselecteerde taal geïnstalleerd. Ga naar \"Play Store\" om deze te installeren\? Keer richting van GPX-track om Huidige bestemming gebruiken Volg de gehele track @@ -251,7 +251,7 @@ Fout bij offline zoeken. Zoek adres in de offline kaarten Systeem - App toon talen (OsmAnd dient opnieuw gestart). + App \"Toon talen\" (OsmAnd dient opnieuw gestart). Toon talen Wijzig de eenheid van afstand voor metingen. Afstand eenheden @@ -433,7 +433,7 @@ Naar signaal zoeken… Zoek bij het midden van de kaart Zoek dichtbij - Zelfde als apparaat-instelling + Zelfde als apparaatinstelling Portret Landschap Kaartscherm-oriëntatie @@ -642,7 +642,7 @@ \n \nRasterkaarten zijn direct via online bronnen verkrijgbaar of kunnen voor offline gebruik gereedgemaakt worden (en handmatig gekopieerd naar de OsmAnd gegevensmap) als SQLite database door diverse hulpprogramma\'s van derden. Instellingen om tracking en navigatie te kunnen gebruiken met het scherm uit (schakelt de GPS periodiek in). - "Maakt de toegankelijkheidsopties van het toestel rechtstreeks beschikbaar in OsmAnd. Hiermee kan o.a. de spreeksnelheid van tekst-naar-spraak-stemmen aangepast worden, D-pad schermnavigatie geconfigureerd worden, een trackball gebruikt worden voor de zoomregeling, of het gebruiken van meldingen via tekst-naar-spraak, bijvoorbeeld het automatisch melden van de positie." + Maakt de toegankelijkheidsopties van het toestel rechtstreeks beschikbaar in OsmAnd. Hiermee kan o.a. de spreeksnelheid van tekst-naar-spraak stemmen aangepast worden, D-pad schermnavigatie geconfigureerd worden, een trackball gebruikt worden voor de zoomregeling, of het gebruiken van meldingen via tekst-naar-spraak, bijvoorbeeld het automatisch melden van de positie. Deze plug-in toont de instellingen voor ontwikkel- en debug-opties, zoals routetest en -simulatie, schermweergave-prestaties, en spraaksturing. Deze instellingen zijn bedoeld voor programmeurs die OsmAnd willen verbeteren en zijn niet nodig voor normaal gebruik. Plugins beheren Schakel plugins in voor speciale functies en extra instellingen. @@ -750,7 +750,7 @@ OsmAnd is een open-source navigatiesysteem met online en offline kaarten OsmAnd (OSM Automated Navigation Directions) \n -\n OsmAnd is een open-source navigatie-app die toegang geeft tot een grote variëteit aan wereldwijde OSM-gegevens. Alle kaartgegevens (vector- of rasterkaarten) kunnen in het telefoongeheugen worden opgeslagen voor offline gebruik. OsmAnd biedt ook zowel offline als online routeaanwijzingen, met stembegeleiding. +\nOsmAnd is een open-source navigatie-app die toegang geeft tot een grote variëteit aan wereldwijde OSM-gegevens. Alle kaartgegevens (vector- of rasterkaarten) kunnen in het telefoongeheugen worden opgeslagen voor offline gebruik. OsmAnd biedt ook zowel offline als online routeaanwijzingen, met stembegeleiding. \n \n Enkele van de belangrijkste mogelijkheden: \n - Volledig offline gebruik (gedownloade vector- of rasterkaarten worden opgeslagen op het apparaat) @@ -767,9 +767,9 @@ \n \n Beperkingen van deze gratis versie van OsmAnd: \n - Beperkt aantal kaartdownloads -\n - Geen toegang tot offline Wikipedia POI\'s. +\n - Geen toegang tot offline Wikipedia POI\'s \n -\n OsmAnd wordt actief ontwikkeld en ons project en de verdere vooruitgang ervan is afhankelijk van +\nOsmAnd wordt actief ontwikkeld en ons project en de verdere vooruitgang ervan is afhankelijk van \nfinanciële bijdragen om de ontwikkeling en testen van nieuwe functionaliteit te kunnen bekostigen. \nWij verzoeken je om OsmAnd+ te kopen, of om een donatie over te maken via https://osmand.net. OsmAnd+ (OSM Automated Navigation Directions) @@ -1283,7 +1283,7 @@ Widgets Linker Kolom Kaart instellen Binnen - Anonieme gebruikesr kunnen geen + Anonieme gebruikers kunnen geen \n- groepen aanmaken; \n- groepen en apparaten synchroniseren met de server; \n- groepen en apparaten beheren in een eigen omgeving op de website. @@ -1437,7 +1437,7 @@ Start Stop Importeren - Export naar OSM + Exporteer naar OSM Meer… Meer acties Toon niet meer @@ -2285,10 +2285,10 @@ \n • Toon POIs (Points Of Interest) in uw omgeving \n • Draai de kaart in uw bewegingsrichting (of kompasrichting) \n • Toon uw positie en waar u naar kijkt -\n • Deel uw lokatie met vrienden +\n • Deel uw locatie met vrienden \n • Bewaar belangrijke plaatsen in ‘Favorieten’ \n • Toon namen in het Engels, de lokale taal, of fonetisch -\n • Toon extra online tiles, zoals een satellietfoto (van Bing), verschillende extra lagen zoals GPX-tracks voor navigatie e.d. met instelbare transparantie +\n • Toon extra online tegels, zoals een satellietfoto (van Bing), verschillende extra lagen zoals GPX-tracks voor navigatie e.d. met instelbare transparantie \n Skiën \nMet de OsmAnd Ski plug-in ziet u pistes met hun moeilijkheidsgraad, en extra informatie zoals liften en andere faciliteiten. @@ -2302,7 +2302,7 @@ \n • De kaart toont voetpaden en wandelpaden \n • Wikipedia kan je veel vertellen tijdens een stadswandeling, in je eigen taal \n • OV-haltes (tram, bus, trein, metro), inclusief lijnnummers, helpen je bij het reizen in een onbekende stad -\n • GPS-navigatie in voetgangermodus gebruikt voor het berekenen van de route voet- en wandelpaden +\n • GPS-navigatie in voetgangersmodus gebruikt voor het berekenen van de route voet- en wandelpaden \n • Upload en volg een GPX-route of neem er zelf één op en deel deze. \n Draag bij aan OpenStreetMap (OSM) @@ -2384,7 +2384,7 @@ \n • Kaart draaien in kompas- of bewegingsrichting \n • Bewaar belangrijke plaatsen in ‘Favorieten’. \n • Toon POI’s (points of interest) in de buurt -\n • Toon specifieke online tiles, satellietbeelden (van Bing), en extra lagen zoals GPX-tracks met rit-/routeinformatie e.d., met instelbare transparantie +\n • Toon specifieke online tegels, satellietbeelden (van Bing), en extra lagen zoals GPX-tracks met rit-/routeinformatie e.d., met instelbare transparantie \n • Toon plaatsnamen in het Engels, de lokale taal of fonetisch weergegeven \n Gebruik OSM- en Wikipedia-gegevens @@ -3235,7 +3235,7 @@ \'Freeride\' en \'Off-piste\' zijn officieuze routes en passages. Meestal onverzorgd en niet onderhouden, en niet \'s avonds gecontroleerd. Betreden op eigen risico. Verzamelde data Laatste OsmAnd uitvoering gecrasht. Help ons alstublieft OsmAnd te verbeteren door de foutmelding te delen. - Personal transporter + Persoonlijke transporteur Offroad WunderLINQ Wegtype @@ -3298,24 +3298,24 @@ Uitschakelen Nieuwe plug-in toegevoegd Segmenten samenvoegen - • App profiles: Create a custom profile for your own needs, with a custom icon and color -\n -\n • Nu aan te passen standaard en min / max snelheden voor elk profiel -\n -\n • Widget toegevoegd voor de huidige coördinaten -\n -\n • Opties toegevoegd om het kompas en een straalliniaal op de kaart te tonen -\n -\n • Fix background track logging -\n -\n • Improved background map downloads -\n -\n • \'Zet scherm aan\' optie is terug -\n -\n • Wikipedia taalkeuze aangepast -\n -\n • Vast kompasknop tijdens navigatie -\n + • App-profielen: maak een eigen profiel, met een aangepast pictogram en kleur +\n +\n • Nu aan te passen standaard en min / max snelheden voor elk profiel +\n +\n • Widget toegevoegd voor de huidige coördinaten +\n +\n • Opties toegevoegd om het kompas en een straalliniaal op de kaart te tonen +\n +\n • Trackregistratie op de achtergrond herstellen +\n +\n • Verbeterde downloads van achtergrondkaarten +\n +\n • \'Zet scherm aan\' optie is terug +\n +\n • Wikipedia taalkeuze aangepast +\n +\n • Vast kompasknop tijdens navigatie +\n \n • Andere fouten verholpen \n \n @@ -3567,7 +3567,7 @@ Vervang een ander punt door dit punt. Toerskiën Sneeuwscooter - Aangepaste OsmAnd-plug-in + Aangepaste OsmAnd plug-in Elementen Wijzigingen toegepast op het \'%1$s\'-profiel. Kon niet lezen van \'%1$s\'. @@ -3579,7 +3579,7 @@ Alle talen Om Wikipedia-POI’s op de kaart te tonen zijn extra kaarten nodig. Selecteer de talen voor Wikipedia-artikelen op de kaart. Tijdens het lezen van het artikel kan omgeschakeld worden naar een andere beschikbare taal. - Sommige Wikipedia-artikelen zijn mogelijk niet beschikbaar in de eigen taal. + Sommige Wikipedia-artikelen zijn mogelijk niet beschikbaar in je eigen taal. Kantonees Minnanyu Yoruba @@ -3624,8 +3624,8 @@ App-profiel wijzigingen Wereldoverzichtskaart (gedetailleerd) Niet ondersteund type - Geef de voertuigbreedte op, er zijn mogelijk routebeperkingen voor brede voertuigen. - Geef de voertuighoogte op, er zijn mogelijk routebeperkingen voor hoge voertuigen. + Geef de voertuigbreedte op, er zijn mogelijk routebeperkingen voor te brede voertuigen. + Geef de voertuighoogte op, er zijn mogelijk routebeperkingen voor te hoge voertuigen. Geef het voertuiggewicht op, er zijn mogelijk routebeperkingen voor zwaar verkeer. OsmAnd GPX is corrupt, neem contact op met het support team voor verder onderzoek. Altijd @@ -3636,7 +3636,7 @@ Scherm aanzetten bij elke routeaanwijzing. Routeaanwijzingen Uitgeschakeld. De instelling ‘Timeout na wakker worden’ moet ingesteld zijn op ‘Scherm aanlaten’. - Door op de aan/uit-knop te drukken gaat het scherm aan met OsmAnd op de voorgrond van het vergrendelscherm. + Door op de aan/uit knop te drukken gaat het scherm aan met OsmAnd op de voorgrond van het vergrendelde scherm. Aan/uit-knop Nabijheidssensor Selecteer de schermtimeout na wakker worden. (Kies “%1$s” om geen timeout te gebruiken.) @@ -3682,7 +3682,7 @@ Kies hoe gedownloade rasterkaartsegmenten worden opgeslagen. Geen overeenkomende profielen gevonden. Time-out van het scherm - Inschakelen om het zoomniveau van de kaart in te stellen met de volumeknoppen. + Regel het zoomniveau, van de kaart, met de volumeknop op het apparaat. Gebruik volumeknoppen om in en uit te zoomen Verkrijg informatie over POIs uit Wikipedia. Het is je offline reisgidsje - schakel de Wikipedia-plug-in in en geniet van artikelen over de bezienswaardigheden in je omgeving. Geef de voertuiglengte op, er zijn mogelijk routebeperkingen voor lange voertuigen. @@ -3704,10 +3704,10 @@ Selecteer dikte Toon start en aankomst pictogrammen Richtingaanwijzers - Het toegevoegde punt zal niet zichtbaar zijn op de kaart, aangezien de geselecteerde groep verborgen is, je kan het vinden in \"% s\". + Het toegevoegde punt zal niet zichtbaar zijn op de kaart, aangezien de geselecteerde groep verborgen is, je kan het vinden in \"%s\". Standaard Route tussen punten - "Vervolgens, zet uw track vast op de dichtstbijzijnde toegestane weg met een van uw navigatieprofielen om deze optie te gebruiken." + Vervolgens, zet uw track vast op de dichtstbijzijnde toegestane weg met een van uw navigatieprofielen om deze optie te gebruiken. %1$s gegevens alleen beschikbaar op de wegen, u moet een route berekenen met behulp van \"Route tussen punten\" om deze te krijgen. Selecteer hoe de punten verbonden worden, via een rechte lijn, of een route berekenen tussen de punten zoals hieronder aangegeven. Alleen het volgende segment wordt opnieuw berekend met het geselecteerde profiel. @@ -3744,7 +3744,7 @@ Alleen de routelijn wordt opgeslagen, de waypoints worden verwijderd. Bewaar Route omkeren - "Selecteer een track waaraan je een nieuw segment wil toevoegen." + Selecteer een track waaraan je een nieuw segment wil toevoegen. Selecteer een trackbestand om te openen. Weet u zeker dat u alle wijzigingen in de geplande route wilt annuleren door deze te sluiten\? Opsmukken voor @@ -3771,4 +3771,12 @@ Maak een nieuwe route Open een bestaande track Plan een route + Gebruik 2-fasen A* routeringsalgoritme + Grafiek + Wacht op de herberekening van de route. +\nDe grafiek is beschikbaar na herberekening. + %1$s — %2$s + Kies een trackbestand om te volgen of importeer het, vanaf uw apparaat. + Kloof + Op maat \ No newline at end of file From 2d4ea903787eda67f7696cd4c406d3c4f96566a3 Mon Sep 17 00:00:00 2001 From: Gilbert Lowel Date: Wed, 28 Oct 2020 14:58:27 +0000 Subject: [PATCH 24/60] Translated using Weblate (Dutch) Currently translated at 93.3% (253 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/nl/ --- OsmAnd-telegram/res/values-nl/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-telegram/res/values-nl/strings.xml b/OsmAnd-telegram/res/values-nl/strings.xml index b77535908e..ebddf36454 100644 --- a/OsmAnd-telegram/res/values-nl/strings.xml +++ b/OsmAnd-telegram/res/values-nl/strings.xml @@ -257,4 +257,8 @@ Afstand eenheden Definieer de eenheid voor snelheid. Eenheid van snelheid + Stuur rapport + Exporteer naar OSM + Logcat buffer + Controleer en deel gedetailleerde logs van de app \ No newline at end of file From 1a9f9229cf17ad436b62cf4b5b1432f97e6bc940 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 29 Oct 2020 13:19:32 +0200 Subject: [PATCH 25/60] Fix possible CursorWindowAllocationException --- .../src/net/osmand/plus/SQLiteTileSource.java | 21 ++++++------- .../osmand/plus/srtmplugin/TerrainLayer.java | 30 +++++++++---------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java index b3d7ceb144..da9af5dca9 100644 --- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java +++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java @@ -509,26 +509,27 @@ public class SQLiteTileSource implements ITileSource { if(db == null || coordinatesZoom > 25 ){ return null; } - SQLiteCursor q ; + SQLiteCursor cursor ; if (inversiveZoom) { int minZoom = (17 - minZ) + 1; // 17 - z = zoom, x << (25 - zoom) = 25th x tile = 8 + z, - q = db.rawQuery("SELECT max(x << (8+z)), min(x << (8+z)), max(y << (8+z)), min(y << (8+z))" + + cursor = db.rawQuery("SELECT max(x << (8+z)), min(x << (8+z)), max(y << (8+z)), min(y << (8+z))" + " from tiles where z < " + minZoom, new String[0]); } else { - q = db.rawQuery("SELECT max(x << (25-z)), min(x << (25-z)), max(y << (25-z)), min(y << (25-z))" + cursor = db.rawQuery("SELECT max(x << (25-z)), min(x << (25-z)), max(y << (25-z)), min(y << (25-z))" + " from tiles where z > " + minZ, new String[0]); } - q.moveToFirst(); - int right = (int) (q.getInt(0) >> (25 - coordinatesZoom)); - int left = (int) (q.getInt(1) >> (25 - coordinatesZoom)); - int top = (int) (q.getInt(3) >> (25 - coordinatesZoom)); - int bottom = (int) (q.getInt(2) >> (25 - coordinatesZoom)); + cursor.moveToFirst(); + int right = (int) (cursor.getInt(0) >> (25 - coordinatesZoom)); + int left = (int) (cursor.getInt(1) >> (25 - coordinatesZoom)); + int top = (int) (cursor.getInt(3) >> (25 - coordinatesZoom)); + int bottom = (int) (cursor.getInt(2) >> (25 - coordinatesZoom)); + + cursor.close(); + return new QuadRect(left, top, right, bottom); - - } public void deleteImage(int x, int y, int zoom) { diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainLayer.java b/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainLayer.java index 79e47de648..b58dc807a8 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainLayer.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainLayer.java @@ -35,7 +35,7 @@ import static net.osmand.plus.srtmplugin.TerrainMode.HILLSHADE; public class TerrainLayer extends MapTileLayer { private final static Log log = PlatformUtil.getLog(TerrainLayer.class); - private Map resources = new LinkedHashMap(); + private Map resources = new LinkedHashMap(); private final static String HILLSHADE_CACHE = "hillshade.cache"; private final static String SLOPE_CACHE = "slope.cache"; private int ZOOM_BOUNDARY = 15; @@ -68,7 +68,6 @@ public class TerrainLayer extends MapTileLayer { } else { // ignore } - } private void indexTerrainFiles(final OsmandApplication app) { @@ -77,7 +76,6 @@ public class TerrainLayer extends MapTileLayer { private String type = mode.name().toLowerCase(); @Override protected Void doInBackground(Void... params) { - File tilesDir = app.getAppPath(IndexConstants.TILES_INDEX_DIR); File cacheDir = app.getCacheDir(); // fix http://stackoverflow.com/questions/26937152/workaround-for-nexus-9-sqlite-file-write-operations-on-external-dirs @@ -91,17 +89,21 @@ public class TerrainLayer extends MapTileLayer { sqliteDb = null; } if (sqliteDb != null) { - if (sqliteDb.getVersion() == 0) { - sqliteDb.setVersion(1); - } - sqliteDb.execSQL("CREATE TABLE IF NOT EXISTS TILE_SOURCES(filename varchar2(256), date_modified int, left int, right int, top int, bottom int)"); + try { + if (sqliteDb.getVersion() == 0) { + sqliteDb.setVersion(1); + } + sqliteDb.execSQL("CREATE TABLE IF NOT EXISTS TILE_SOURCES(filename varchar2(256), date_modified int, left int, right int, top int, bottom int)"); - Map fileModified = new HashMap(); - Map rs = readFiles(app, tilesDir, fileModified); - indexCachedResources(fileModified, rs); - indexNonCachedResources(fileModified, rs); - sqliteDb.close(); - resources = rs; + Map fileModified = new HashMap(); + Map rs = readFiles(app, tilesDir, fileModified); + indexCachedResources(fileModified, rs); + indexNonCachedResources(fileModified, rs); + sqliteDb.close(); + resources = rs; + } catch (RuntimeException e) { + log.error(e.getMessage(), e); + } } return null; } @@ -150,7 +152,6 @@ public class TerrainLayer extends MapTileLayer { indexedResources.insert(filename, new QuadRect(left, top, right, bottom)); fileModified.remove(filename); } - } while(cursor.moveToNext()); } cursor.close(); @@ -172,7 +173,6 @@ public class TerrainLayer extends MapTileLayer { } return rs; } - }; executeTaskInBackground(task); } From a8560b8667e5ba704194ff49fdcf981d51d8d309 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 29 Oct 2020 14:35:26 +0200 Subject: [PATCH 26/60] Try to fix sound pools --- .../audionotes/AudioVideoNotesPlugin.java | 53 +++++++++++------ .../net/osmand/plus/routing/VoiceRouter.java | 57 +++++++++++++------ 2 files changed, 75 insertions(+), 35 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index c28b110c85..b8d4ef0c92 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -44,6 +44,7 @@ import net.osmand.IProgress; import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; +import net.osmand.StateChangedListener; import net.osmand.data.DataTileManager; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; @@ -158,7 +159,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { public static final int AV_CAMERA_FOCUS_CONTINUOUS = 5; // photo shot: private static int shotId = 0; - private SoundPool sp = null; + private SoundPool soundPool = null; public static final int FULL_SCEEN_RESULT_DELAY_MS = 3000; public final CommonPreference AV_CAMERA_PICTURE_SIZE; @@ -596,6 +597,17 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { @Override public boolean init(@NonNull final OsmandApplication app, Activity activity) { + if (AV_PHOTO_PLAY_SOUND.get()) { + loadCameraSound(); + } + AV_PHOTO_PLAY_SOUND.addListener(new StateChangedListener() { + @Override + public void stateChanged(Boolean change) { + if (AV_PHOTO_PLAY_SOUND.get() && soundPool == null) { + loadCameraSound(); + } + } + }); // initializeRemoteControlRegistrationMethods(); // AudioManager am = (AudioManager) app.getSystemService(Context.AUDIO_SERVICE); // if (am != null) { @@ -604,6 +616,21 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { return true; } + private void loadCameraSound() { + if (soundPool == null) { + soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); + } + if (shotId == 0) { + try { + AssetFileDescriptor assetFileDescriptor = app.getAssets().openFd("sounds/camera_click.ogg"); + shotId = soundPool.load(assetFileDescriptor, 1); + assetFileDescriptor.close(); + } catch (Exception e) { + log.error("cannot get shotId for sounds/camera_click.ogg"); + } + } + } + @Override public void registerLayers(MapActivity activity) { this.mapActivity = activity; @@ -1338,21 +1365,6 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { @Override public void surfaceCreated(SurfaceHolder holder) { try { - // load sound befor shot - if (AV_PHOTO_PLAY_SOUND.get()) { - if (sp == null) - sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); - if (shotId == 0) { - try { - AssetFileDescriptor assetFileDescriptor = app.getAssets().openFd("sounds/camera_click.ogg"); - shotId = sp.load(assetFileDescriptor, 1); - assetFileDescriptor.close(); - } catch (Exception e) { - log.error("cannot get shotId for sounds/camera_click.ogg"); - } - } - } - Parameters parameters = cam.getParameters(); parameters.setPictureSize(selectedCamPicSize.width, selectedCamPicSize.height); log.debug("takePhotoWithCamera() set Picture size: width=" + selectedCamPicSize.width @@ -1734,6 +1746,11 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { @Override public void disable(OsmandApplication app) { + if (soundPool != null) { + soundPool.release(); + soundPool = null; + shotId = 0; + } // AudioManager am = (AudioManager) app.getSystemService(Context.AUDIO_SERVICE); // if (am != null) { // unregisterMediaListener(am); @@ -2043,8 +2060,8 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { photoJpegData = data; if (AV_PHOTO_PLAY_SOUND.get()) { - if (sp != null && shotId != 0) { - sp.play(shotId, 0.7f, 0.7f, 0, 0, 1); + if (soundPool != null && shotId != 0) { + soundPool.play(shotId, 0.7f, 0.7f, 0, 0, 1); } } diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index b4cabfb389..4358938079 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -1,20 +1,22 @@ package net.osmand.plus.routing; +import android.content.res.AssetFileDescriptor; import android.media.AudioManager; import android.media.SoundPool; import net.osmand.Location; +import net.osmand.StateChangedListener; import net.osmand.binary.RouteDataObject; import net.osmand.data.PointDescription; -import net.osmand.plus.settings.backend.ApplicationMode; -import net.osmand.plus.settings.backend.OsmAndAppCustomization.OsmAndAppCustomizationListener; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper; import net.osmand.plus.routing.AlarmInfo.AlarmInfoType; import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo; import net.osmand.plus.routing.data.StreetName; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.OsmAndAppCustomization.OsmAndAppCustomizationListener; +import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.voice.AbstractPrologCommandPlayer; import net.osmand.plus.voice.CommandBuilder; import net.osmand.plus.voice.CommandPlayer; @@ -80,7 +82,10 @@ public class VoiceRouter { private int TURN_IN_DISTANCE; private int TURN_IN_DISTANCE_END; private int TURN_NOW_DISTANCE; - + + private SoundPool soundPool; + private int soundClick = -1; + private VoiceCommandPending pendingCommand = null; private RouteDirectionInfo nextRouteDirection; @@ -103,8 +108,36 @@ public class VoiceRouter { } }; app.getAppCustomization().addListener(customizationListener); + + if (!isMute()) { + loadCameraSound(); + } + settings.VOICE_MUTE.addListener(new StateChangedListener() { + @Override + public void stateChanged(Boolean change) { + if (!isMute() && soundPool == null) { + loadCameraSound(); + } + } + }); } - + + private void loadCameraSound() { + if (soundPool == null) { + soundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); + } + if (soundClick == -1) { + try { + // Taken unaltered from https://freesound.org/people/Corsica_S/sounds/91926/ under license http://creativecommons.org/licenses/by/3.0/ : + AssetFileDescriptor assetFileDescriptor = app.getAssets().openFd("sounds/ding.ogg"); + soundClick = soundPool.load(assetFileDescriptor, 1); + assetFileDescriptor.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + public void setPlayer(CommandPlayer player) { this.player = player; if (pendingCommand != null && player != null) { @@ -1015,18 +1048,8 @@ public class VoiceRouter { if (isMute()) { return; } - SoundPool sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); - int soundClick = -1; - boolean success = true; - try { - // Taken unaltered from https://freesound.org/people/Corsica_S/sounds/91926/ under license http://creativecommons.org/licenses/by/3.0/ : - soundClick = sp.load(settings.getContext().getAssets().openFd("sounds/ding.ogg"), 1); - } catch (IOException e) { - e.printStackTrace(); - success = false; - } - if (success) { - sp.play(soundClick, 1 ,1, 0, 0, 1); + if (soundPool != null && soundClick != -1) { + soundPool.play(soundClick, 1, 1, 0, 0, 1); } } From f1b1a471d036c91445dc6f1a2b13d1054251d614 Mon Sep 17 00:00:00 2001 From: Jan Backhaus Date: Thu, 29 Oct 2020 16:24:56 +0100 Subject: [PATCH 27/60] Added MGRS coordinates support in details, widget, extended search and quick search. --- .../main/java/net/osmand/LocationConvert.java | 1 + .../java/net/osmand/util/LocationParser.java | 20 +++- OsmAnd/res/layout/search_advanced_coords.xml | 46 +++++++ OsmAnd/res/layout/search_point.xml | 20 ++++ OsmAnd/res/values-de/strings.xml | 2 + OsmAnd/res/values/strings.xml | 3 + OsmAnd/res/xml/coordinates_format.xml | 6 + .../src/net/osmand/data/PointDescription.java | 13 +- .../src/net/osmand/plus/OsmAndFormatter.java | 5 + .../activities/NavigatePointFragment.java | 71 ++++++++--- .../plus/mapcontextmenu/MenuBuilder.java | 10 +- .../QuickSearchCoordinatesFragment.java | 113 +++++++++++++++--- .../fragments/CoordinatesFormatFragment.java | 44 +++++++ .../mapwidgets/MapInfoWidgetsFactory.java | 8 ++ 14 files changed, 318 insertions(+), 44 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/LocationConvert.java b/OsmAnd-java/src/main/java/net/osmand/LocationConvert.java index 0f4ec96883..88eb471840 100644 --- a/OsmAnd-java/src/main/java/net/osmand/LocationConvert.java +++ b/OsmAnd-java/src/main/java/net/osmand/LocationConvert.java @@ -15,6 +15,7 @@ public class LocationConvert { public static final int FORMAT_SECONDS = 2; public static final int UTM_FORMAT = 3; public static final int OLC_FORMAT = 4; + public static final int MGRS_FORMAT = 5; private static final char DELIM = ':'; private static final char DELIMITER_DEGREES = '°'; private static final char DELIMITER_MINUTES = '′'; diff --git a/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java b/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java index 100c4f014d..9e54bea347 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java @@ -3,6 +3,7 @@ package net.osmand.util; import com.google.openlocationcode.OpenLocationCode; import com.google.openlocationcode.OpenLocationCode.CodeArea; import com.jwetherell.openmap.common.LatLonPoint; +import com.jwetherell.openmap.common.MGRSPoint; import com.jwetherell.openmap.common.UTMPoint; import net.osmand.data.LatLon; @@ -111,7 +112,7 @@ public class LocationParser { return null; } // detect UTM - if (all.size() == 4 && d.size() == 3 && all.get(1) instanceof String) { + if (all.size() == 4 && d.size() == 3 && all.get(1) instanceof String && ((String) all.get(1)).length() == 1) { char ch = all.get(1).toString().charAt(0); if (Character.isLetter(ch)) { UTMPoint upoint = new UTMPoint(d.get(2), d.get(1), d.get(0).intValue(), ch); @@ -120,7 +121,7 @@ public class LocationParser { } } - if (all.size() == 3 && d.size() == 2 && all.get(1) instanceof String) { + if (all.size() == 3 && d.size() == 2 && all.get(1) instanceof String && ((String) all.get(1)).length() == 1) { char ch = all.get(1).toString().charAt(0); String combined = strings.get(2); if (Character.isLetter(ch)) { @@ -135,6 +136,21 @@ public class LocationParser { } } } + + //detect MGRS + if (all.size() >= 3 && (d.size() == 2 || d.size() == 3) && all.get(1) instanceof String) { + try { + StringBuilder s = new StringBuilder(); + for (String i : strings) { + s.append(i); + } + MGRSPoint mgrsPoint = new MGRSPoint(s.toString()); + LatLonPoint ll = mgrsPoint.toLatLonPoint(); + return validateAndCreateLatLon(ll.getLatitude(), ll.getLongitude()); + } catch (NumberFormatException e) { + //do nothing + } + } // try to find split lat/lon position int jointNumbers = 0; int lastJoin = 0; diff --git a/OsmAnd/res/layout/search_advanced_coords.xml b/OsmAnd/res/layout/search_advanced_coords.xml index 75b3ee5b4e..a93991c38b 100644 --- a/OsmAnd/res/layout/search_advanced_coords.xml +++ b/OsmAnd/res/layout/search_advanced_coords.xml @@ -324,6 +324,52 @@ + + + + + + + + + + + + + + + + + + + + + + + %1$s für die ersten %2$s Einstellungen für Profil: OsmAnd verwendet den UTM-Standard, der ähnlich, aber nicht identisch zum UTM-NATO-Format ist. + OsmAnd verwendet MGRS, das identisch zum UTM-NATO-Format ist. Beispiel UTM-Standard + MGRS Das gewählte Format wird in der gesamten App angewandt. Für Profile wird als Vorgabe diese Einstellung gewählt: %s Einstellung ändern diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index d5287d60bb..7861393b31 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -628,8 +628,10 @@ Configure profile Settings for profile: OsmAnd uses the UTM Standard, which is similar but not identical to the UTM NATO format. + OsmAnd uses MGRS, which is similar to the UTM NATO format. Example UTM Standard + MGRS Open Location Code The selected format will be applied throughout the app. This setting is selected by default for profiles: %s @@ -2209,6 +2211,7 @@ Map language Transport stops Zone + MGRS Open Location Code Invalid OLC\n diff --git a/OsmAnd/res/xml/coordinates_format.xml b/OsmAnd/res/xml/coordinates_format.xml index 083f42182b..6f2635e71f 100644 --- a/OsmAnd/res/xml/coordinates_format.xml +++ b/OsmAnd/res/xml/coordinates_format.xml @@ -27,6 +27,12 @@ android:persistent="false" android:title="@string/navigate_point_format_utm" /> + + 0 && lon.length() > 0) { @@ -152,23 +153,52 @@ public class NavigatePointFragment extends Fragment implements SearchActivityChi protected void showCurrentFormat(LatLon l) { final EditText latEdit = ((EditText)view.findViewById(R.id.LatitudeEdit)); final EditText lonEdit = ((EditText)view.findViewById(R.id.LongitudeEdit)); - boolean utm = currentFormat == PointDescription.UTM_FORMAT; - view.findViewById(R.id.easting_row).setVisibility(utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.northing_row).setVisibility(utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.zone_row).setVisibility(utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.lat_row).setVisibility(!utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.lon_row).setVisibility(!utm ? View.VISIBLE : View.GONE); - if(currentFormat == PointDescription.UTM_FORMAT) { - final EditText northingEdit = ((EditText)view.findViewById(R.id.NorthingEdit)); - final EditText eastingEdit = ((EditText)view.findViewById(R.id.EastingEdit)); - final EditText zoneEdit = ((EditText)view.findViewById(R.id.ZoneEdit)); - UTMPoint pnt = new UTMPoint(new LatLonPoint(l.getLatitude(), l.getLongitude())); - zoneEdit.setText(pnt.zone_number + ""+pnt.zone_letter); - northingEdit.setText(((long)pnt.northing)+""); - eastingEdit.setText(((long)pnt.easting)+""); - } else { - latEdit.setText(LocationConvert.convert(MapUtils.checkLatitude(l.getLatitude()), currentFormat)); - lonEdit.setText(LocationConvert.convert(MapUtils.checkLongitude(l.getLongitude()), currentFormat)); + switch (currentFormat){ + case PointDescription.UTM_FORMAT: { + view.findViewById(R.id.easting_row).setVisibility(View.VISIBLE); + view.findViewById(R.id.northing_row).setVisibility(View.VISIBLE); + view.findViewById(R.id.zone_row).setVisibility(View.VISIBLE); + view.findViewById(R.id.lat_row).setVisibility(View.GONE); + view.findViewById(R.id.lon_row).setVisibility(View.GONE); + view.findViewById(R.id.mgrs_row).setVisibility(View.GONE); + + final EditText northingEdit = ((EditText) view.findViewById(R.id.NorthingEdit)); + final EditText eastingEdit = ((EditText) view.findViewById(R.id.EastingEdit)); + final EditText zoneEdit = ((EditText) view.findViewById(R.id.ZoneEdit)); + UTMPoint pnt = new UTMPoint(new LatLonPoint(l.getLatitude(), l.getLongitude())); + zoneEdit.setText(pnt.zone_number + "" + pnt.zone_letter); + northingEdit.setText(((long) pnt.northing) + ""); + eastingEdit.setText(((long) pnt.easting) + ""); + break; + } + + case PointDescription.MGRS_FORMAT: { + view.findViewById(R.id.easting_row).setVisibility(View.GONE); + view.findViewById(R.id.northing_row).setVisibility(View.GONE); + view.findViewById(R.id.zone_row).setVisibility(View.GONE); + view.findViewById(R.id.lat_row).setVisibility(View.GONE); + view.findViewById(R.id.lon_row).setVisibility(View.GONE); + view.findViewById(R.id.mgrs_row).setVisibility(View.VISIBLE); + + final EditText mgrsEdit = ((EditText) view.findViewById(R.id.MGRSEdit)); + MGRSPoint pnt = new MGRSPoint(new LatLonPoint(l.getLatitude(), l.getLongitude())); + mgrsEdit.setText(pnt.toString()); + break; + } + + default: { + view.findViewById(R.id.easting_row).setVisibility(View.GONE); + view.findViewById(R.id.northing_row).setVisibility(View.GONE); + view.findViewById(R.id.zone_row).setVisibility(View.GONE); + view.findViewById(R.id.lat_row).setVisibility(View.VISIBLE); + view.findViewById(R.id.lon_row).setVisibility(View.VISIBLE); + view.findViewById(R.id.mgrs_row).setVisibility(View.GONE); + + + latEdit.setText(LocationConvert.convert(MapUtils.checkLatitude(l.getLatitude()), currentFormat)); + lonEdit.setText(LocationConvert.convert(MapUtils.checkLongitude(l.getLongitude()), currentFormat)); + } + } } @@ -199,6 +229,7 @@ public class NavigatePointFragment extends Fragment implements SearchActivityChi PointDescription.formatToHumanString(this.getContext(), PointDescription.FORMAT_MINUTES), PointDescription.formatToHumanString(this.getContext(), PointDescription.FORMAT_SECONDS), PointDescription.formatToHumanString(this.getContext(), PointDescription.UTM_FORMAT), + PointDescription.formatToHumanString(this.getContext(), PointDescription.MGRS_FORMAT), }); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); format.setAdapter(adapter); @@ -217,6 +248,8 @@ public class NavigatePointFragment extends Fragment implements SearchActivityChi newFormat = PointDescription.FORMAT_SECONDS; } else if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.UTM_FORMAT).equals(itm)) { newFormat = PointDescription.UTM_FORMAT; + } else if (PointDescription.formatToHumanString(NavigatePointFragment.this.getContext(), PointDescription.MGRS_FORMAT).equals(itm)) { + newFormat = PointDescription.MGRS_FORMAT; } try { LatLon loc = parseLocation(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 00d0a8cc20..e18beeeb01 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -676,9 +676,15 @@ public class MenuBuilder { LinearLayout llv = buildCollapsableContentView(mapActivity, true, true); for (final Map.Entry line : locationData.entrySet()) { final TextViewEx button = buildButtonInCollapsableView(mapActivity, false, false); - if (line.getKey() == OsmAndFormatter.UTM_FORMAT || line.getKey() == OsmAndFormatter.OLC_FORMAT) { + if (line.getKey() == OsmAndFormatter.UTM_FORMAT || line.getKey() == OsmAndFormatter.OLC_FORMAT || line.getKey() == OsmAndFormatter.MGRS_FORMAT) { SpannableStringBuilder ssb = new SpannableStringBuilder(); - ssb.append(line.getKey() == OsmAndFormatter.UTM_FORMAT ? "UTM: " : "OLC: "); + if (line.getKey() == OsmAndFormatter.UTM_FORMAT) { + ssb.append("UTM: "); + } else if (line.getKey() == OsmAndFormatter.MGRS_FORMAT) { + ssb.append("MGRS: "); + } else if (line.getKey() == OsmAndFormatter.OLC_FORMAT){ + ssb.append("OLC: "); + } ssb.setSpan(new ForegroundColorSpan(app.getResources().getColor(R.color.text_color_secondary_light)), 0, 4, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); ssb.append(line.getValue()); button.setText(ssb); diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java index 902f4bea4b..251a2a4227 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java @@ -29,6 +29,7 @@ import androidx.fragment.app.DialogFragment; import com.google.openlocationcode.OpenLocationCode; import com.jwetherell.openmap.common.LatLonPoint; +import com.jwetherell.openmap.common.MGRSPoint; import com.jwetherell.openmap.common.UTMPoint; import net.osmand.AndroidUtils; @@ -73,6 +74,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os private static final String QUICK_SEARCH_COORDS_NORTH_KEY = "quick_search_coords_north_key"; private static final String QUICK_SEARCH_COORDS_EAST_KEY = "quick_search_coords_east_key"; private static final String QUICK_SEARCH_COORDS_ZONE_KEY = "quick_search_coords_zone_key"; + private static final String QUICK_SEARCH_COORDS_MGRS_KEY = "quick_search_coords_mgrs_key"; private static final String QUICK_SEARCH_COORDS_OLC_KEY = "quick_search_coords_olc_key"; private static final String QUICK_SEARCH_COORDS_OLC_INFO_KEY = "quick_search_coords_olc_info_key"; private static final String QUICK_SEARCH_COORDS_FORMAT_KEY = "quick_search_coords_format_key"; @@ -89,6 +91,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os private EditText northingEdit; private EditText eastingEdit; private EditText zoneEdit; + private EditText mgrsEdit; private EditText olcEdit; private TextView olcInfo; private EditText formatEdit; @@ -153,6 +156,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os northingEdit = ((EditText) view.findViewById(R.id.northingEditText)); eastingEdit = ((EditText) view.findViewById(R.id.eastingEditText)); zoneEdit = ((EditText) view.findViewById(R.id.zoneEditText)); + mgrsEdit = ((EditText) view.findViewById(R.id.mgrsEditText)); olcEdit = ((EditText) view.findViewById(R.id.olcEditText)); olcInfo = ((TextView) view.findViewById(R.id.olcInfoTextView)); formatEdit = ((EditText) view.findViewById(R.id.formatEditText)); @@ -160,6 +164,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os String defaultLat = ""; String defaultZone = ""; + String defaultMgrs = ""; String defaultOlc = ""; boolean coordinatesApplied = false; if (getArguments() != null) { @@ -167,6 +172,8 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os if (!Algorithms.isEmpty(text)) { if (currentFormat == PointDescription.UTM_FORMAT) { defaultZone = text.trim(); + } else if (currentFormat == PointDescription.MGRS_FORMAT) { + defaultMgrs = text.trim(); } else if (currentFormat == PointDescription.OLC_FORMAT) { defaultOlc = text.trim(); } else { @@ -188,6 +195,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os String northingStr = getStringValue(savedInstanceState, QUICK_SEARCH_COORDS_NORTH_KEY, ""); String eastingStr = getStringValue(savedInstanceState, QUICK_SEARCH_COORDS_EAST_KEY, ""); String zoneStr = getStringValue(savedInstanceState, QUICK_SEARCH_COORDS_ZONE_KEY, defaultZone); + String mgrsStr = getStringValue(savedInstanceState, QUICK_SEARCH_COORDS_MGRS_KEY, defaultMgrs); String olcStr = getStringValue(savedInstanceState, QUICK_SEARCH_COORDS_OLC_KEY, defaultOlc); String olcInfoStr = getStringValue(savedInstanceState, QUICK_SEARCH_COORDS_OLC_INFO_KEY, defaultOlc); @@ -209,6 +217,8 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os eastingEdit.setSelection(eastingStr.length()); zoneEdit.setText(zoneStr); zoneEdit.setSelection(zoneStr.length()); + mgrsEdit.setText(mgrsStr); + mgrsEdit.setSelection(mgrsStr.length()); olcEdit.setText(olcStr); olcEdit.setSelection(olcStr.length()); olcInfo.setText(olcInfoStr); @@ -242,6 +252,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os northingEdit.addTextChangedListener(textWatcher); eastingEdit.addTextChangedListener(textWatcher); zoneEdit.addTextChangedListener(textWatcher); + mgrsEdit.addTextChangedListener(textWatcher); olcEdit.addTextChangedListener(textWatcher); OnEditorActionListener doneListener = new OnEditorActionListener() { @@ -258,6 +269,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os lonEdit.setOnEditorActionListener(doneListener); zoneEdit.setOnEditorActionListener(doneListener); + mgrsEdit.setOnEditorActionListener(doneListener); olcEdit.setOnEditorActionListener(doneListener); UiUtilities ic = app.getUIUtilities(); @@ -318,6 +330,15 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os olcEdit.setText(""); } }); + ImageButton mgrsClearButton = (ImageButton) view.findViewById(R.id.mgrsClearButton); + mgrsClearButton.setImageDrawable(ic.getThemedIcon(R.drawable.ic_action_remove_dark)); + mgrsClearButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + mgrsEdit.setText(""); + } + }); + ImageButton formatSelectButton = (ImageButton) view.findViewById(R.id.formatSelectButton); formatSelectButton.setImageDrawable(ic.getThemedIcon(R.drawable.ic_action_arrow_drop_down)); formatSelectButton.setOnClickListener(new View.OnClickListener() { @@ -364,6 +385,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os final TextView northEdit = ((TextView) view.findViewById(R.id.northingEditText)); final TextView eastEdit = ((TextView) view.findViewById(R.id.eastingEditText)); final TextView zoneEdit = ((TextView) view.findViewById(R.id.zoneEditText)); + final TextView mgrsEdit = ((TextView) view.findViewById(R.id.mgrsEditText)); final TextView olcEdit = ((TextView) view.findViewById(R.id.olcEditText)); final TextView olcInfo = ((TextView) view.findViewById(R.id.olcInfoTextView)); outState.putString(QUICK_SEARCH_COORDS_LAT_KEY, latEdit.getText().toString()); @@ -371,6 +393,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os outState.putString(QUICK_SEARCH_COORDS_NORTH_KEY, northEdit.getText().toString()); outState.putString(QUICK_SEARCH_COORDS_EAST_KEY, eastEdit.getText().toString()); outState.putString(QUICK_SEARCH_COORDS_ZONE_KEY, zoneEdit.getText().toString()); + outState.putString(QUICK_SEARCH_COORDS_MGRS_KEY, mgrsEdit.getText().toString()); outState.putString(QUICK_SEARCH_COORDS_OLC_KEY, olcEdit.getText().toString()); outState.putString(QUICK_SEARCH_COORDS_OLC_INFO_KEY, olcInfo.getText().toString()); } @@ -470,23 +493,52 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os } private void updateControlsVisibility() { - if (currentFormat == PointDescription.OLC_FORMAT) { - view.findViewById(R.id.eastingLayout).setVisibility(View.GONE); - view.findViewById(R.id.northingLayout).setVisibility(View.GONE); - view.findViewById(R.id.zoneLayout).setVisibility(View.GONE); - view.findViewById(R.id.olcLayout).setVisibility(View.VISIBLE); - view.findViewById(R.id.olcInfoLayout).setVisibility(View.VISIBLE); - view.findViewById(R.id.latitudeLayout).setVisibility(View.GONE); - view.findViewById(R.id.longitudeLayout).setVisibility(View.GONE); - } else { - boolean utm = currentFormat == PointDescription.UTM_FORMAT; - view.findViewById(R.id.eastingLayout).setVisibility(utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.northingLayout).setVisibility(utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.zoneLayout).setVisibility(utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.olcLayout).setVisibility(View.GONE); - view.findViewById(R.id.olcInfoLayout).setVisibility(View.GONE); - view.findViewById(R.id.latitudeLayout).setVisibility(!utm ? View.VISIBLE : View.GONE); - view.findViewById(R.id.longitudeLayout).setVisibility(!utm ? View.VISIBLE : View.GONE); + switch (currentFormat){ + + case PointDescription.OLC_FORMAT: { + view.findViewById(R.id.eastingLayout).setVisibility(View.GONE); + view.findViewById(R.id.northingLayout).setVisibility(View.GONE); + view.findViewById(R.id.zoneLayout).setVisibility(View.GONE); + view.findViewById(R.id.olcLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.olcInfoLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.latitudeLayout).setVisibility(View.GONE); + view.findViewById(R.id.longitudeLayout).setVisibility(View.GONE); + view.findViewById(R.id.mgrsLayout).setVisibility(View.GONE); + break; + } + case PointDescription.UTM_FORMAT: { + view.findViewById(R.id.eastingLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.northingLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.zoneLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.olcLayout).setVisibility(View.GONE); + view.findViewById(R.id.olcInfoLayout).setVisibility(View.GONE); + view.findViewById(R.id.latitudeLayout).setVisibility(View.GONE); + view.findViewById(R.id.longitudeLayout).setVisibility(View.GONE); + view.findViewById(R.id.mgrsLayout).setVisibility(View.GONE); + break; + } + case PointDescription.MGRS_FORMAT: { + view.findViewById(R.id.eastingLayout).setVisibility(View.GONE); + view.findViewById(R.id.northingLayout).setVisibility(View.GONE); + view.findViewById(R.id.zoneLayout).setVisibility(View.GONE); + view.findViewById(R.id.olcLayout).setVisibility(View.GONE); + view.findViewById(R.id.olcInfoLayout).setVisibility(View.GONE); + view.findViewById(R.id.latitudeLayout).setVisibility(View.GONE); + view.findViewById(R.id.longitudeLayout).setVisibility(View.GONE); + view.findViewById(R.id.mgrsLayout).setVisibility(View.VISIBLE); + break; + } + default: { + view.findViewById(R.id.eastingLayout).setVisibility(View.GONE); + view.findViewById(R.id.northingLayout).setVisibility(View.GONE); + view.findViewById(R.id.zoneLayout).setVisibility(View.GONE); + view.findViewById(R.id.olcLayout).setVisibility(View.GONE); + view.findViewById(R.id.olcInfoLayout).setVisibility(View.GONE); + view.findViewById(R.id.latitudeLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.longitudeLayout).setVisibility(View.VISIBLE); + view.findViewById(R.id.mgrsLayout).setVisibility(View.GONE); + break; + } } } @@ -544,11 +596,24 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os zoneEdit.setText(olcEdit.getText()); northingEdit.setText(""); eastingEdit.setText(""); + } else if (prevFormat == PointDescription.MGRS_FORMAT) { + zoneEdit.setText(mgrsEdit.getText()); + northingEdit.setText(""); + eastingEdit.setText(""); } else { zoneEdit.setText(latEdit.getText()); northingEdit.setText(""); eastingEdit.setText(""); } + } else if (currentFormat == PointDescription.MGRS_FORMAT) { + final EditText mgrsEdit = ((EditText) view.findViewById(R.id.mgrsEditText)); + if (latLon != null) { + MGRSPoint pnt = new MGRSPoint(new LatLonPoint(latLon.getLatitude(), latLon.getLongitude())); + mgrsEdit.setText(pnt.toString()); + } else { + mgrsEdit.setText(latEdit.getText()); + + } } else if (currentFormat == PointDescription.OLC_FORMAT) { if (latLon != null) { String olc = OpenLocationCode.encode(latLon.getLatitude(), latLon.getLongitude()); @@ -557,6 +622,9 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os } else if (prevFormat == PointDescription.UTM_FORMAT) { olcEdit.setText(zoneEdit.getText()); olcInfo.setText(provideOlcInfo(olcEdit.getText().toString())); + } else if (prevFormat == PointDescription.MGRS_FORMAT) { + olcEdit.setText(mgrsEdit.getText()); + olcInfo.setText(provideOlcInfo(olcEdit.getText().toString())); } else { olcEdit.setText(latEdit.getText()); olcInfo.setText(provideOlcInfo(olcEdit.getText().toString())); @@ -568,6 +636,9 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os } else if (prevFormat == PointDescription.UTM_FORMAT) { latEdit.setText(zoneEdit.getText()); lonEdit.setText(""); + } else if (prevFormat == PointDescription.MGRS_FORMAT) { + latEdit.setText(mgrsEdit.getText()); + lonEdit.setText(""); } else if (prevFormat == PointDescription.OLC_FORMAT) { latEdit.setText(olcEdit.getText()); lonEdit.setText(""); @@ -591,6 +662,11 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os UTMPoint upoint = new UTMPoint(northing, easting, z, c); LatLonPoint ll = upoint.toLatLonPoint(); loc = new LatLon(ll.getLatitude(), ll.getLongitude()); + } else if (currentFormat == LocationConvert.MGRS_FORMAT) { + String mgrs = (mgrsEdit.getText().toString()); + MGRSPoint upoint = new MGRSPoint(mgrs); + LatLonPoint ll = upoint.toLatLonPoint(); + loc = new LatLon(ll.getLatitude(), ll.getLongitude()); } else if (currentFormat == LocationConvert.OLC_FORMAT) { String olcText = olcEdit.getText().toString(); olcInfo.setText(provideOlcInfo(olcText)); @@ -851,12 +927,13 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os @Override public Dialog onCreateDialog(Bundle savedInstanceState) { final QuickSearchCoordinatesFragment parent = (QuickSearchCoordinatesFragment) getParentFragment(); - String[] entries = new String[5]; + String[] entries = new String[6]; entries[0] = PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_DEGREES); entries[1] = PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_MINUTES); entries[2] = PointDescription.formatToHumanString(getContext(), PointDescription.FORMAT_SECONDS); entries[3] = PointDescription.formatToHumanString(getContext(), PointDescription.UTM_FORMAT); entries[4] = PointDescription.formatToHumanString(getContext(), PointDescription.OLC_FORMAT); + entries[5] = PointDescription.formatToHumanString(getContext(), PointDescription.MGRS_FORMAT); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.coords_format) diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/CoordinatesFormatFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/CoordinatesFormatFragment.java index 51b5d817a0..fd62f6df3c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/CoordinatesFormatFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/CoordinatesFormatFragment.java @@ -31,11 +31,13 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { public static final String TAG = CoordinatesFormatFragment.class.getSimpleName(); private static final String UTM_FORMAT_WIKI_LINK = "https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system"; + private static final String MGRS_FORMAT_WIKI_LINK = "https://en.wikipedia.org/wiki/Military_Grid_Reference_System"; private static final String FORMAT_DEGREES = "format_degrees"; private static final String FORMAT_MINUTES = "format_minutes"; private static final String FORMAT_SECONDS = "format_seconds"; private static final String UTM_FORMAT = "utm_format"; + private static final String MGRS_FORMAT = "mgrs_format"; private static final String OLC_FORMAT = "olc_format"; @Override @@ -44,6 +46,7 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { CheckBoxPreference minutesPref = (CheckBoxPreference) findPreference(FORMAT_MINUTES); CheckBoxPreference secondsPref = (CheckBoxPreference) findPreference(FORMAT_SECONDS); CheckBoxPreference utmPref = (CheckBoxPreference) findPreference(UTM_FORMAT); + CheckBoxPreference mgrsPref = (CheckBoxPreference) findPreference(MGRS_FORMAT); CheckBoxPreference olcPref = (CheckBoxPreference) findPreference(OLC_FORMAT); Location loc = app.getLocationProvider().getLastKnownLocation(); @@ -52,6 +55,7 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { minutesPref.setSummary(getCoordinatesFormatSummary(loc, PointDescription.FORMAT_MINUTES)); secondsPref.setSummary(getCoordinatesFormatSummary(loc, PointDescription.FORMAT_SECONDS)); utmPref.setSummary(getCoordinatesFormatSummary(loc, PointDescription.UTM_FORMAT)); + mgrsPref.setSummary(getCoordinatesFormatSummary(loc, PointDescription.MGRS_FORMAT)); olcPref.setSummary(getCoordinatesFormatSummary(loc, PointDescription.OLC_FORMAT)); int currentFormat = settings.COORDINATES_FORMAT.getModeValue(getSelectedAppMode()); @@ -69,6 +73,12 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { summaryView.setOnTouchListener(new ClickableSpanTouchListener()); } } + if (MGRS_FORMAT.equals(preference.getKey())) { + TextView summaryView = (TextView) holder.findViewById(android.R.id.summary); + if (summaryView != null) { + summaryView.setOnTouchListener(new ClickableSpanTouchListener()); + } + } } private CharSequence getCoordinatesFormatSummary(Location loc, int format) { @@ -106,6 +116,36 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { return spannableBuilder; } + if (format == PointDescription.MGRS_FORMAT) { + SpannableStringBuilder spannableBuilder = new SpannableStringBuilder(); + String combined = getString(R.string.ltr_or_rtl_combine_via_colon, getString(R.string.shared_string_example), formattedCoordinates); + spannableBuilder.append(combined); + spannableBuilder.append("\n"); + spannableBuilder.append(getString(R.string.mgrs_format_descr)); + + int start = spannableBuilder.length(); + spannableBuilder.append(" "); + spannableBuilder.append(getString(R.string.shared_string_read_more)); + + ClickableSpan clickableSpan = new ClickableSpan() { + @Override + public void onClick(@NonNull View widget) { + Context ctx = getContext(); + if (ctx != null) { + WikipediaDialogFragment.showFullArticle(ctx, Uri.parse(MGRS_FORMAT_WIKI_LINK), isNightMode()); + } + } + + @Override + public void updateDrawState(@NonNull TextPaint ds) { + super.updateDrawState(ds); + ds.setUnderlineText(false); + } + }; + spannableBuilder.setSpan(clickableSpan, start, spannableBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + + return spannableBuilder; + } return getString(R.string.ltr_or_rtl_combine_via_colon, getString(R.string.shared_string_example), formattedCoordinates); } @@ -159,6 +199,8 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { return PointDescription.FORMAT_SECONDS; case UTM_FORMAT: return PointDescription.UTM_FORMAT; + case MGRS_FORMAT: + return PointDescription.MGRS_FORMAT; case OLC_FORMAT: return PointDescription.OLC_FORMAT; default: @@ -176,6 +218,8 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { return FORMAT_SECONDS; case PointDescription.UTM_FORMAT: return UTM_FORMAT; + case PointDescription.MGRS_FORMAT: + return MGRS_FORMAT; case PointDescription.OLC_FORMAT: return OLC_FORMAT; default: diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index 565fb872c0..b89ef5fa50 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -33,6 +33,7 @@ import androidx.core.graphics.drawable.DrawableCompat; import com.google.android.material.snackbar.Snackbar; import com.jwetherell.openmap.common.LatLonPoint; +import com.jwetherell.openmap.common.MGRSPoint; import com.jwetherell.openmap.common.UTMPoint; import net.osmand.AndroidUtils; @@ -1251,6 +1252,13 @@ public class MapInfoWidgetsFactory { UTMPoint pnt = new UTMPoint(new LatLonPoint(lat, lon)); String utmLocation = pnt.zone_number + "" + pnt.zone_letter + " " + ((long) pnt.easting) + " " + ((long) pnt.northing); latitudeText.setText(utmLocation); + } else if (f == PointDescription.MGRS_FORMAT) { + AndroidUiHelper.updateVisibility(lonCoordinatesContainer, false); + AndroidUiHelper.updateVisibility(coordinatesDivider, false); + AndroidUiHelper.updateVisibility(latitudeIcon, true); + latitudeIcon.setImageDrawable(iconsCache.getIcon(nightMode ? R.drawable.widget_coordinates_utm_night : R.drawable.widget_coordinates_utm_day)); + MGRSPoint pnt = new MGRSPoint(new LatLonPoint(lat, lon)); + latitudeText.setText(pnt.toString()); } else if (f == PointDescription.OLC_FORMAT) { AndroidUiHelper.updateVisibility(lonCoordinatesContainer, false); AndroidUiHelper.updateVisibility(coordinatesDivider, false); From 436630c1e24a96b9929766ee9eeb5861d83ebc32 Mon Sep 17 00:00:00 2001 From: Jan Backhaus Date: Thu, 29 Oct 2020 16:34:09 +0100 Subject: [PATCH 28/60] Added support for MGRS string flavoring for better readability ("32U PC 05573 97153" instead of "32UPC0557397153"). Dynamically adjustable accuracy included (also with letter overrolling correction on rounding). --- .../jwetherell/openmap/common/MGRSPoint.java | 95 +++++++++++++++++++ .../src/net/osmand/plus/OsmAndFormatter.java | 2 +- .../activities/NavigatePointFragment.java | 2 +- .../QuickSearchCoordinatesFragment.java | 2 +- .../mapwidgets/MapInfoWidgetsFactory.java | 2 +- 5 files changed, 99 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java b/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java index 8cbb306b7e..a39c5af336 100644 --- a/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java +++ b/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java @@ -14,6 +14,10 @@ package com.jwetherell.openmap.common; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + public class MGRSPoint extends ZonedUTMPoint { /** @@ -633,6 +637,97 @@ public class MGRSPoint extends ZonedUTMPoint { return twoLetter; } + public String toFlavoredString() { + try { + List all = new ArrayList<>(); + for (int i = 0; i <= mgrs.length(); i++) { + if (Character.isAlphabetic(mgrs.charAt(i))){ + all.add(mgrs.substring(0,i+1)); + all.add(mgrs.substring(i+1,i+3)); + String remains = mgrs.substring(i+3); + all.add(remains.substring(0,remains.length()/2)); + all.add(remains.substring(remains.length()/2)); + break; + } + } + StringBuilder os = new StringBuilder(); + for(String part: all){ + if (os.length() > 0) os.append(" "); + os.append(part); + } + return os.toString(); + }catch (Exception e){ + return mgrs; + } + } + + public String toFlavoredString(int accuracy) { + try { + List all = new ArrayList<>(); + for (int i = 0; i <= mgrs.length(); i++) { + if (Character.isAlphabetic(mgrs.charAt(i))){ + all.add(mgrs.substring(0,i+1)); + all.add(mgrs.substring(i+1,i+3)); + String remains = mgrs.substring(i+3); + int easting = Integer.parseInt(remains.substring(0,remains.length()/2)); + int northing = Integer.parseInt(remains.substring(remains.length()/2)); + double resolution = Math.pow(10, getAccuracy() - accuracy); + long roundedEasting = Math.round(easting/resolution); + long roundedNorthing = Math.round(northing/resolution); + int eastShift = 0; + int northShift = 0; + if (roundedEasting == resolution*10){ + roundedEasting = 0L; + eastShift = 1; + } + if (roundedNorthing == resolution*10){ + roundedNorthing = 0L; + northShift = 1; + } + if (eastShift != 0 || northShift != 0){ + all.set(1, shiftChar(all.get(1), eastShift, northShift)); + String zero = ""; + } + + + all.add(String.format("%0" + accuracy + "d", roundedEasting)); + all.add(String.format("%0" + accuracy + "d", roundedNorthing)); + break; + } + } + StringBuilder os = new StringBuilder(); + for(String part: all){ + if (os.length() > 0) os.append(" "); + os.append(part); + } + return os.toString(); + }catch (Exception e){ + return toFlavoredString(); + } + } + + private static String shiftChar(String chars, int east, int north){ + ArrayList keys = new ArrayList( + Arrays.asList('A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z')); + StringBuilder s = new StringBuilder(); + if (east != 0){ + int idx = keys.indexOf(chars.charAt(0)); + idx += east; + if (idx >= keys.size()) idx -= keys.size(); + if (idx < 0) idx += keys.size(); + s.append(keys.get(idx)); + }else s.append(chars.charAt(0)); + if (north != 0){ + int idx = keys.indexOf(chars.charAt(1)); + idx += north; + if (idx >= keys.size()) idx -= keys.size(); + if (idx < 0) idx += keys.size(); + s.append(keys.get(idx)); + }else s.append(chars.charAt(1)); + return s.toString(); + } + + /** * {@inheritDoc} */ diff --git a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java index 8ec817900b..f9d3315bf5 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java @@ -522,7 +522,7 @@ public class OsmAndFormatter { result.append(r); } else if (outputFormat == MGRS_FORMAT) { MGRSPoint pnt = new MGRSPoint(new LatLonPoint(lat, lon)); - result.append(pnt.toString()); + result.append(pnt.toFlavoredString(5)); } return result.toString(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java index 1f484e7b22..7b0ca4c17c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java @@ -182,7 +182,7 @@ public class NavigatePointFragment extends Fragment implements SearchActivityChi final EditText mgrsEdit = ((EditText) view.findViewById(R.id.MGRSEdit)); MGRSPoint pnt = new MGRSPoint(new LatLonPoint(l.getLatitude(), l.getLongitude())); - mgrsEdit.setText(pnt.toString()); + mgrsEdit.setText(pnt.toFlavoredString(5)); break; } diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java index 251a2a4227..409f38b319 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java @@ -609,7 +609,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os final EditText mgrsEdit = ((EditText) view.findViewById(R.id.mgrsEditText)); if (latLon != null) { MGRSPoint pnt = new MGRSPoint(new LatLonPoint(latLon.getLatitude(), latLon.getLongitude())); - mgrsEdit.setText(pnt.toString()); + mgrsEdit.setText(pnt.toFlavoredString(5)); } else { mgrsEdit.setText(latEdit.getText()); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index b89ef5fa50..d8101b487d 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -1258,7 +1258,7 @@ public class MapInfoWidgetsFactory { AndroidUiHelper.updateVisibility(latitudeIcon, true); latitudeIcon.setImageDrawable(iconsCache.getIcon(nightMode ? R.drawable.widget_coordinates_utm_night : R.drawable.widget_coordinates_utm_day)); MGRSPoint pnt = new MGRSPoint(new LatLonPoint(lat, lon)); - latitudeText.setText(pnt.toString()); + latitudeText.setText(pnt.toFlavoredString(5)); } else if (f == PointDescription.OLC_FORMAT) { AndroidUiHelper.updateVisibility(lonCoordinatesContainer, false); AndroidUiHelper.updateVisibility(coordinatesDivider, false); From 9390c83e8663ac5fdbd7c55b313f62bd70ae5611 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 30 Oct 2020 12:55:56 +0200 Subject: [PATCH 29/60] Added icons for new login dialogs --- OsmAnd/res/drawable/ic_action_logout.xml | 12 ++++++++++++ .../ic_action_openstreetmap_logo_colored.xml | 14 ++++++++++++++ OsmAnd/res/drawable/ic_action_user_account.xml | 17 +++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 OsmAnd/res/drawable/ic_action_logout.xml create mode 100644 OsmAnd/res/drawable/ic_action_openstreetmap_logo_colored.xml create mode 100644 OsmAnd/res/drawable/ic_action_user_account.xml diff --git a/OsmAnd/res/drawable/ic_action_logout.xml b/OsmAnd/res/drawable/ic_action_logout.xml new file mode 100644 index 0000000000..e1f0b60564 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_logout.xml @@ -0,0 +1,12 @@ + + + + diff --git a/OsmAnd/res/drawable/ic_action_openstreetmap_logo_colored.xml b/OsmAnd/res/drawable/ic_action_openstreetmap_logo_colored.xml new file mode 100644 index 0000000000..2d2472c970 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_openstreetmap_logo_colored.xml @@ -0,0 +1,14 @@ + + + + diff --git a/OsmAnd/res/drawable/ic_action_user_account.xml b/OsmAnd/res/drawable/ic_action_user_account.xml new file mode 100644 index 0000000000..51beae9b6e --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_user_account.xml @@ -0,0 +1,17 @@ + + + + + From dc54a37f1eb957e0fa3a4242cd0766ac667f2bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Fri, 30 Oct 2020 12:11:46 +0100 Subject: [PATCH 30/60] Added translation using Weblate (Icelandic) --- OsmAnd-telegram/res/values-is/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 OsmAnd-telegram/res/values-is/strings.xml diff --git a/OsmAnd-telegram/res/values-is/strings.xml b/OsmAnd-telegram/res/values-is/strings.xml new file mode 100644 index 0000000000..a6b3daec93 --- /dev/null +++ b/OsmAnd-telegram/res/values-is/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From fc7526f73fdc5d8830dad1f197c684eacc16f93b Mon Sep 17 00:00:00 2001 From: ffff23 Date: Thu, 29 Oct 2020 17:22:42 +0000 Subject: [PATCH 31/60] Translated using Weblate (Japanese) Currently translated at 97.8% (3447 of 3521 strings) --- OsmAnd/res/values-ja/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index 86695fc95d..be920969b3 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -2754,7 +2754,7 @@ POIの更新は利用できません OSMメモ、POI、またはその両方用にエクスポートします。 全てのデータ OSMメモ - 明日開く + 明日以降の次の時間に営業 名無し • 一部の機種で起動時にクラッシュしていた問題を修正 \n @@ -2775,11 +2775,11 @@ POIの更新は利用できません 駐車上限時刻 時間制限なし 記事の全文を読む - 以下の場所から開く - 以下の所まで開く - 閉店時間 - 開店予定時間 - 営業予定時刻 + 次の時間から営業 + 次の時間まで営業 + 営業終了時間 + 営業開始時間 + 営業開始時間 マップマーカーを作成しよう! 通過した地点のマーカーと通過予定地点のマーカーがこの画面に表示されます。 From 8443a6aaba0de23a66e00d0c06ac293662468898 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Thu, 29 Oct 2020 12:10:11 +0000 Subject: [PATCH 32/60] Translated using Weblate (French) Currently translated at 100.0% (3521 of 3521 strings) --- OsmAnd/res/values-fr/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 3dda9b8adc..18fd7f8009 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3914,4 +3914,13 @@ Graphique Écart %1$s - %2$s + Cartes locales + Loisir + Spécial + Transport + Service + Symboles + Sport + Urgence + Voyage \ No newline at end of file From 3ce5171a988384f24804588207e90dc5fef9e0c0 Mon Sep 17 00:00:00 2001 From: Dmitriy Prodchenko Date: Fri, 30 Oct 2020 08:43:11 +0000 Subject: [PATCH 33/60] Translated using Weblate (Russian) Currently translated at 99.8% (3516 of 3521 strings) --- OsmAnd/res/values-ru/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 145cd10775..80dc85612f 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3924,4 +3924,7 @@ Файл уже импортирован Дождитесь пересчёта маршрута. \nГрафик будет доступен после пересчёта. - + Разрыв + Сервис + Специальные + \ No newline at end of file From b778d5d8f3644fdbf93098a332096ab37b5771c8 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 29 Oct 2020 15:48:23 +0000 Subject: [PATCH 34/60] Translated using Weblate (Russian) Currently translated at 99.8% (3516 of 3521 strings) --- OsmAnd/res/values-ru/strings.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 80dc85612f..ef0b614441 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3927,4 +3927,14 @@ Разрыв Сервис Специальные + Для езды на снегоходах по выделенным дорогам и трассам. + Разработка + Местная карта + %1$s — %2$s + Удобства + Транспорт + Символы + Спорт + Экстренные службы + Путешествие \ No newline at end of file From 68733905273d9d6c412cea400fded1445b920fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Babos=20G=C3=A1bor?= Date: Thu, 29 Oct 2020 15:53:45 +0000 Subject: [PATCH 35/60] Translated using Weblate (Hungarian) Currently translated at 99.9% (3520 of 3521 strings) --- OsmAnd/res/values-hu/strings.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 9ae52a9644..f3762a3fd1 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -3834,7 +3834,7 @@ Egyszerűsített nyomvonal Kész elmentve - Jelölje ki, hogyan legyenek összekötve a pontok: egyenes vonallal vagy az alábbiak szerint kiszámított útvonallal. + Válassza ki, hogyan legyenek összekötve a pontok: egyenes vonallal vagy az alábbiak szerint kiszámított útvonallal. Teljes nyomvonal Megjegyzés: Ha a GPS közvetlenül a felvétel előtt ki volt kapcsolva, akkor rosszabb lehet az első mért pont pontossága. A kódban ezért szeretnénk majd talán várni egy-két másodpercet egy pont rögzítése előtt (vagy a 3 egymást követő pont közül a legjobbat rögzíteni vagy valami hasonló), de ezt még nem programoztuk le. Cím törlése @@ -3926,4 +3926,13 @@ %1$s adatok csak az utakról állnak rendelkezésre. Használja az „Útvonal tervezése pontok között” funkciót. Várja meg az útvonal újraszámítását. \nAz ábra az újraszámítás után lesz látható. + Helyi térképek + Hasznos és fontos létesítmény + Különleges + Közlekedés + Szolgáltatás + Jelképek + Sport + Vészhelyzet + Utazás \ No newline at end of file From 070c63b0062efe3b0c69ff01b06175603ff28fa4 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Thu, 29 Oct 2020 14:37:53 +0000 Subject: [PATCH 36/60] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3521 of 3521 strings) --- OsmAnd/res/values-uk/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index aec06b50db..f75ae53dfc 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3931,4 +3931,13 @@ \nГрафік буде доступний після переобчислення. Розрив %1$s — %2$s + Місцеві мапи + Зручності + Спеціальні + Транспорт + Послуги + Знаки + Спорт + Аварійні служби + Мандрівка \ No newline at end of file From de6046e8eb41d486c171d5ee06d11fd9171bfa3e Mon Sep 17 00:00:00 2001 From: ace shadow Date: Thu, 29 Oct 2020 17:06:26 +0000 Subject: [PATCH 37/60] Translated using Weblate (Slovak) Currently translated at 100.0% (3521 of 3521 strings) --- OsmAnd/res/values-sk/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 9f57bcf8fd..1ae947c024 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -3935,4 +3935,13 @@ \nGraf bude dostupný po prepočte. %1$s — %2$s Medzera + Lokálne mapy + Občianska vybavenosť + Špeciálne + Doprava + Služby + Symboly + Šport + Núdzová situácia/Záchrana + Cestovanie \ No newline at end of file From 3d3d07d8042eca1806f4963a9e51080878e2643f Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Thu, 29 Oct 2020 13:56:43 +0000 Subject: [PATCH 38/60] Translated using Weblate (Hebrew) Currently translated at 99.9% (3520 of 3521 strings) --- OsmAnd/res/values-iw/strings.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 7334c5dbb9..c82e5e3b8d 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -3837,7 +3837,7 @@ נא לבחור קובץ מסלול שבו יתווסף המקטע החדש. כל המסלול יחושב מחדש באמצעות הפרופיל הנבחר. רק המקטע הבא יחושב מחודש באמצעות הפרופיל הנבחר. - נא לבחור כיצד לחבר נקודות, בקו ישר, או לחבר מסלול ביניהן כפי שצוין להלן. + נא לבחור כיצד לחבר את הנקודות, בקו ישר, או לחבר מסלול ביניהן כפי שצוין להלן. בשלב הבא עליך להצמיד את הדרך המורשית הקרובה ביותר לאחד מפרופילי הניווט שלך כדי להשתמש באפשרות הזו. תמונות ברמת רחוב להתעלם מהשינויים במסלול המתוכנן על ידי סגירתו\? @@ -3939,4 +3939,13 @@ נא להמתין לחישוב המסלול מחדש. \nהתרשים יהיה זמין לאחר החישוב מחדש. %1$s ‏— %2$s + מפות מקומיות + שירות לציבור + מיוחד + תחבורה + שירות + סמלים + ספורט + חירום + טיול \ No newline at end of file From e2c4e032ad481879338ee4ba94085d1fe6cf57d3 Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Thu, 29 Oct 2020 15:37:10 +0000 Subject: [PATCH 39/60] Translated using Weblate (Arabic) Currently translated at 100.0% (3521 of 3521 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 ba6c35fc69..65c7a07411 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3922,4 +3922,13 @@ رسم بياني %2$s — %1$s فجوة + الخرائط المحلية + راحة + خاص + نقل + خدمة + الرموز + رياضة + الطوارئ + سفر \ No newline at end of file From 0c93901320cf409e363e4897a2c95562e04d4014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BB=D0=B0=D0=BC=D0=B5=D0=BD?= Date: Fri, 30 Oct 2020 10:55:50 +0000 Subject: [PATCH 40/60] Translated using Weblate (Bulgarian) Currently translated at 46.7% (1646 of 3521 strings) --- OsmAnd/res/values-bg/strings.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OsmAnd/res/values-bg/strings.xml b/OsmAnd/res/values-bg/strings.xml index f5c84b1d29..8a5ad86232 100644 --- a/OsmAnd/res/values-bg/strings.xml +++ b/OsmAnd/res/values-bg/strings.xml @@ -2170,4 +2170,20 @@ Възстановяване на всички настройки на профила\? Наистина ли искате да изчистите записаните данни\? Преизчисляване на маршрута в случай на отклонение + Успешно излязохте + Файлът вече е импортиран в OsmAnd + Използване на 2-стъпков A* рутиращ алгоритъм + Изчакайте преизчисляването на маршрута. +\nГрафиката ще бъде достъпна след преизчисляване. + Местни карти + %1$s — %2$s + Пропуск + Удобства + Специални + Транспорт + Услуги + Символи + Спорт + Аварийни служби + Пътуване \ No newline at end of file From cce97081f36e0d5e2c85fa78e15d46a66ec45619 Mon Sep 17 00:00:00 2001 From: ffff23 Date: Thu, 29 Oct 2020 17:32:14 +0000 Subject: [PATCH 41/60] Translated using Weblate (Japanese) Currently translated at 99.3% (3806 of 3829 strings) --- OsmAnd/res/values-ja/phrases.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-ja/phrases.xml b/OsmAnd/res/values-ja/phrases.xml index 495b894b2c..3ddebc7b5a 100644 --- a/OsmAnd/res/values-ja/phrases.xml +++ b/OsmAnd/res/values-ja/phrases.xml @@ -990,7 +990,7 @@ ベトナム語 wiki ボラピュク語 wiki 中国語 wiki - 係船柱 + 自転車用車止め オートバイ用車止め ブロック @@ -1260,8 +1260,8 @@ 掃除機 ディーゼル排気用液(AdBlue・尿素水) ドライブスルー - 有り - 無し + + ドライブスルー: 不可 91UL 無鉛航空燃料 100LL 有鉛航空燃料 JET A-1ジェット燃料 @@ -1577,7 +1577,7 @@ スカイスポーツの対応要素 季節営業 ドライブイン - 無し + ドライブイン: 不可 有り ボーイスカウト用キャンプ 肯定 @@ -1710,7 +1710,7 @@ 南インドのタミル伝統医学 ユナニ医学・南アジアの伝統医学 医療事務 - 有り + 代替医療の専門種 往診 無し @@ -3835,4 +3835,8 @@ ギブボックス(提供品置場) 簡易給水栓 液化天然ガス + GPXポイント + 待避所 + 車庫 + 屋上 \ No newline at end of file From edecbf7d80d4540f7a8d3c851f95c5c579340ec1 Mon Sep 17 00:00:00 2001 From: Eduardo Addad de Oliveira Date: Thu, 29 Oct 2020 14:45:03 +0000 Subject: [PATCH 42/60] Translated using Weblate (Portuguese (Brazil)) Currently translated at 99.9% (3520 of 3521 strings) --- OsmAnd/res/values-pt-rBR/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index f6e3fc9f64..0d88da8148 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3929,4 +3929,13 @@ Aguarde o recálculo da rota. \nO gráfico estará disponível após o recálculo. %1$s — %2$s + Mapas locais + Amenidade + Especial + Transporte + Serviço + Símbolos + Esporte + Emergência + Viagem \ No newline at end of file From 445a1f9ce09c1dd1328c0a69e2814fbfe217dace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 29 Oct 2020 19:52:11 +0000 Subject: [PATCH 43/60] Translated using Weblate (Estonian) Currently translated at 99.2% (3496 of 3521 strings) --- OsmAnd/res/values-et/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index 3930c5b18f..2a0af4fbbf 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -3786,4 +3786,13 @@ OsmAnd andmed reaalajas Mootorsaanide sõitmine eraldi määratud teedel ja radadel. %1$s — %2$s + Eriteenused + Mugavus + Kohalikud kaardid + Reisimine + Hädaabi + Sport + Sümbolid + Teenused + Transport \ No newline at end of file From 27a27bb84f14035468ccf8aa306128850d114a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Thu, 29 Oct 2020 15:27:31 +0000 Subject: [PATCH 44/60] Translated using Weblate (Icelandic) Currently translated at 100.0% (3521 of 3521 strings) --- OsmAnd/res/values-is/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index 182d438a1c..3414adba28 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -3945,4 +3945,13 @@ \n Þú getur stýrt og aflýst áskriftunum þínum með því að fara í AppGallery stillingarnar þínar. Graf %1$s — %2$s + Staðkort + Aðstaða + Sértákn + Samgöngur + Þjónusta + Tákn + Íþróttir + Neyðartilfelli + Ferðalög \ No newline at end of file From b618f8c33f141a1f215a6ca7c0fc4d4026cb472f Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Fri, 30 Oct 2020 03:11:32 +0000 Subject: [PATCH 45/60] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3521 of 3521 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index c25c031f20..980ed0c113 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3930,4 +3930,13 @@ \n重新計算後即可使用圖表。 %1$s — %2$s 分隔 + 本機地圖 + 便利設施 + 特殊 + 運輸 + 服務 + 符號 + 運動 + 警急 + 旅行 \ No newline at end of file From bd7c7aa79fbb74dccf9a0a1c135d2d9b37f481a4 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Thu, 29 Oct 2020 12:18:17 +0000 Subject: [PATCH 46/60] Translated using Weblate (Italian) Currently translated at 97.4% (264 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/it/ --- OsmAnd-telegram/res/values-it/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd-telegram/res/values-it/strings.xml b/OsmAnd-telegram/res/values-it/strings.xml index 15986c05a0..04ca50389d 100644 --- a/OsmAnd-telegram/res/values-it/strings.xml +++ b/OsmAnd-telegram/res/values-it/strings.xml @@ -265,4 +265,5 @@ Ultima risposta: %1$s Ultimo aggiornamento da Telegram: %1$s ERR + Controlla e condividi i log dettagliati dell\'applicazione \ No newline at end of file From 7143bb3e18e68a2b30709683e6fcda71ce412e7b Mon Sep 17 00:00:00 2001 From: Gilbert Lowel Date: Fri, 30 Oct 2020 09:43:42 +0000 Subject: [PATCH 47/60] Translated using Weblate (Dutch) Currently translated at 96.4% (3396 of 3521 strings) --- OsmAnd/res/values-nl/strings.xml | 129 +++++++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 6557da422c..129ae33b02 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -636,7 +636,7 @@ Gebruik online kaarten (download en bewaar deze op SD-kaart). Online kaarten Configureer online of bewaarde kaarttegels. - Geeft toegang tot vele soorten online (zogenaamde tile of raster) kaarten, van vooraf gedefinieerde OSM tiles (zoals Mapnik) tot satellietbeelden en lagen voor speciale doeleinden zoals weerkaarten, klimaatkaarten, geologische kaarten, reliëfschaduwlagen, enz. + Geeft toegang tot vele soorten online (zogenaamde tile of raster) kaarten, van vooraf gedefinieerde OSM tiles (zoals Mapnik) tot satellietbeelden en lagen voor speciale doeleinden zoals weerkaarten, klimaatkaarten, geologische kaarten, reliëf schaduwlagen, enz. \n \nAl deze kaarten kunnen worden gebruikt als de hoofd(basis)kaart, of als een extra laag of een achtergrondlaag bij een andere basiskaart (zoals de normale offline kaarten van OsmAnd). Om een achtergrondlaag beter te kunnen zien, kunt u elementen van de OsmAnd vectorkaarten eenvoudig verbergen via het menu \'Kaart instellen\'. \n @@ -769,9 +769,7 @@ \n - Beperkt aantal kaartdownloads \n - Geen toegang tot offline Wikipedia POI\'s \n -\nOsmAnd wordt actief ontwikkeld en ons project en de verdere vooruitgang ervan is afhankelijk van -\nfinanciële bijdragen om de ontwikkeling en testen van nieuwe functionaliteit te kunnen bekostigen. -\nWij verzoeken je om OsmAnd+ te kopen, of om een donatie over te maken via https://osmand.net. +\n OsmAnd wordt actief ontwikkeld en ons project en de verdere vooruitgang ervan is afhankelijk van financiële bijdragen om de ontwikkeling en testen van nieuwe functionaliteit te kunnen bekostigen. Wij verzoeken je om OsmAnd+ te kopen, of om een donatie over te maken via https://osmand.net. OsmAnd+ (OSM Automated Navigation Directions) \n \nOsmAnd+ is een open-source app voor navigatie die gebruikmaakt van de wereldwijde verzameling van OSM-gegevens. Alle kaartmateriaal (vector- en rasterkaarten) kunnen worden opgeslagen in het telefoongeheugen voor offline gebruik. De app biedt ook offline- en online-navigatie, met stembegeleiding. @@ -1283,7 +1281,7 @@ Widgets Linker Kolom Kaart instellen Binnen - Anonieme gebruikers kunnen geen + Anonieme gebruikers kunnen geen: \n- groepen aanmaken; \n- groepen en apparaten synchroniseren met de server; \n- groepen en apparaten beheren in een eigen omgeving op de website. @@ -1532,7 +1530,7 @@ Hoogte van het voertuig Geef de hoogte die minimaal toegestaan moet zijn op de route. Slim opnieuw berekenen van routes - Herbereken alleen het begin van de route voor lange trajecten. + Herbereken alleen het begin van de route. Kan gebruikt worden voor lange trajecten. Verwijder OSM-wijziging Uitgeschakeld Kleuren naar Wandelroute-netwerk @@ -3336,7 +3334,7 @@ U kunt geen standaard OsmAnd profielen verwijderen, maar u kunt ze deactiveren (in het vorige scherm), of naar onderen verplaatsen. Wijzig profielen \'Navigatietype\' bepaalt hoe routes berekend worden. - Profiel aanzicht + Profiel weergave Icoon, kleur en naam Wijzig lijst met profielen Geselecteerd profiel @@ -3779,4 +3777,121 @@ Kies een trackbestand om te volgen of importeer het, vanaf uw apparaat. Kloof Op maat + Voer een OAuth-login uit om osm edit functies te gebruiken + "• Bijgewerkte app- en profielinstellingen: instellingen zijn nu gerangschikt op type. Elk profiel kan afzonderlijk worden aangepast. +\n +\n • Nieuw dialoogvenster voor het downloaden van kaarten waarin wordt voorgesteld een kaart te downloaden tijdens het browsen +\n +\n • Donkere thema-fixes +\n +\n • Verschillende routeringsproblemen over de hele wereld opgelost +\n +\n • Bijgewerkte basiskaart met meer gedetailleerd wegennet +\n +\n • Vaste overstroomde gebieden over de hele wereld +\n +\n • Skirouting: hoogteprofiel en routecomplexiteit toegevoegd aan de routedetails +\n +\n • Andere bugs opgelost +\n +\n" + "• Profielen: nu kunt u de volgorde wijzigen, het pictogram voor de kaart instellen, alle instellingen voor basisprofielen wijzigen en ze terugzetten naar de standaardinstellingen +\n +\n • Exitnummer toegevoegd in de navigatie +\n +\n • Herwerkte plug-in instellingen +\n +\n • Herwerkt instellingenscherm voor snelle toegang tot alle profielen +\n +\n • Optie toegevoegd om instellingen van een ander profiel te kopiëren +\n +\n • Mogelijkheid toegevoegd om een volgorde te wijzigen of POI-categorieën in Zoeken te verbergen +\n +\n • Correct uitgelijnde POI-pictogrammen op de kaart +\n +\n • Zonsondergang / zonsopganggegevens toegevoegd om de kaart te configureren +\n +\n • Thuis/werk-pictogrammen toegevoegd op de kaart +\n +\n • Ondersteuning toegevoegd voor meerdere regels beschrijving bij Instellingen +\n +\n • Correcte transliteratie toegevoegd aan de kaart van Japan +\n +\n • Antarctica-kaart toegevoegd +\n +\n" + Wat is er nieuw + Voor sneeuwscooter, rijden met speciale wegen en tracks. + Stel aantal werkdagen in om door te gaan + Selecteer het interval waarmee markeringen met afstand of tijd op de track worden weergegeven. + Selecteer de gewenste splitsingsoptie: op tijd of op afstand. + Vaste + Overschrijf track + Drempelafstand + Navigatieprofiel + In geval van een omgekeerde richting + Routes + Routes + Routes + Log track naar GPX-bestand + Volg route + Voeg trackbestanden toe + Voeg een trackwaypoint toe + Volg de track + Kies een trackbestand om te volgen + Selecteer een andere track + Navigeer vanaf mijn positie naar de track + Track starten + Dichtstbijzijnde punt + Aan wegen koppelen + Adres verwijderen + Adres ingeven + Adres ingeven + Bestandsnaam + %s trackbestanden geselecteerd + Zal trackregistratie onderbreken wanneer de app wordt uitgeschakeld (via recente apps). (OsmAnd-achtergrondindicatie verdwijnt uit de Android-berichtenbalk.) + Vorig segment + Alle voorgaande segmenten + Alleen het geselecteerde segment wordt opnieuw berekend met het geselecteerde profiel. + Alle voorgaande segmenten worden opnieuw berekend met het geselecteerde profiel. + Open opgeslagen track + wordt opgeslagen + Voeg ten minste twee punten toe. + Opnieuw doen + Laatst gewijzigd + Naam: A – Z + Naam: A – Z + Start/stop iconen + Bedankt voor het kopen van \'Contourlijnen\' + Abonnement berekend per geselecteerde periode. Annuleer het op elk moment op AppGallery. + De betaling wordt bij de bevestiging van de aankoop in rekening gebracht op uw AppGallery-account. +\n +\nHet abonnement wordt automatisch verlengd, tenzij het vóór de verlengingsdatum wordt opgezegd. Uw account wordt alleen op de verlengingsdatum in rekening gebracht voor de verlengingsperiode (maand / drie maanden / jaar). +\n +\nU kunt uw abonnementen beheren en annuleren door naar uw AppGallery-instellingen te gaan. + Vermijd voetpaden + Vermijd voetpaden + Ontwikkeling + OsmAnd Live gegevens + OsmAnd Live gegevens + Twee stappen routeberekening voor autonavigatie. + Eigen ontwikkeling van het openbaar vervoer + Schakel over naar Java (veilige) routeberekening voor het openbaar vervoer + Inloggen via OAuth + Wis OpenStreetMap OAuth-token + Uitloggen gelukt + Het bestand is al geïmporteerd in OsmAnd + Lokale kaarten + Aangenaam + Speciaal + Transport + Onderhoud + Symbolen + Sport + Noodtoestand + Reizen + Trackbestanden importeren of opnemen + Track waypoint toevoegen + Opslaan als trackbestand + Rec \ No newline at end of file From d85f5ec4f86c28d4c28a6011b1e6b5dacd1d53d1 Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 29 Oct 2020 15:43:27 +0000 Subject: [PATCH 48/60] Translated using Weblate (Russian) Currently translated at 99.8% (3825 of 3829 strings) --- OsmAnd/res/values-ru/phrases.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 7b0db11a82..36b7e66d59 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3762,7 +3762,7 @@ Тип монастыря: монашество Магазин защиты и безопасности Горноспасательная станция - Сигнал для поиска полюса + Доступ в Интернет: клиенты Многоуровневые маршруты: нет Многоуровневые маршруты: есть Взрывной залп: вторая или более поздняя детонация залпового теста @@ -3833,4 +3833,6 @@ Магазин орехов Улей СПГ + Навесы + Точка GPX \ No newline at end of file From 3f7a4ea568079fe54fab1533a8e90eddf295c4ff Mon Sep 17 00:00:00 2001 From: Jan Backhaus Date: Fri, 30 Oct 2020 15:27:08 +0100 Subject: [PATCH 49/60] Fixed MGRS decoding when still containing spaces. --- .../java/com/jwetherell/openmap/common/MGRSPoint.java | 9 +++++++++ .../src/main/java/net/osmand/util/LocationParser.java | 6 +----- .../plus/search/QuickSearchCoordinatesFragment.java | 4 ++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java b/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java index a39c5af336..6e99eec8b5 100644 --- a/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java +++ b/OsmAnd-java/src/main/java/com/jwetherell/openmap/common/MGRSPoint.java @@ -108,6 +108,15 @@ public class MGRSPoint extends ZonedUTMPoint { * an UPPERCASE coordinate string is expected. */ protected void decode(String mgrsString) throws NumberFormatException { + if (mgrsString.contains(" ")) { + String[] parts = mgrsString.split(" "); + StringBuilder s = new StringBuilder(); + for (String i : parts) { + s.append(i); + } + mgrsString = s.toString(); + } + if (mgrsString == null || mgrsString.length() == 0) { throw new NumberFormatException("MGRSPoint coverting from nothing"); } diff --git a/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java b/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java index 9e54bea347..efa4cdaf42 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/LocationParser.java @@ -140,11 +140,7 @@ public class LocationParser { //detect MGRS if (all.size() >= 3 && (d.size() == 2 || d.size() == 3) && all.get(1) instanceof String) { try { - StringBuilder s = new StringBuilder(); - for (String i : strings) { - s.append(i); - } - MGRSPoint mgrsPoint = new MGRSPoint(s.toString()); + MGRSPoint mgrsPoint = new MGRSPoint(locPhrase); LatLonPoint ll = mgrsPoint.toLatLonPoint(); return validateAndCreateLatLon(ll.getLatitude(), ll.getLongitude()); } catch (NumberFormatException e) { diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java index 409f38b319..78383f3179 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchCoordinatesFragment.java @@ -610,6 +610,10 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os if (latLon != null) { MGRSPoint pnt = new MGRSPoint(new LatLonPoint(latLon.getLatitude(), latLon.getLongitude())); mgrsEdit.setText(pnt.toFlavoredString(5)); + } else if (prevFormat == PointDescription.UTM_FORMAT) { + mgrsEdit.setText(zoneEdit.getText()); + } else if (prevFormat == PointDescription.OLC_FORMAT) { + mgrsEdit.setText(olcEdit.getText()); } else { mgrsEdit.setText(latEdit.getText()); From 1878e861bcf715f919ff07a5a4ce5915dfde744f Mon Sep 17 00:00:00 2001 From: Hakim Oubouali Date: Sat, 31 Oct 2020 10:07:24 +0100 Subject: [PATCH 50/60] Added translation using Weblate (Central Atlas Tamazight) --- OsmAnd-telegram/res/values-tzm/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 OsmAnd-telegram/res/values-tzm/strings.xml diff --git a/OsmAnd-telegram/res/values-tzm/strings.xml b/OsmAnd-telegram/res/values-tzm/strings.xml new file mode 100644 index 0000000000..a6b3daec93 --- /dev/null +++ b/OsmAnd-telegram/res/values-tzm/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 0dd91acbc3f194ff181f8b459c9639ceeb94cc82 Mon Sep 17 00:00:00 2001 From: ffff23 Date: Fri, 30 Oct 2020 16:33:47 +0000 Subject: [PATCH 51/60] Translated using Weblate (Japanese) Currently translated at 97.8% (3446 of 3521 strings) --- OsmAnd/res/values-ja/strings.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index be920969b3..c189909e5a 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -827,7 +827,7 @@ POIの更新は利用できません ヘルプ アクセシビリティモード アクセシビリティ(ユーザー補助)機能を設定します - ON + On OFF デバイス側のユーザー補助設定に従う メニューに戻る @@ -1547,7 +1547,7 @@ POIの更新は利用できません マップストレージ コピー OSMの編集を削除 - 無効化 + 無効 ログオフ 国境を越えて別の国に入るようなルート設定を避けます。 高さ制限 @@ -2853,7 +2853,7 @@ POIの更新は利用できません %1$s を利用 道路種別 入れ替え - 詳細を見る + さらに表示 マップ上の経路 GPX経路の表示/非表示 マップ上にある選択したGPX経路の表示/非表示を切り替えるボタンです。 @@ -2898,7 +2898,7 @@ POIの更新は利用できません %1$.2f %2$s 支払い方法の選択: 寄付金はOSMの地図製作に役立てられます。 - 360°イメージのみ表示 + 360°画像のみを表示 編集 %1$s, 合計 %2$s mBTC 起動 グアラニー語 @@ -3048,9 +3048,9 @@ POIの更新は利用できません マップ上に低排出ゾーン(CO2排出量の多い車両に課税するエリア)を表示します。ルーティングには影響しません。 低排出ゾーンの表示 デフォルト - 出口: + 降車 %1$d回の乗り換え - 歩行 + 徒歩 ログの送信 %1$d個のファイルを移動しました。(%2$s) %1$d個のファイルをコピーしました。(%2$s) @@ -3106,12 +3106,12 @@ POIの更新は利用できません 開始時に表示するプロファイルの選択 カスタムプロファイルは標準のアプリケーションプロファイルを元に作成します。ウィジェットなどの表示設定や速度と距離の単位などの標準設定をプロファイルごとに定義可能です。これらは標準のアプリプロファイルを基本としており、今後それらと共に拡張される可能性があります: ナビゲーションタイプの選択 - 乗用車,トラック,オートバイ - マウンテンバイク、モペッド(ペダル付き原動機付自転車)、馬 - 徒歩,ハイキング,ランニング + 乗用車、トラック、オートバイ + マウンテンバイク、モペッド、馬 + 徒歩、ハイキング、ランニング 公共交通機関の種類 - エンジン付き船舶,漕ぎボート,帆船 - 航空機,グライダー + 船舶、漕ぎボート、帆船 + 航空機、グライダー ジオコーディング 直線 BRouter(オフライン) From 5e0e228a502661935d95538f028e2bd1a4d5f001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BB=D0=B0=D0=BC=D0=B5=D0=BD?= Date: Sat, 31 Oct 2020 07:43:22 +0000 Subject: [PATCH 52/60] Translated using Weblate (Bulgarian) Currently translated at 46.7% (1647 of 3521 strings) --- OsmAnd/res/values-bg/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-bg/strings.xml b/OsmAnd/res/values-bg/strings.xml index 8a5ad86232..813e23367c 100644 --- a/OsmAnd/res/values-bg/strings.xml +++ b/OsmAnd/res/values-bg/strings.xml @@ -2186,4 +2186,5 @@ Спорт Аварийни служби Пътуване + Изчистете маркера OAuth на OpenStreetMap \ No newline at end of file From 0d29f19ae015aa26d55b89cafed962d438a0c30b Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Fri, 30 Oct 2020 19:56:06 +0000 Subject: [PATCH 53/60] Translated using Weblate (Sardinian) Currently translated at 99.5% (3505 of 3521 strings) --- OsmAnd/res/values-sc/strings.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 8c9aa3a3ec..2245af22f2 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3932,4 +3932,11 @@ Iseta su càrculu nou de s\'àndala. \nSu gràficu at a èssere a disponimentu a pustis de su càrculu. %1$s — %2$s + Apretu/Emergèntzia + Ispetziales + Trasportu + Servìtziu + Sìmbulos + Isport + Biàgiu \ No newline at end of file From 8e81a76948b798deff9f2cba06bfbd8d6cafd320 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 30 Oct 2020 12:27:47 +0000 Subject: [PATCH 54/60] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3520 of 3521 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index ad60cd64f0..54e7d2a41b 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3829,7 +3829,7 @@ Ruta inversa Recalcular sólo el siguiente segmento usando el perfil elegido. Recalcular toda la traza usando el perfil elegido. - Marca cómo conectar los puntos, con una línea recta o calcular una ruta entre ellos como se detalla a continuación. + Elige cómo conectar los puntos, con una línea recta o calcular una ruta entre ellos como se detalla a continuación. Traza completa Siguiente segmento A continuación, ajusta la traza al camino permitido más cercano con un perfil de navegación. @@ -3937,4 +3937,13 @@ Espera el recálculo de la ruta. \nEl gráfico estará disponible después del recálculo. %1$s — %2$s + Mapas locales + Comodidad + Especial + Transporte + Servicio + Símbolos + Deporte + Emergencia + Viaje \ No newline at end of file From 15562f947a903a7753452cb690307b1218a40688 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 30 Oct 2020 12:34:36 +0000 Subject: [PATCH 55/60] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3829 of 3829 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index 4a15cc5cdd..9f3c0b8803 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3811,7 +3811,7 @@ Contrastado Primitivo Incorrecto - Señal para encontrar el poste + Conexión a Internet: clientes Nivel del agua: parcialmente sumergido Nivel del agua: sumergido Nivel de agua: seco @@ -3852,4 +3852,8 @@ Panal de abejas Frutos secos Gas natural licuado + Apartadero + Cobertizos + Azotea + Punto GPX \ No newline at end of file From 495fcc298b6c74c8caef5cabdcf6457331c72231 Mon Sep 17 00:00:00 2001 From: Verdulo Date: Fri, 30 Oct 2020 19:38:41 +0000 Subject: [PATCH 56/60] Translated using Weblate (Esperanto) Currently translated at 99.9% (3520 of 3521 strings) --- OsmAnd/res/values-eo/strings.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index c469f7f4bd..9e3cd983c5 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3934,4 +3934,13 @@ \nDiagramo estos videbla post rekalkulado. %1$s — %2$s Manko + Lokaj mapoj + Oportunaĵo + Specialaj + Transporto + Servo + Simboloj + Sporto + Vivsavo + Vojaĝo \ No newline at end of file From 45a06ce372365ff7687d2eb2af14802b9a499013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Fri, 30 Oct 2020 13:45:40 +0000 Subject: [PATCH 57/60] Translated using Weblate (Icelandic) Currently translated at 100.0% (3521 of 3521 strings) --- OsmAnd/res/values-is/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index 3414adba28..0682b0030e 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -106,15 +106,15 @@ Veldu flokk Hraðaeining sml - sjómílur - kílómetrar á klukkustund - mílur á klukkustund - metrar á sekúndu - mínútur á kílómetra - mínútur á mílu + Sjómílur + Kílómetrar á klukkustund + Mílur á klukkustund + Metrar á sekúndu + Mínútur á kílómetra + Mínútur á mílu Sjómílur á klukkustund (hnútar) hnútar - mín/m + mín/ml mín/km m/sek Leiðsögn @@ -238,7 +238,7 @@ Sýna allt Fella saman Birta á korti - Kort + Landakort Eftirlæti Eftirlæti Heimilisfang @@ -2109,7 +2109,7 @@ Nafnið inniheldur of marga hástafi. Viltu halda áfram? Tvítekið nafn á flýtiaðgerð Flokkur til að vista eftirlætisstað í: - Setja inn + Setja upp Ljósmyndir á netinu Engar myndir hér. Breyttu leitarorðum eða stækkaðu radíus leitarinnar. From 18224bef2d75f7b2856699e6320e9430b4f4b254 Mon Sep 17 00:00:00 2001 From: Gilbert Lowel Date: Fri, 30 Oct 2020 14:19:06 +0000 Subject: [PATCH 58/60] Translated using Weblate (Dutch) Currently translated at 96.4% (3397 of 3521 strings) --- OsmAnd/res/values-nl/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 129ae33b02..3c40568702 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -3233,7 +3233,7 @@ \'Freeride\' en \'Off-piste\' zijn officieuze routes en passages. Meestal onverzorgd en niet onderhouden, en niet \'s avonds gecontroleerd. Betreden op eigen risico. Verzamelde data Laatste OsmAnd uitvoering gecrasht. Help ons alstublieft OsmAnd te verbeteren door de foutmelding te delen. - Persoonlijke transporteur + Persoonlijk transport Offroad WunderLINQ Wegtype @@ -3797,11 +3797,11 @@ \n" "• Profielen: nu kunt u de volgorde wijzigen, het pictogram voor de kaart instellen, alle instellingen voor basisprofielen wijzigen en ze terugzetten naar de standaardinstellingen \n -\n • Exitnummer toegevoegd in de navigatie +\n • Exitnummer toegevoegd in de navigatie \n -\n • Herwerkte plug-in instellingen +\n • Herwerkte plug-in instellingen \n -\n • Herwerkt instellingenscherm voor snelle toegang tot alle profielen +\n • Herwerkt instellingenscherm voor snelle toegang tot alle profielen \n \n • Optie toegevoegd om instellingen van een ander profiel te kopiëren \n From 0a6093e78d28b86b4c310f9f64e006019c97ec2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sveinn=20=C3=AD=20Felli?= Date: Fri, 30 Oct 2020 13:44:22 +0000 Subject: [PATCH 59/60] Translated using Weblate (Icelandic) Currently translated at 76.7% (208 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/is/ --- OsmAnd-telegram/res/values-is/strings.xml | 211 +++++++++++++++++++++- 1 file changed, 210 insertions(+), 1 deletion(-) diff --git a/OsmAnd-telegram/res/values-is/strings.xml b/OsmAnd-telegram/res/values-is/strings.xml index a6b3daec93..94bb15851c 100644 --- a/OsmAnd-telegram/res/values-is/strings.xml +++ b/OsmAnd-telegram/res/values-is/strings.xml @@ -1,2 +1,211 @@ - \ No newline at end of file + + Einingar og snið þeirra + Setja upp OsmAnd + Lykilorð + Meðalhæð + Fela + sendi (%1$d í biðminni) + Endursenda staðsetningu + Staðsetning… + Meðalhraði + Athugaðu og deildu nákvæmum atvikaskrám úr forritinu + Mílur/metrar + Lykilorð í Telegram + Deila staðsetningu sem + Deila staðsetningu + Sía: Stilltu lágmarksfjarlægð frá síðustu staðsetningu þar sem punktur er tekinn í skráningu + Til baka + Slökkt + Engin internettenging + Stilla tíma + Samþykkja + sek + %1$d mín + Mílur/fet + Vélmenni + Meðferð persónuupplýsinga í OsmAnd + Sendi staðsetningu + Tegund milliþjóns (proxy) + Breyta einingum sem notaðar eru við lengdarmælingar. + Staðsetningaferill + Merki OsmAnd + Gat ekki bætt við nýju tæki + Staða + Stillingar milliþjóns (proxy) + Gátt + Eftir nafni + Tímabelti + mín/km + m + Skráning staðsetningar virk + Tenging + Kílómetrar/metrar + Síðasta uppfærsla frá Telegram: Fyrir %1$s síðan + Vöktun er óvirk + Staða OsmAnd-rekjara + OsmAnd rekjari + Hópur + mín/ml + Netþjónn + Slökkva á öllu + Til baka í OsmAnd + Heiti tækis er of langt + Loka + %1$d klst %2$d mín + Mínútur á mílu + mín + Byrja + Vista + Landakort og texti + Lykilorð + %1$s bætt við. + Birta í OsmAnd + Síðasta tiltæka staðsetning + Sent + Auðkenningarkóði + Leita í tengiliðum + Opna OsmAnd + Endar + Settu inn auðkenningarkóða + Staðsetning mín + Skrá út + Birta á korti + Staða deilingar + Hætta við + Bíð eftir svari frá Telegram + Tókst að senda og uppfæra + Velja + Metrar á sekúndu + Heiti tækis + Velkomin + Hvernig það virkar + Stefna + Milliþjónn + Engin GPS-tenging + Senda staðsetningu sem + %1$d punktar + yd + Gera óvirkt + Tími á ferðinni + Sjómílur á klukkustund (hnútar) + %1$d klst + Lykill + Bakgrunnsvinna + Setja upp + Bæta við + Raða eftir + Síðasta svar: %1$s + Allt + Hæð + Birta GPS-punkta + Heiti tækis getur ekki verið tómt + Leita + Eftir vegalengd + Sjómílur + m/sek + Þú ert ekki skráð/ur inn + Ræsing + Lágmarksnákvæmni skráningar + Loka + Lágmarkshraði skráninga + OsmAnd rakningarþjónusta + Telegram + Kveikja á \"Staðsetning\"\? + Tengdur aðgangur + mi + Notandanafn + Heimild + Lengdareiningar + GPX-stillingar + Nýskráning í Telegram + Vegalengd + klst + km/klst + Skrá inn + Síðasta svar + Deila staðsetningu + ft + Nafn + %1$s síðan + Veldu notendur eða hópa til að deila með staðsetningu þinni. + Ég er ekki með Telegram-aðgang + Vöktun er virk + Rennur út + Gagnaleynd + Notandaaðgangur + Virkt + Nákvæmni + VILL + Ekki á ferð + Halda áfram + Staða + Upphafs — Endadagsetning + Aftengt + sml + Uppfæra + Settu inn lykilorð + Deila + Logcat biðminni + Settu inn símanúmer + Mínútur á kílómetra + Hætta + Útlit + Dagsetning + Síðar + Stefna + Hraðaeining + Landakort + Sía: Engin skráning punkta fyrir neðan þennan hraða + í %1$s + Leit: Hópur eða tengiliður + hnútar + km + Tímalína + Vistuð skilaboð + GPS-punktar + Virkja + Lágmarksfjarlægð skráninga + Síðasta uppfærsla frá Telegram + Safnað + Skrái út + Mílur/yardar + Veldu tíma sem á að birta + Auðkenni + Kílómetrar á klukkustund + Síðasta svar: Fyrir %1$s síðan + Tengist internetinu + Senda skýrslu + Flytja út + Mílur á klukkustund + Í lagi + Virkja + Persónuverndarstefna Telegram + Virkt spjall + Senda staðsetningu mína + Stungið upp á + Fara í stillingar + mi/klst + Deiling í bakgrunni + Deiling: %1$s + Síðasta uppfærsla frá Telegram: %1$s + Byrja + Raða + Engin gögn + Eftir hópi + Bæta við tæki + Texti + Stillingar + Birta notendur á kortinu + Tengt + Símanúmer + Upphafsdagsetning + Skilgreindu einingu fyrir hraða. + síðan + Settu inn kóða + Gera vöktun óvirka + Forritið hefur ekki heimildir til að nota staðsetningargögn. + Lokadagsetning + Bakgrunnshamur + OsmAnd-rakning keyrir í bakgrunni á meðan slökkt er á skjá. + \ No newline at end of file From ffb3f78ae15f5fa1d1abd6e5203dd759f6927998 Mon Sep 17 00:00:00 2001 From: Hakim Oubouali Date: Sat, 31 Oct 2020 10:09:05 +0100 Subject: [PATCH 60/60] Added translation using Weblate (Central Atlas Tamazight) --- OsmAnd/res/values-tzm/phrases.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 OsmAnd/res/values-tzm/phrases.xml diff --git a/OsmAnd/res/values-tzm/phrases.xml b/OsmAnd/res/values-tzm/phrases.xml new file mode 100644 index 0000000000..a6b3daec93 --- /dev/null +++ b/OsmAnd/res/values-tzm/phrases.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file