From 9453a14fe458e0f6931f05b0cbf51f8140b40d45 Mon Sep 17 00:00:00 2001 From: cepprice Date: Wed, 10 Feb 2021 12:44:44 +0500 Subject: [PATCH 01/46] Add restart button after settings import if language was changed --- .../res/layout/fragment_import_complete.xml | 62 +++++++++++++++---- OsmAnd/res/values/strings.xml | 1 + .../src/net/osmand/plus/AppInitializer.java | 2 + .../net/osmand/plus/OsmandApplication.java | 7 ++- .../net/osmand/plus/helpers/LocaleHelper.java | 37 +++++++++++ .../backend/backup/SettingsHelper.java | 9 +++ .../fragments/ImportCompleteFragment.java | 25 ++++++++ 7 files changed, 129 insertions(+), 14 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java diff --git a/OsmAnd/res/layout/fragment_import_complete.xml b/OsmAnd/res/layout/fragment_import_complete.xml index 6e9a5fa22b..e9d6180784 100644 --- a/OsmAnd/res/layout/fragment_import_complete.xml +++ b/OsmAnd/res/layout/fragment_import_complete.xml @@ -66,28 +66,64 @@ - + android:orientation="horizontal" > - + android:background="?attr/dlg_btn_secondary" + android:layout_weight="1"> - + + + + + + + + + + + + + diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a15fb40cbd..3f5841204a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,6 +12,7 @@ --> + Restart Login to OpenPlaceReviews Use test.openplacereviews.org OpenPlaceReviews diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 065c7aba2e..13b3102c93 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -36,6 +36,7 @@ import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask; import net.osmand.plus.helpers.AvoidSpecificRoads; import net.osmand.plus.helpers.DayNightHelper; +import net.osmand.plus.helpers.LocaleHelper; import net.osmand.plus.helpers.LockHelper; import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.inapp.InAppPurchaseHelperImpl; @@ -471,6 +472,7 @@ public class AppInitializer implements IProgress { app.osmOAuthHelper = startupInit(new OsmOAuthHelper(app), OsmOAuthHelper.class); app.oprAuthHelper = startupInit(new OprAuthHelper(app), OprAuthHelper.class); app.onlineRoutingHelper = startupInit(new OnlineRoutingHelper(app), OnlineRoutingHelper.class); + app.localeHelper = startupInit(new LocaleHelper(app), LocaleHelper.class); initOpeningHoursParser(); } diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 9d2524d30c..285a0135eb 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -59,6 +59,7 @@ import net.osmand.plus.download.DownloadService; import net.osmand.plus.download.IndexItem; import net.osmand.plus.helpers.AvoidSpecificRoads; import net.osmand.plus.helpers.DayNightHelper; +import net.osmand.plus.helpers.LocaleHelper; import net.osmand.plus.helpers.LocationServiceHelper; import net.osmand.plus.helpers.LockHelper; import net.osmand.plus.helpers.WaypointHelper; @@ -165,6 +166,7 @@ public class OsmandApplication extends MultiDexApplication { OprAuthHelper oprAuthHelper; MeasurementEditingContext measurementEditingContext; OnlineRoutingHelper onlineRoutingHelper; + LocaleHelper localeHelper; private Resources localizedResources; private Map customRoutingConfigs = new ConcurrentHashMap<>(); @@ -402,6 +404,10 @@ public class OsmandApplication extends MultiDexApplication { return oprAuthHelper; } + public LocaleHelper getLocaleHelper() { + return localeHelper; + } + public synchronized DownloadIndexesThread getDownloadThread() { if (downloadIndexesThread == null) { downloadIndexesThread = new DownloadIndexesThread(this); @@ -717,7 +723,6 @@ public class OsmandApplication extends MultiDexApplication { } } - public TargetPointsHelper getTargetPointsHelper() { return targetPointsHelper; } diff --git a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java new file mode 100644 index 0000000000..02250098bc --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java @@ -0,0 +1,37 @@ +package net.osmand.plus.helpers; + +import net.osmand.StateChangedListener; +import net.osmand.plus.OsmandApplication; + +public class LocaleHelper implements StateChangedListener { + + private boolean needRestart = false; + + private OsmandApplication app; + + public LocaleHelper(OsmandApplication app) { + this.app = app; + } + + public void listenLocaleChanges() { + app.getSettings().PREFERRED_LOCALE.addListener(this); + } + + public void stopListeningLocaleChanges() { + app.getSettings().PREFERRED_LOCALE.removeListener(this); + } + + public boolean needRestart() { + return needRestart; + } + + public void setNeedRestart(boolean needRestart) { + this.needRestart = needRestart; + } + + @Override + public void stateChanged(String change) { + needRestart = true; + app.checkPreferredLocale(); + } +} 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 11fe377040..2e548f0c2b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -29,6 +29,7 @@ import net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo; import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper.GPXInfo; +import net.osmand.plus.helpers.LocaleHelper; import net.osmand.plus.helpers.SearchHistoryHelper; import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry; import net.osmand.plus.mapmarkers.MapMarker; @@ -193,6 +194,7 @@ public class SettingsHelper { private File file; private SettingsImportListener listener; private List items; + private LocaleHelper localeHelper; ImportItemsAsyncTask(@NonNull File file, @Nullable SettingsImportListener listener, @@ -201,6 +203,12 @@ public class SettingsHelper { this.file = file; this.listener = listener; this.items = items; + localeHelper = app.getLocaleHelper(); + } + + @Override + protected void onPreExecute() { + localeHelper.listenLocaleChanges(); } @Override @@ -218,6 +226,7 @@ public class SettingsHelper { @Override protected void onPostExecute(Boolean success) { + localeHelper.stopListeningLocaleChanges(); finishImport(listener, success, items); } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java index 0d40a3c2f1..ddee0e1393 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java @@ -15,6 +15,7 @@ import android.widget.TextView; import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -28,6 +29,7 @@ import net.osmand.plus.audionotes.AudioVideoNotesPlugin; import net.osmand.plus.base.BaseOsmAndFragment; import net.osmand.plus.dashboard.DashboardOnMap; import net.osmand.plus.dialogs.SelectMapStyleBottomSheetDialogFragment; +import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.osmedit.OsmEditingPlugin; import net.osmand.plus.quickaction.QuickActionListFragment; @@ -97,6 +99,10 @@ public class ImportCompleteFragment extends BaseOsmAndFragment { dismissFragment(); } }); + if (app.getLocaleHelper().needRestart()) { + app.getLocaleHelper().setNeedRestart(false); + setupRestartButton(root); + } if (Build.VERSION.SDK_INT >= 21) { AndroidUtils.addStatusBarPadding21v(app, root); } @@ -239,6 +245,25 @@ public class ImportCompleteFragment extends BaseOsmAndFragment { } } + private void setupRestartButton(View root) { + View buttonsDivider = root.findViewById(R.id.buttons_divider); + View buttonContainer = root.findViewById(R.id.button_restart_container); + AndroidUiHelper.setVisibility(View.VISIBLE, buttonsDivider, buttonContainer); + + TextView btnRestart = root.findViewById(R.id.button_restart); + btnRestart.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + FragmentActivity activity = getActivity(); + if (activity instanceof MapActivity) { + MapActivity.doRestart(activity); + } else { + android.os.Process.killProcess(android.os.Process.myPid()); + } + } + }); + } + @Override public int getStatusBarColorId() { return nightMode ? R.color.status_bar_color_dark : R.color.status_bar_color_light; From 8044f306e2d2aa5a62f199817301747d1ef5805d Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 11 Feb 2021 12:45:14 +0200 Subject: [PATCH 02/46] Try to fix possible npe --- .../osmand/plus/mapcontextmenu/MapContextMenu.java | 2 +- .../plus/mapcontextmenu/MenuTitleController.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index cd035da4bb..3fe1e4452b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -651,7 +651,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } private void updateTitle(String address) { - nameStr = address; + setNameStr(address); getPointDescription().setName(address); WeakReference fragmentRef = findMenuFragment(); if (fragmentRef != null) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java index f676c5812e..722e09c27d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java @@ -138,6 +138,10 @@ public abstract class MenuTitleController { } } + public void setNameStr(@Nullable String nameStr) { + this.nameStr = nameStr != null ? nameStr : ""; + } + protected boolean needStreetName() { MenuController menuController = getMenuController(); boolean res = getObject() != null || Algorithms.isEmpty(getPointDescription().getName()); @@ -165,28 +169,28 @@ public abstract class MenuTitleController { protected void acquireNameAndType() { String firstNameStr = ""; - nameStr = ""; typeStr = ""; commonTypeStr = ""; streetStr = ""; + setNameStr(""); MenuController menuController = getMenuController(); if (menuController != null) { firstNameStr = menuController.getFirstNameStr(); - nameStr = menuController.getNameStr(); + setNameStr(menuController.getNameStr()); typeStr = menuController.getTypeStr(); commonTypeStr = menuController.getCommonTypeStr(); } if (Algorithms.isEmpty(nameStr)) { - nameStr = typeStr; + setNameStr(typeStr); typeStr = commonTypeStr; } else if (Algorithms.isEmpty(typeStr)) { typeStr = commonTypeStr; } if (!Algorithms.isEmpty(firstNameStr)) { - nameStr = firstNameStr + " (" + nameStr + ")"; + setNameStr(firstNameStr + " (" + nameStr + ")"); } } @@ -204,7 +208,7 @@ public abstract class MenuTitleController { } if (displayStreetNameInTitle()) { - nameStr = streetStr; + setNameStr(streetStr); getPointDescription().setName(nameStr); } onSearchAddressDone(); From 33a2cf6ba3cac4e60673aa0e51aeae5030d8a55c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 11 Feb 2021 13:12:40 +0200 Subject: [PATCH 03/46] Fix possible npe --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 51e7370da6..2c6666e925 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -1369,7 +1369,9 @@ public class MenuBuilder { if (amenity != null) { PoiCategory category = amenity.getType(); PoiType poiType = category.getPoiTypeByKeyName(amenity.getSubType()); - return app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + poiType.getKeyName()); + if (poiType != null) { + return app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + poiType.getKeyName()); + } } return null; } From 3cf65218b25e511477a12a7d6ab54a9138a7b5aa Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 11 Feb 2021 23:58:19 +0200 Subject: [PATCH 04/46] Fix bookmarks --- .../plus/wikivoyage/data/TravelObfHelper.java | 177 ++++++++++++++---- 1 file changed, 143 insertions(+), 34 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 2d76743c65..67fee65a9d 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -70,6 +70,7 @@ public class TravelObfHelper implements TravelHelper { public static final String ROUTE_ARTICLE_POINT = "route_article_point"; public static final String ROUTE_TRACK = "route_track"; public static final int ARTICLE_SEARCH_RADIUS = 50000; + public static final int SAVED_ARTICLE_SEARCH_RADIUS = 30000; public static final int MAX_POPULAR_ARTICLES_COUNT = 30; public static final String REF_TAG = "ref"; public static final String NAME_TAG = "name"; @@ -240,6 +241,24 @@ public class TravelObfHelper implements TravelHelper { }; } + @NonNull + private SearchPoiTypeFilter getSubcategoriesSearchFilter(final String... filterSubcategory) { + return new SearchPoiTypeFilter() { + @Override + public boolean accept(PoiCategory type, String subcategory) { + for (String filterSubcategory : filterSubcategory) { + return subcategory.equals(filterSubcategory); + } + return false; + } + + @Override + public boolean isEmpty() { + return false; + } + }; + } + @NonNull private Map readArticles(@NonNull File file, @NonNull Amenity amenity) { Map articles = new HashMap<>(); @@ -681,55 +700,145 @@ public class TravelObfHelper implements TravelHelper { private synchronized TravelArticle findArticleById(@NonNull final TravelArticleIdentifier articleId, final String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + final List> amenities = new ArrayList<>(); TravelArticle article = null; - final boolean isDbArticle = articleId.file != null && articleId.file.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT); - final List amenities = new ArrayList<>(); - for (BinaryMapIndexReader reader : getReaders()) { + SearchRequest req = null; + for (final BinaryMapIndexReader reader : getReaders()) { try { - if (articleId.file != null && !articleId.file.equals(reader.getFile()) && !isDbArticle) { - continue; + if (articleId.file != null && articleId.file.equals(reader.getFile())) { + if (articleId.file.lastModified() == reader.getFile().lastModified()) { + req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, + Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, + getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { + boolean done = false; + + @Override + public boolean publish(Amenity amenity) { + if (Algorithms.stringsEqual(articleId.routeId, + Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID)))) { + amenities.add(new Pair<>(reader.getFile(), amenity)); + done = true; + } + return false; + } + + @Override + public boolean isCancelled() { + return done; + } + }, null); + req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS); + } else { + req = getEqualsTitleRequest(articleId, lang, amenities, reader); + req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS / 10); + } } - SearchRequest req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, - Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, - getSearchFilter(ROUTE_ARTICLE), new ResultMatcher() { - boolean done = false; - - @Override - public boolean publish(Amenity amenity) { - if (Algorithms.stringsEqual(articleId.routeId, - Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID))) || isDbArticle) { - amenities.add(amenity); - done = true; - } - return false; - } - - @Override - public boolean isCancelled() { - return done; - } - }, null); - - if (!Double.isNaN(articleId.lat)) { - req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS); - if (!Algorithms.isEmpty(articleId.title)) { - reader.searchPoiByName(req); + if (req != null) { + if (!Double.isNaN(articleId.lat)) { + if (!Algorithms.isEmpty(articleId.title)) { + reader.searchPoiByName(req); + } else { + reader.searchPoi(req); + } } else { reader.searchPoi(req); } - } else { - reader.searchPoi(req); + break; } } catch (IOException e) { LOG.error(e.getMessage()); } - if (!Algorithms.isEmpty(amenities)) { - article = cacheTravelArticles(reader.getFile(), amenities.get(0), lang, readGpx, callback); + } + if (amenities.isEmpty()) { + for (BinaryMapIndexReader reader : getReaders()) { + try { + req = getEqualsTitleRequest(articleId, lang, amenities, reader); + req.setBBoxRadius(articleId.lat, articleId.lon, SAVED_ARTICLE_SEARCH_RADIUS); + if (!Double.isNaN(articleId.lat)) { + if (!Algorithms.isEmpty(articleId.title)) { + reader.searchPoiByName(req); + } else { + reader.searchPoi(req); + } + } else { + reader.searchPoi(req); + } + } catch (IOException e) { + LOG.error(e.getMessage()); + } } } + if (amenities.isEmpty()) { + for (final BinaryMapIndexReader reader : getReaders()) { + try { + req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, + Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, + getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { + boolean done = false; + + @Override + public boolean publish(Amenity amenity) { + if (Algorithms.stringsEqual(articleId.routeId, + Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID))) + && Algorithms.stringsEqual(articleId.routeSource, + Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_SOURCE)))) { + amenities.add(new Pair<>(reader.getFile(), amenity)); + done = true; + } + return false; + } + + @Override + public boolean isCancelled() { + return done; + } + }, null); + req.setBBoxRadius(articleId.lat, articleId.lon, SAVED_ARTICLE_SEARCH_RADIUS); + if (!Double.isNaN(articleId.lat)) { + if (!Algorithms.isEmpty(articleId.title)) { + reader.searchPoiByName(req); + } else { + reader.searchPoi(req); + } + } else { + reader.searchPoi(req); + } + } catch (IOException e) { + LOG.error(e.getMessage()); + } + } + } + if (!Algorithms.isEmpty(amenities)) { + article = cacheTravelArticles(amenities.get(0).first, amenities.get(0).second, lang, readGpx, callback); + } return article; } + private SearchRequest getEqualsTitleRequest(@NonNull final TravelArticleIdentifier articleId, + final String lang, final List> amenities, + final BinaryMapIndexReader reader) { + return BinaryMapIndexReader.buildSearchPoiRequest(0, 0, + Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, + getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { + boolean done = false; + + @Override + public boolean publish(Amenity amenity) { + if (Algorithms.stringsEqual(Algorithms.emptyIfNull(articleId.title), + Algorithms.emptyIfNull(amenity.getName(lang)))) { + amenities.add(new Pair<>(reader.getFile(), amenity)); + done = true; + } + return false; + } + + @Override + public boolean isCancelled() { + return done; + } + }, null); + } + @Nullable @Override public TravelArticle getArticleByTitle(@NonNull final String title, @NonNull final String lang, From d51683778d729e2551f44e18a52251d25adceaa5 Mon Sep 17 00:00:00 2001 From: ivanPyrohivskyi Date: Fri, 12 Feb 2021 12:30:37 +0200 Subject: [PATCH 05/46] Implement precision result from 26 zoom --- .../binary/BinaryMapPoiReaderAdapter.java | 31 +- .../java/net/osmand/binary/OsmandOdb.java | 281 ++++++++++++++++-- 2 files changed, 284 insertions(+), 28 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java index fd6fe7bce9..ee3fe4a6fa 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -714,6 +714,10 @@ public class BinaryMapPoiReaderAdapter { Amenity am = null; int x = 0; int y = 0; + int preciseX = 0; + int preciseY = 0; + boolean isPrecised = false; + boolean hasLocation = false; StringBuilder retValue = new StringBuilder(); PoiCategory amenityType = null; LinkedList textTags = null; @@ -740,6 +744,13 @@ public class BinaryMapPoiReaderAdapter { am.setRoutePoint(arp); } } + if (hasLocation) { + if (isPrecised) { + am.setLocation(MapUtils.get31LatitudeY(preciseY), MapUtils.get31LongitudeX(preciseX)); + } else { + am.setLocation(MapUtils.get31LatitudeY(y), MapUtils.get31LongitudeX(x)); + } + } return am; case OsmandOdb.OsmAndPoiBoxDataAtom.DX_FIELD_NUMBER: x = (codedIS.readSInt32() + (px << (24 - zoom))) << 7; @@ -754,7 +765,8 @@ public class BinaryMapPoiReaderAdapter { } } am = new Amenity(); - am.setLocation(MapUtils.get31LatitudeY(y), MapUtils.get31LongitudeX(x)); + hasLocation = true; + //am.setLocation(MapUtils.get31LatitudeY(y), MapUtils.get31LongitudeX(x)); // set precise coordinates break; case OsmandOdb.OsmAndPoiBoxDataAtom.SUBCATEGORIES_FIELD_NUMBER: int subtypev = codedIS.readUInt32(); @@ -827,6 +839,23 @@ public class BinaryMapPoiReaderAdapter { case OsmandOdb.OsmAndPoiBoxDataAtom.NOTE_FIELD_NUMBER: am.setDescription(codedIS.readString()); break; + case OsmandOdb.OsmAndPoiBoxDataAtom.PRECISEDX_FIELD_NUMBER: + if (hasLocation) { + preciseX = codedIS.readSInt32() + x; + } + break; + case OsmandOdb.OsmAndPoiBoxDataAtom.PRECISEDY_FIELD_NUMBER: + if (hasLocation) { + preciseY = codedIS.readSInt32() + y; + if (checkBounds) { + if (left31 > preciseX || right31 < preciseX || top31 > preciseY || bottom31 < preciseY) { + codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); + return null; + } + } + isPrecised = true; + } + break; default: skipUnknownField(t); break; diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java index 97a2abeb91..6adce33378 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java @@ -54371,6 +54371,42 @@ public final class OsmandOdb { */ com.google.protobuf.ByteString getTextValuesBytes(int index); + + // optional sint32 preciseDx = 16; + /** + * optional sint32 preciseDx = 16; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + boolean hasPreciseDx(); + /** + * optional sint32 preciseDx = 16; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + int getPreciseDx(); + + // optional sint32 preciseDy = 17; + /** + * optional sint32 preciseDy = 17; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + boolean hasPreciseDy(); + /** + * optional sint32 preciseDy = 17; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + int getPreciseDy(); } /** * Protobuf type {@code OsmAnd.OBF.OsmAndPoiBoxDataAtom} @@ -54539,6 +54575,16 @@ public final class OsmandOdb { textValues_.add(input.readBytes()); break; } + case 128: { + bitField0_ |= 0x00000200; + preciseDx_ = input.readSInt32(); + break; + } + case 136: { + bitField0_ |= 0x00000400; + preciseDy_ = input.readSInt32(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -55048,6 +55094,54 @@ public final class OsmandOdb { return textValues_.getByteString(index); } + // optional sint32 preciseDx = 16; + public static final int PRECISEDX_FIELD_NUMBER = 16; + private int preciseDx_; + /** + * optional sint32 preciseDx = 16; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + public boolean hasPreciseDx() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional sint32 preciseDx = 16; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + public int getPreciseDx() { + return preciseDx_; + } + + // optional sint32 preciseDy = 17; + public static final int PRECISEDY_FIELD_NUMBER = 17; + private int preciseDy_; + /** + * optional sint32 preciseDy = 17; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + public boolean hasPreciseDy() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional sint32 preciseDy = 17; + * + *
+     * diff between deltas of 28 and 24 zooms
+     * 
+ */ + public int getPreciseDy() { + return preciseDy_; + } + private void initFields() { dx_ = 0; dy_ = 0; @@ -55062,6 +55156,8 @@ public final class OsmandOdb { note_ = ""; textCategories_ = java.util.Collections.emptyList(); textValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; + preciseDx_ = 0; + preciseDy_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -55122,6 +55218,12 @@ public final class OsmandOdb { for (int i = 0; i < textValues_.size(); i++) { output.writeBytes(15, textValues_.getByteString(i)); } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeSInt32(16, preciseDx_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeSInt32(17, preciseDy_); + } getUnknownFields().writeTo(output); } @@ -55203,6 +55305,14 @@ public final class OsmandOdb { size += dataSize; size += 1 * getTextValuesList().size(); } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(16, preciseDx_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(17, preciseDy_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -55345,6 +55455,10 @@ public final class OsmandOdb { bitField0_ = (bitField0_ & ~0x00000800); textValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00001000); + preciseDx_ = 0; + bitField0_ = (bitField0_ & ~0x00002000); + preciseDy_ = 0; + bitField0_ = (bitField0_ & ~0x00004000); return this; } @@ -55430,6 +55544,14 @@ public final class OsmandOdb { bitField0_ = (bitField0_ & ~0x00001000); } result.textValues_ = textValues_; + if (((from_bitField0_ & 0x00002000) == 0x00002000)) { + to_bitField0_ |= 0x00000200; + } + result.preciseDx_ = preciseDx_; + if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + to_bitField0_ |= 0x00000400; + } + result.preciseDy_ = preciseDy_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -55525,6 +55647,12 @@ public final class OsmandOdb { } onChanged(); } + if (other.hasPreciseDx()) { + setPreciseDx(other.getPreciseDx()); + } + if (other.hasPreciseDy()) { + setPreciseDy(other.getPreciseDy()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -56506,6 +56634,104 @@ public final class OsmandOdb { return this; } + // optional sint32 preciseDx = 16; + private int preciseDx_ ; + /** + * optional sint32 preciseDx = 16; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public boolean hasPreciseDx() { + return ((bitField0_ & 0x00002000) == 0x00002000); + } + /** + * optional sint32 preciseDx = 16; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public int getPreciseDx() { + return preciseDx_; + } + /** + * optional sint32 preciseDx = 16; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public Builder setPreciseDx(int value) { + bitField0_ |= 0x00002000; + preciseDx_ = value; + onChanged(); + return this; + } + /** + * optional sint32 preciseDx = 16; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public Builder clearPreciseDx() { + bitField0_ = (bitField0_ & ~0x00002000); + preciseDx_ = 0; + onChanged(); + return this; + } + + // optional sint32 preciseDy = 17; + private int preciseDy_ ; + /** + * optional sint32 preciseDy = 17; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public boolean hasPreciseDy() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + /** + * optional sint32 preciseDy = 17; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public int getPreciseDy() { + return preciseDy_; + } + /** + * optional sint32 preciseDy = 17; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public Builder setPreciseDy(int value) { + bitField0_ |= 0x00004000; + preciseDy_ = value; + onChanged(); + return this; + } + /** + * optional sint32 preciseDy = 17; + * + *
+       * diff between deltas of 28 and 24 zooms
+       * 
+ */ + public Builder clearPreciseDy() { + bitField0_ = (bitField0_ & ~0x00004000); + preciseDy_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:OsmAnd.OBF.OsmAndPoiBoxDataAtom) } @@ -65008,37 +65234,38 @@ public final class OsmandOdb { "tegories\030\003 \003(\r\022\025\n\rsubcategories\030\005 \003(\r\"i\n" + "\020OsmAndPoiBoxData\022\014\n\004zoom\030\001 \001(\r\022\t\n\001x\030\002 \001" + "(\r\022\t\n\001y\030\003 \001(\r\0221\n\007poiData\030\005 \003(\0132 .OsmAnd." + - "OBF.OsmAndPoiBoxDataAtom\"\360\001\n\024OsmAndPoiBo", + "OBF.OsmAndPoiBoxDataAtom\"\226\002\n\024OsmAndPoiBo", "xDataAtom\022\n\n\002dx\030\002 \002(\021\022\n\n\002dy\030\003 \002(\021\022\022\n\ncat" + "egories\030\004 \003(\r\022\025\n\rsubcategories\030\005 \003(\r\022\014\n\004" + "name\030\006 \001(\t\022\016\n\006nameEn\030\007 \001(\t\022\n\n\002id\030\010 \001(\004\022\024" + "\n\014openingHours\030\n \001(\t\022\014\n\004site\030\013 \001(\t\022\r\n\005ph" + "one\030\014 \001(\t\022\014\n\004note\030\r \001(\t\022\026\n\016textCategorie" + - "s\030\016 \003(\r\022\022\n\ntextValues\030\017 \003(\t\"\032\n\007IdTable\022\017" + - "\n\007routeId\030\001 \003(\022\"F\n\017RestrictionData\022\014\n\004ty" + - "pe\030\001 \002(\005\022\014\n\004from\030\002 \002(\005\022\n\n\002to\030\003 \002(\005\022\013\n\003vi" + - "a\030\004 \001(\005\"x\n\tRouteData\022\016\n\006points\030\001 \002(\014\022\022\n\n" + - "pointTypes\030\004 \001(\014\022\022\n\npointNames\030\005 \001(\014\022\r\n\005", - "types\030\007 \002(\014\022\017\n\007routeId\030\014 \002(\005\022\023\n\013stringNa" + - "mes\030\016 \001(\014\"\304\005\n\022OsmAndRoutingIndex\022\014\n\004name" + - "\030\001 \002(\t\022?\n\005rules\030\002 \003(\01320.OsmAnd.OBF.OsmAn" + - "dRoutingIndex.RouteEncodingRule\022>\n\trootB" + - "oxes\030\003 \003(\0132+.OsmAnd.OBF.OsmAndRoutingInd" + - "ex.RouteDataBox\022A\n\014basemapBoxes\030\004 \003(\0132+." + - "OsmAnd.OBF.OsmAndRoutingIndex.RouteDataB" + - "ox\022=\n\006blocks\030\005 \003(\0132-.OsmAnd.OBF.OsmAndRo" + - "utingIndex.RouteDataBlock\032;\n\021RouteEncodi" + - "ngRule\022\013\n\003tag\030\003 \002(\t\022\r\n\005value\030\005 \002(\t\022\n\n\002id", - "\030\007 \001(\r\032\231\001\n\014RouteDataBox\022\014\n\004left\030\001 \002(\021\022\r\n" + - "\005right\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\022\016\n\006bottom\030\004 \002(" + - "\021\022\023\n\013shiftToData\030\005 \001(\007\022:\n\005boxes\030\007 \003(\0132+." + - "OsmAnd.OBF.OsmAndRoutingIndex.RouteDataB" + - "ox\032\303\001\n\016RouteDataBlock\022$\n\007idTable\030\005 \001(\0132\023" + - ".OsmAnd.OBF.IdTable\022*\n\013dataObjects\030\006 \003(\013" + - "2\025.OsmAnd.OBF.RouteData\0221\n\014restrictions\030" + - "\007 \003(\0132\033.OsmAnd.OBF.RestrictionData\022,\n\013st" + - "ringTable\030\010 \001(\0132\027.OsmAnd.OBF.StringTable" + - "B\036\n\021net.osmand.binaryB\tOsmandOdb" + "s\030\016 \003(\r\022\022\n\ntextValues\030\017 \003(\t\022\021\n\tpreciseDx" + + "\030\020 \001(\021\022\021\n\tpreciseDy\030\021 \001(\021\"\032\n\007IdTable\022\017\n\007" + + "routeId\030\001 \003(\022\"F\n\017RestrictionData\022\014\n\004type" + + "\030\001 \002(\005\022\014\n\004from\030\002 \002(\005\022\n\n\002to\030\003 \002(\005\022\013\n\003via\030" + + "\004 \001(\005\"x\n\tRouteData\022\016\n\006points\030\001 \002(\014\022\022\n\npo", + "intTypes\030\004 \001(\014\022\022\n\npointNames\030\005 \001(\014\022\r\n\005ty" + + "pes\030\007 \002(\014\022\017\n\007routeId\030\014 \002(\005\022\023\n\013stringName" + + "s\030\016 \001(\014\"\304\005\n\022OsmAndRoutingIndex\022\014\n\004name\030\001" + + " \002(\t\022?\n\005rules\030\002 \003(\01320.OsmAnd.OBF.OsmAndR" + + "outingIndex.RouteEncodingRule\022>\n\trootBox" + + "es\030\003 \003(\0132+.OsmAnd.OBF.OsmAndRoutingIndex" + + ".RouteDataBox\022A\n\014basemapBoxes\030\004 \003(\0132+.Os" + + "mAnd.OBF.OsmAndRoutingIndex.RouteDataBox" + + "\022=\n\006blocks\030\005 \003(\0132-.OsmAnd.OBF.OsmAndRout" + + "ingIndex.RouteDataBlock\032;\n\021RouteEncoding", + "Rule\022\013\n\003tag\030\003 \002(\t\022\r\n\005value\030\005 \002(\t\022\n\n\002id\030\007" + + " \001(\r\032\231\001\n\014RouteDataBox\022\014\n\004left\030\001 \002(\021\022\r\n\005r" + + "ight\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\022\016\n\006bottom\030\004 \002(\021\022" + + "\023\n\013shiftToData\030\005 \001(\007\022:\n\005boxes\030\007 \003(\0132+.Os" + + "mAnd.OBF.OsmAndRoutingIndex.RouteDataBox" + + "\032\303\001\n\016RouteDataBlock\022$\n\007idTable\030\005 \001(\0132\023.O" + + "smAnd.OBF.IdTable\022*\n\013dataObjects\030\006 \003(\0132\025" + + ".OsmAnd.OBF.RouteData\0221\n\014restrictions\030\007 " + + "\003(\0132\033.OsmAnd.OBF.RestrictionData\022,\n\013stri" + + "ngTable\030\010 \001(\0132\027.OsmAnd.OBF.StringTableB\036", + "\n\021net.osmand.binaryB\tOsmandOdb" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -65296,7 +65523,7 @@ public final class OsmandOdb { internal_static_OsmAnd_OBF_OsmAndPoiBoxDataAtom_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_OsmAnd_OBF_OsmAndPoiBoxDataAtom_descriptor, - new java.lang.String[] { "Dx", "Dy", "Categories", "Subcategories", "Name", "NameEn", "Id", "OpeningHours", "Site", "Phone", "Note", "TextCategories", "TextValues", }); + new java.lang.String[] { "Dx", "Dy", "Categories", "Subcategories", "Name", "NameEn", "Id", "OpeningHours", "Site", "Phone", "Note", "TextCategories", "TextValues", "PreciseDx", "PreciseDy", }); internal_static_OsmAnd_OBF_IdTable_descriptor = getDescriptor().getMessageTypes().get(36); internal_static_OsmAnd_OBF_IdTable_fieldAccessorTable = new From 06a85035ccffacc4c2fba548327c5c009445c556 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 12 Feb 2021 13:07:15 +0200 Subject: [PATCH 06/46] Fix bookmarks --- .../plus/wikivoyage/data/TravelDbHelper.java | 6 ++++ .../plus/wikivoyage/data/TravelHelper.java | 3 ++ .../data/TravelLocalDataHelper.java | 8 ++--- .../plus/wikivoyage/data/TravelObfHelper.java | 29 +++++++++++++++---- 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index 0fc6c232f9..68595ea71e 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -605,6 +605,12 @@ public class TravelDbHelper implements TravelHelper { return res; } + @Override + public TravelArticle checkExistedArticle(@Nullable TravelArticle article, @Nullable TravelArticleIdentifier articleId, + @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + return article; + } + @Nullable @Override public TravelArticleIdentifier getArticleId(@NonNull String title, @NonNull String lang) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java index 7e89431690..0f822cac66 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java @@ -41,6 +41,9 @@ public interface TravelHelper { @Nullable TravelArticle getArticleById(@NonNull TravelArticleIdentifier articleId, @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback); + @Nullable + TravelArticle checkExistedArticle(@Nullable TravelArticle article,@Nullable TravelArticleIdentifier articleId, @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback); + @Nullable TravelArticle getArticleByTitle(@NonNull String title, @NonNull String lang, boolean readGpx, @Nullable GpxReadCallback callback); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index d95b9239ee..7e073570ff 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -1,9 +1,5 @@ package net.osmand.plus.wikivoyage.data; - -import android.database.DatabaseUtils; -import android.database.sqlite.SQLiteDatabase; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -428,7 +424,9 @@ public class TravelLocalDataHelper { if (cursor.moveToFirst()) { do { TravelArticle dbArticle = readSavedArticle(cursor); - TravelArticle article = context.getTravelHelper().getArticleById(dbArticle.generateIdentifier(), dbArticle.lang, false, null); + dbArticle.generateIdentifier(); + TravelArticle article = context.getTravelHelper().checkExistedArticle(dbArticle, + null,null, false, null); if (article != null && article.getLastModified() > dbArticle.getLastModified()) { updateSavedArticle(dbArticle, article); res.add(article); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 67fee65a9d..53cee47524 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -698,15 +698,32 @@ public class TravelObfHelper implements TravelHelper { } } - private synchronized TravelArticle findArticleById(@NonNull final TravelArticleIdentifier articleId, - final String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + private synchronized TravelArticle findArticleById(@NonNull TravelArticleIdentifier articleId, + String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + return checkExistedArticle(null, articleId, lang, readGpx, callback); + } + + @Override + public synchronized TravelArticle checkExistedArticle(@Nullable TravelArticle checkedArticle, + @Nullable TravelArticleIdentifier articleId, + @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback) { final List> amenities = new ArrayList<>(); TravelArticle article = null; + long lastModified; + if (checkedArticle != null) { + articleId = checkedArticle.generateIdentifier(); + lang = checkedArticle.getLang(); + lastModified = checkedArticle.getLastModified(); + } else { + lastModified = articleId.file.lastModified(); + } + final TravelArticleIdentifier finalArticleId = articleId; SearchRequest req = null; for (final BinaryMapIndexReader reader : getReaders()) { try { if (articleId.file != null && articleId.file.equals(reader.getFile())) { - if (articleId.file.lastModified() == reader.getFile().lastModified()) { + if (lastModified == reader.getFile().lastModified()) { + req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { @@ -714,7 +731,7 @@ public class TravelObfHelper implements TravelHelper { @Override public boolean publish(Amenity amenity) { - if (Algorithms.stringsEqual(articleId.routeId, + if (Algorithms.stringsEqual(finalArticleId.routeId, Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID)))) { amenities.add(new Pair<>(reader.getFile(), amenity)); done = true; @@ -778,9 +795,9 @@ public class TravelObfHelper implements TravelHelper { @Override public boolean publish(Amenity amenity) { - if (Algorithms.stringsEqual(articleId.routeId, + if (Algorithms.stringsEqual(finalArticleId.routeId, Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID))) - && Algorithms.stringsEqual(articleId.routeSource, + && Algorithms.stringsEqual(finalArticleId.routeSource, Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_SOURCE)))) { amenities.add(new Pair<>(reader.getFile(), amenity)); done = true; From ce0fba0947dc769b1e9e2e9297d7b464135bfa3d Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 12 Feb 2021 12:35:59 +0100 Subject: [PATCH 07/46] Add methods to calculate precision xy --- .../main/java/net/osmand/util/MapUtils.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java index 7a37eee3aa..a9c3411b68 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java @@ -48,6 +48,47 @@ public class MapUtils { 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_', '~' }; + + public static int calculateFromBaseZoomPrecisionXY(int bazeZoom, int finalZoom, int xBase, int yBase) { + int px = xBase; + int py = yBase; + int precisionNumber = 1; + for (int zoom = finalZoom - 1; zoom >= bazeZoom; zoom--) { + int x = px / 2; // (int) MapUtils.getTileNumberX(zoom, lon); + int y = py / 2; // (int) MapUtils.getTileNumberY(zoom, lat); + int deltax = px - x * 2; + int deltay = py - y * 2; + precisionNumber = (precisionNumber << 2) + (deltax << 1) + deltay; + // StringBuilder spaces = new StringBuilder(); + // for (int i = 0; i < 32 - zoom; i++) { + // spaces.append(' '); + // } + // System.out.println(String.format("%d %s + %d %s %s + %d", zoom, Integer.toBinaryString(x), deltax, spaces.toString(), Integer.toBinaryString(y), deltay)); + px = x; + py = y; + } + System.out.println(String.format("Bits: %d %s (%d)", Integer.toBinaryString(precisionNumber).length(), Integer.toBinaryString(precisionNumber), precisionNumber)); + return precisionNumber; + } + + public static int[] calculateFinalXYFromBaseAndPrecisionXY(int bazeZoom, int finalZoom, + int precisionXY, int xBase, int yBase, boolean ignoreNotEnoughPrecision) { + // System.out.println(String.format("Base x, y at zoom %d: %d %d", zoomToStart, xBaseApproximation, yBaseApproximation)); + // calculate finish approximation using precisionNumber + int finalX = xBase; + int finalY = yBase; + int precisionCalc = precisionXY; + for (int zoom = bazeZoom; zoom < finalZoom; zoom++) { + if (precisionCalc <= 1 && precisionCalc > 0 && !ignoreNotEnoughPrecision) { + throw new IllegalArgumentException("Not enough bits to retrieve zoom approximation"); + } + finalY = finalY * 2 + (precisionXY & 1); + finalX = finalX * 2 + ((precisionXY & 2) >> 1); + precisionXY = precisionXY >> 2; + } + // System.out.println(String.format("Calc x, y at zoom %d: %d %d", finalZoom, finalX, finalY)); + return new int[] { finalX, finalY }; + } From 76e1708058899f4e41eda8e4046cc71b94d20ff9 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 12 Feb 2021 13:59:11 +0200 Subject: [PATCH 08/46] Fix bookmarks --- .../plus/wikivoyage/data/TravelDbHelper.java | 5 +- .../plus/wikivoyage/data/TravelHelper.java | 2 +- .../data/TravelLocalDataHelper.java | 4 +- .../plus/wikivoyage/data/TravelObfHelper.java | 102 +++++++++++------- 4 files changed, 67 insertions(+), 46 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java index 68595ea71e..627f6d7945 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelDbHelper.java @@ -606,9 +606,8 @@ public class TravelDbHelper implements TravelHelper { } @Override - public TravelArticle checkExistedArticle(@Nullable TravelArticle article, @Nullable TravelArticleIdentifier articleId, - @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback) { - return article; + public TravelArticle findSavedArticle(@NonNull TravelArticle savedArticle) { + return savedArticle; } @Nullable diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java index 0f822cac66..0cde849fbf 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelHelper.java @@ -42,7 +42,7 @@ public interface TravelHelper { TravelArticle getArticleById(@NonNull TravelArticleIdentifier articleId, @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback); @Nullable - TravelArticle checkExistedArticle(@Nullable TravelArticle article,@Nullable TravelArticleIdentifier articleId, @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback); + TravelArticle findSavedArticle(@NonNull TravelArticle savedArticle); @Nullable TravelArticle getArticleByTitle(@NonNull String title, @NonNull String lang, boolean readGpx, @Nullable GpxReadCallback callback); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index 7e073570ff..928571f584 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -424,9 +424,7 @@ public class TravelLocalDataHelper { if (cursor.moveToFirst()) { do { TravelArticle dbArticle = readSavedArticle(cursor); - dbArticle.generateIdentifier(); - TravelArticle article = context.getTravelHelper().checkExistedArticle(dbArticle, - null,null, false, null); + TravelArticle article = context.getTravelHelper().findSavedArticle(dbArticle); if (article != null && article.getLastModified() > dbArticle.getLastModified()) { updateSavedArticle(dbArticle, article); res.add(article); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 53cee47524..176a1dc7c8 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -227,22 +227,7 @@ public class TravelObfHelper implements TravelHelper { } @NonNull - private SearchPoiTypeFilter getSearchFilter(final String filterSubcategory) { - return new SearchPoiTypeFilter() { - @Override - public boolean accept(PoiCategory type, String subcategory) { - return subcategory.equals(filterSubcategory); - } - - @Override - public boolean isEmpty() { - return false; - } - }; - } - - @NonNull - private SearchPoiTypeFilter getSubcategoriesSearchFilter(final String... filterSubcategory) { + private SearchPoiTypeFilter getSearchFilter(final String... filterSubcategory) { return new SearchPoiTypeFilter() { @Override public boolean accept(PoiCategory type, String subcategory) { @@ -698,25 +683,64 @@ public class TravelObfHelper implements TravelHelper { } } - private synchronized TravelArticle findArticleById(@NonNull TravelArticleIdentifier articleId, - String lang, boolean readGpx, @Nullable GpxReadCallback callback) { - return checkExistedArticle(null, articleId, lang, readGpx, callback); + private synchronized TravelArticle findArticleById(@NonNull final TravelArticleIdentifier articleId, + String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + TravelArticle article = null; + final boolean isDbArticle = articleId.file != null && articleId.file.getName().endsWith(IndexConstants.BINARY_WIKIVOYAGE_MAP_INDEX_EXT); + final List amenities = new ArrayList<>(); + for (BinaryMapIndexReader reader : getReaders()) { + try { + if (articleId.file != null && !articleId.file.equals(reader.getFile()) && !isDbArticle) { + continue; + } + SearchRequest req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, + Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, + getSearchFilter(ROUTE_ARTICLE), new ResultMatcher() { + boolean done = false; + + @Override + public boolean publish(Amenity amenity) { + if (Algorithms.stringsEqual(articleId.routeId, + Algorithms.emptyIfNull(amenity.getTagContent(Amenity.ROUTE_ID))) || isDbArticle) { + amenities.add(amenity); + done = true; + } + return false; + } + + @Override + public boolean isCancelled() { + return done; + } + }, null); + + if (!Double.isNaN(articleId.lat)) { + req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS); + if (!Algorithms.isEmpty(articleId.title)) { + reader.searchPoiByName(req); + } else { + reader.searchPoi(req); + } + } else { + reader.searchPoi(req); + } + } catch (IOException e) { + LOG.error(e.getMessage()); + } + if (!Algorithms.isEmpty(amenities)) { + article = cacheTravelArticles(reader.getFile(), amenities.get(0), lang, readGpx, callback); + } + } + return article; } @Override - public synchronized TravelArticle checkExistedArticle(@Nullable TravelArticle checkedArticle, - @Nullable TravelArticleIdentifier articleId, - @Nullable String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + public synchronized TravelArticle findSavedArticle(@NonNull TravelArticle savedArticle) { final List> amenities = new ArrayList<>(); TravelArticle article = null; - long lastModified; - if (checkedArticle != null) { - articleId = checkedArticle.generateIdentifier(); - lang = checkedArticle.getLang(); - lastModified = checkedArticle.getLastModified(); - } else { - lastModified = articleId.file.lastModified(); - } + TravelArticleIdentifier articleId = savedArticle.generateIdentifier(); + String lang = savedArticle.getLang(); + long lastModified = savedArticle.getLastModified(); final TravelArticleIdentifier finalArticleId = articleId; SearchRequest req = null; for (final BinaryMapIndexReader reader : getReaders()) { @@ -726,7 +750,7 @@ public class TravelObfHelper implements TravelHelper { req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, - getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { + getSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { boolean done = false; @Override @@ -790,7 +814,7 @@ public class TravelObfHelper implements TravelHelper { try { req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, - getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { + getSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { boolean done = false; @Override @@ -826,17 +850,17 @@ public class TravelObfHelper implements TravelHelper { } } if (!Algorithms.isEmpty(amenities)) { - article = cacheTravelArticles(amenities.get(0).first, amenities.get(0).second, lang, readGpx, callback); + article = cacheTravelArticles(amenities.get(0).first, amenities.get(0).second, lang, false, null); } return article; } private SearchRequest getEqualsTitleRequest(@NonNull final TravelArticleIdentifier articleId, - final String lang, final List> amenities, - final BinaryMapIndexReader reader) { + final String lang, final List> amenities, + final BinaryMapIndexReader reader) { return BinaryMapIndexReader.buildSearchPoiRequest(0, 0, Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, - getSubcategoriesSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { + getSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { boolean done = false; @Override @@ -859,14 +883,14 @@ public class TravelObfHelper implements TravelHelper { @Nullable @Override public TravelArticle getArticleByTitle(@NonNull final String title, @NonNull final String lang, - boolean readGpx, @Nullable GpxReadCallback callback) { + boolean readGpx, @Nullable GpxReadCallback callback) { return getArticleByTitle(title, new QuadRect(), lang, readGpx, callback); } @Nullable @Override public TravelArticle getArticleByTitle(@NonNull final String title, @NonNull LatLon latLon, - @NonNull final String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + @NonNull final String lang, boolean readGpx, @Nullable GpxReadCallback callback) { QuadRect rect = MapUtils.calculateLatLonBbox(latLon.getLatitude(), latLon.getLongitude(), ARTICLE_SEARCH_RADIUS); return getArticleByTitle(title, rect, lang, readGpx, callback); } @@ -874,7 +898,7 @@ public class TravelObfHelper implements TravelHelper { @Nullable @Override public synchronized TravelArticle getArticleByTitle(@NonNull final String title, @NonNull QuadRect rect, - @NonNull final String lang, boolean readGpx, @Nullable GpxReadCallback callback) { + @NonNull final String lang, boolean readGpx, @Nullable GpxReadCallback callback) { TravelArticle article = null; final List amenities = new ArrayList<>(); int x = 0; From c54e4d7a386abfa7b2e3985773cfad56db175ba3 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 12 Feb 2021 15:42:19 +0200 Subject: [PATCH 09/46] Show articles by 30 --- .../plus/wikivoyage/data/TravelObfHelper.java | 78 ++++++++++--------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 2d76743c65..cd215fc28c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -115,47 +115,49 @@ public class TravelObfHelper implements TravelHelper { public synchronized List loadPopularArticles() { String lang = app.getLanguage(); List popularArticles = new ArrayList<>(this.popularArticles); - if (foundAmenities.size() - foundAmenitiesIndex < MAX_POPULAR_ARTICLES_COUNT) { - final LatLon location = app.getMapViewTrackingUtilities().getMapLocation(); - for (final BinaryMapIndexReader reader : getReaders()) { - try { - searchAmenity(foundAmenities, location, reader, searchRadius, -1, ROUTE_ARTICLE); - searchAmenity(foundAmenities, location, reader, searchRadius / 5, 15, ROUTE_TRACK); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - if (foundAmenities.size() > 0) { - Collections.sort(foundAmenities, new Comparator>() { - @Override - public int compare(Pair article1, Pair article2) { - Amenity amenity1 = (Amenity) article1.second; - double d1 = MapUtils.getDistance(amenity1.getLocation(), location) - / (ROUTE_ARTICLE.equals(amenity1.getSubType()) ? 5 : 1); - Amenity amenity2 = (Amenity) article2.second; - double d2 = MapUtils.getDistance(amenity2.getLocation(), location) - / (ROUTE_ARTICLE.equals(amenity2.getSubType()) ? 5 : 1); - return Double.compare(d1, d2); - } - }); - } - searchRadius *= 2; - } - - int pagesCount = popularArticles.size() / MAX_POPULAR_ARTICLES_COUNT; - while (foundAmenitiesIndex < foundAmenities.size() - 1) { - Pair amenity = foundAmenities.get(foundAmenitiesIndex); - if (!Algorithms.isEmpty(amenity.second.getName(lang))) { - TravelArticle article = cacheTravelArticles(amenity.first, amenity.second, lang, false, null); - if (article != null && !popularArticles.contains(article)) { - popularArticles.add(article); - if (popularArticles.size() >= (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT) { - break; + int pagesCount; + do { + if (foundAmenities.size() - foundAmenitiesIndex < MAX_POPULAR_ARTICLES_COUNT) { + final LatLon location = app.getMapViewTrackingUtilities().getMapLocation(); + for (final BinaryMapIndexReader reader : getReaders()) { + try { + searchAmenity(foundAmenities, location, reader, searchRadius, -1, ROUTE_ARTICLE); + searchAmenity(foundAmenities, location, reader, searchRadius / 5, 15, ROUTE_TRACK); + } catch (Exception e) { + LOG.error(e.getMessage(), e); } } + if (foundAmenities.size() > 0) { + Collections.sort(foundAmenities, new Comparator>() { + @Override + public int compare(Pair article1, Pair article2) { + Amenity amenity1 = (Amenity) article1.second; + double d1 = MapUtils.getDistance(amenity1.getLocation(), location) + / (ROUTE_ARTICLE.equals(amenity1.getSubType()) ? 5 : 1); + Amenity amenity2 = (Amenity) article2.second; + double d2 = MapUtils.getDistance(amenity2.getLocation(), location) + / (ROUTE_ARTICLE.equals(amenity2.getSubType()) ? 5 : 1); + return Double.compare(d1, d2); + } + }); + } + searchRadius *= 2; } - foundAmenitiesIndex++; - } + pagesCount = popularArticles.size() / MAX_POPULAR_ARTICLES_COUNT; + while (foundAmenitiesIndex < foundAmenities.size() - 1) { + Pair amenity = foundAmenities.get(foundAmenitiesIndex); + if (!Algorithms.isEmpty(amenity.second.getName(lang))) { + TravelArticle article = cacheTravelArticles(amenity.first, amenity.second, lang, false, null); + if (article != null && !popularArticles.contains(article)) { + popularArticles.add(article); + if (popularArticles.size() >= (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT) { + break; + } + } + } + foundAmenitiesIndex++; + } + } while (popularArticles.size() < (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT); this.popularArticles = popularArticles; return popularArticles; } From 233a4ba3d7c4adf6e6c00750cbf5eab3e65d6d95 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 12 Feb 2021 17:13:26 +0200 Subject: [PATCH 10/46] remove "Show more" button when all travel files deleted. --- .../explore/ExploreTabFragment.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index ff692f8f1c..7255694422 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -186,28 +186,28 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv } } } - - TravelButtonCard travelButtonCard = new TravelButtonCard(app, nightMode); - travelButtonCard.setListener(new TravelNeededMapsCard.CardListener() { - @Override - public void onPrimaryButtonClick() { - if (activity instanceof WikivoyageExploreActivity) { - new LoadWikivoyageData((WikivoyageExploreActivity) activity,false).execute(); + if (app.getTravelHelper().isAnyTravelBookPresent()) { + TravelButtonCard travelButtonCard = new TravelButtonCard(app, nightMode); + travelButtonCard.setListener(new TravelNeededMapsCard.CardListener() { + @Override + public void onPrimaryButtonClick() { + if (activity instanceof WikivoyageExploreActivity) { + new LoadWikivoyageData((WikivoyageExploreActivity) activity, false).execute(); + } } - } - @Override - public void onSecondaryButtonClick() { + @Override + public void onSecondaryButtonClick() { - } + } - @Override - public void onIndexItemClick(IndexItem item) { - - } - }); - items.add(travelButtonCard); + @Override + public void onIndexItemClick(IndexItem item) { + } + }); + items.add(travelButtonCard); + } items.add(new StartEditingTravelCard(activity, nightMode)); adapter.setItems(items); final DownloadIndexesThread downloadThread = app.getDownloadThread(); @@ -248,11 +248,14 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv } private void addIndexItemCards(List mainIndexItem, List neededIndexItems) { - this.mainIndexItems.clear(); - this.mainIndexItems.addAll(mainIndexItem); + final OsmandApplication app = getMyApplication(); + if (app != null && !app.getTravelHelper().isAnyTravelBookPresent()) { + this.mainIndexItems.clear(); + this.mainIndexItems.addAll(mainIndexItem); + addDownloadUpdateCard(); + } this.neededIndexItems.clear(); this.neededIndexItems.addAll(neededIndexItems); - addDownloadUpdateCard(); addNeededMapsCard(); } From 4a0eab97a189ba75fe19f68abca93d96e57d9f49 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Fri, 12 Feb 2021 17:23:08 +0200 Subject: [PATCH 11/46] Fix empty names --- .../plus/wikivoyage/data/TravelObfHelper.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 176a1dc7c8..fc59ae3daf 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -747,7 +747,6 @@ public class TravelObfHelper implements TravelHelper { try { if (articleId.file != null && articleId.file.equals(reader.getFile())) { if (lastModified == reader.getFile().lastModified()) { - req = BinaryMapIndexReader.buildSearchPoiRequest(0, 0, Algorithms.emptyIfNull(articleId.title), 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, getSearchFilter(ROUTE_ARTICLE, ROUTE_TRACK), new ResultMatcher() { @@ -770,8 +769,10 @@ public class TravelObfHelper implements TravelHelper { }, null); req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS); } else { - req = getEqualsTitleRequest(articleId, lang, amenities, reader); - req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS / 10); + if (!Algorithms.isEmpty(articleId.title)) { + req = getEqualsTitleRequest(articleId, lang, amenities, reader); + req.setBBoxRadius(articleId.lat, articleId.lon, ARTICLE_SEARCH_RADIUS / 10); + } } } if (req != null) { @@ -790,17 +791,13 @@ public class TravelObfHelper implements TravelHelper { LOG.error(e.getMessage()); } } - if (amenities.isEmpty()) { + if (amenities.isEmpty() && !Algorithms.isEmpty(articleId.title)) { for (BinaryMapIndexReader reader : getReaders()) { try { req = getEqualsTitleRequest(articleId, lang, amenities, reader); req.setBBoxRadius(articleId.lat, articleId.lon, SAVED_ARTICLE_SEARCH_RADIUS); if (!Double.isNaN(articleId.lat)) { - if (!Algorithms.isEmpty(articleId.title)) { - reader.searchPoiByName(req); - } else { - reader.searchPoi(req); - } + reader.searchPoiByName(req); } else { reader.searchPoi(req); } From e1d02fabd22ba819f43ac2c8c453f039495cdc86 Mon Sep 17 00:00:00 2001 From: cepprice Date: Fri, 12 Feb 2021 20:41:23 +0500 Subject: [PATCH 12/46] Don't overwrite GPX file if it's there were no changes --- .../plus/measurementtool/MeasurementToolFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index cc17d2ac9f..5361ebf7cb 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -496,8 +496,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route public void onClick(View v) { if (isFollowTrackMode()) { startTrackNavigation(); - } else { + } else if (editingCtx.isNewData() || editingCtx.hasChanges()) { saveChanges(FinalSaveAction.SHOW_SNACK_BAR_AND_CLOSE, false); + } else { + if (mapActivity != null) { + dismiss(mapActivity, false); + } } } }); From b5ccc8bed84dcc12a0aa65f4e2d3b274422f10eb Mon Sep 17 00:00:00 2001 From: Skalii Date: Fri, 12 Feb 2021 18:31:26 +0200 Subject: [PATCH 13/46] fix display correct general information in track context menu after import gpx file --- OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index c7b1ebd63b..9ba7186f0d 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -2480,6 +2480,7 @@ public class GPXUtilities { firstSegment.routeSegments = routeSegments; firstSegment.routeTypes = routeTypes; } + gpxFile.addGeneralTrack(); } catch (Exception e) { gpxFile.error = e; log.error("Error reading gpx", e); //$NON-NLS-1$ From b1356cdea8b3779c29ca673e8de922fafdc544ad Mon Sep 17 00:00:00 2001 From: ivanPyrohivskyi Date: Fri, 12 Feb 2021 18:43:25 +0200 Subject: [PATCH 14/46] Precision implemented --- .../binary/BinaryMapPoiReaderAdapter.java | 27 +- .../java/net/osmand/binary/OsmandOdb.java | 253 +++++------------- .../main/java/net/osmand/util/MapUtils.java | 12 +- 3 files changed, 84 insertions(+), 208 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java index ee3fe4a6fa..9c0f30ebe2 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -714,9 +714,7 @@ public class BinaryMapPoiReaderAdapter { Amenity am = null; int x = 0; int y = 0; - int preciseX = 0; - int preciseY = 0; - boolean isPrecised = false; + int precisionXY = 0; boolean hasLocation = false; StringBuilder retValue = new StringBuilder(); PoiCategory amenityType = null; @@ -745,8 +743,11 @@ public class BinaryMapPoiReaderAdapter { } } if (hasLocation) { - if (isPrecised) { - am.setLocation(MapUtils.get31LatitudeY(preciseY), MapUtils.get31LongitudeX(preciseX)); + if (precisionXY != 0) { + int[] xy = MapUtils.calculateFinalXYFromBaseAndPrecisionXY(24, 26, precisionXY, x >> 7, y >> 7, true); + int x31 = xy[0] << 5; + int y31 = xy[1] << 5; + am.setLocation(MapUtils.get31LatitudeY(y31), MapUtils.get31LongitudeX(x31)); } else { am.setLocation(MapUtils.get31LatitudeY(y), MapUtils.get31LongitudeX(x)); } @@ -839,21 +840,9 @@ public class BinaryMapPoiReaderAdapter { case OsmandOdb.OsmAndPoiBoxDataAtom.NOTE_FIELD_NUMBER: am.setDescription(codedIS.readString()); break; - case OsmandOdb.OsmAndPoiBoxDataAtom.PRECISEDX_FIELD_NUMBER: + case OsmandOdb.OsmAndPoiBoxDataAtom.PRECISIONXY_FIELD_NUMBER: if (hasLocation) { - preciseX = codedIS.readSInt32() + x; - } - break; - case OsmandOdb.OsmAndPoiBoxDataAtom.PRECISEDY_FIELD_NUMBER: - if (hasLocation) { - preciseY = codedIS.readSInt32() + y; - if (checkBounds) { - if (left31 > preciseX || right31 < preciseX || top31 > preciseY || bottom31 < preciseY) { - codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); - return null; - } - } - isPrecised = true; + precisionXY = codedIS.readInt32(); } break; default: diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java index 6adce33378..f531dfbfde 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/OsmandOdb.java @@ -54372,41 +54372,23 @@ public final class OsmandOdb { com.google.protobuf.ByteString getTextValuesBytes(int index); - // optional sint32 preciseDx = 16; + // optional int32 precisionXY = 16; /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-     * diff between deltas of 28 and 24 zooms
+     * precision in 1-xy-xy-xy binary format
      * 
*/ - boolean hasPreciseDx(); + boolean hasPrecisionXY(); /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-     * diff between deltas of 28 and 24 zooms
+     * precision in 1-xy-xy-xy binary format
      * 
*/ - int getPreciseDx(); - - // optional sint32 preciseDy = 17; - /** - * optional sint32 preciseDy = 17; - * - *
-     * diff between deltas of 28 and 24 zooms
-     * 
- */ - boolean hasPreciseDy(); - /** - * optional sint32 preciseDy = 17; - * - *
-     * diff between deltas of 28 and 24 zooms
-     * 
- */ - int getPreciseDy(); + int getPrecisionXY(); } /** * Protobuf type {@code OsmAnd.OBF.OsmAndPoiBoxDataAtom} @@ -54577,12 +54559,7 @@ public final class OsmandOdb { } case 128: { bitField0_ |= 0x00000200; - preciseDx_ = input.readSInt32(); - break; - } - case 136: { - bitField0_ |= 0x00000400; - preciseDy_ = input.readSInt32(); + precisionXY_ = input.readInt32(); break; } } @@ -55094,52 +55071,28 @@ public final class OsmandOdb { return textValues_.getByteString(index); } - // optional sint32 preciseDx = 16; - public static final int PRECISEDX_FIELD_NUMBER = 16; - private int preciseDx_; + // optional int32 precisionXY = 16; + public static final int PRECISIONXY_FIELD_NUMBER = 16; + private int precisionXY_; /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-     * diff between deltas of 28 and 24 zooms
+     * precision in 1-xy-xy-xy binary format
      * 
*/ - public boolean hasPreciseDx() { + public boolean hasPrecisionXY() { return ((bitField0_ & 0x00000200) == 0x00000200); } /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-     * diff between deltas of 28 and 24 zooms
+     * precision in 1-xy-xy-xy binary format
      * 
*/ - public int getPreciseDx() { - return preciseDx_; - } - - // optional sint32 preciseDy = 17; - public static final int PRECISEDY_FIELD_NUMBER = 17; - private int preciseDy_; - /** - * optional sint32 preciseDy = 17; - * - *
-     * diff between deltas of 28 and 24 zooms
-     * 
- */ - public boolean hasPreciseDy() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - /** - * optional sint32 preciseDy = 17; - * - *
-     * diff between deltas of 28 and 24 zooms
-     * 
- */ - public int getPreciseDy() { - return preciseDy_; + public int getPrecisionXY() { + return precisionXY_; } private void initFields() { @@ -55156,8 +55109,7 @@ public final class OsmandOdb { note_ = ""; textCategories_ = java.util.Collections.emptyList(); textValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; - preciseDx_ = 0; - preciseDy_ = 0; + precisionXY_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -55219,10 +55171,7 @@ public final class OsmandOdb { output.writeBytes(15, textValues_.getByteString(i)); } if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeSInt32(16, preciseDx_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - output.writeSInt32(17, preciseDy_); + output.writeInt32(16, precisionXY_); } getUnknownFields().writeTo(output); } @@ -55307,11 +55256,7 @@ public final class OsmandOdb { } if (((bitField0_ & 0x00000200) == 0x00000200)) { size += com.google.protobuf.CodedOutputStream - .computeSInt32Size(16, preciseDx_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - size += com.google.protobuf.CodedOutputStream - .computeSInt32Size(17, preciseDy_); + .computeInt32Size(16, precisionXY_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -55455,10 +55400,8 @@ public final class OsmandOdb { bitField0_ = (bitField0_ & ~0x00000800); textValues_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00001000); - preciseDx_ = 0; + precisionXY_ = 0; bitField0_ = (bitField0_ & ~0x00002000); - preciseDy_ = 0; - bitField0_ = (bitField0_ & ~0x00004000); return this; } @@ -55547,11 +55490,7 @@ public final class OsmandOdb { if (((from_bitField0_ & 0x00002000) == 0x00002000)) { to_bitField0_ |= 0x00000200; } - result.preciseDx_ = preciseDx_; - if (((from_bitField0_ & 0x00004000) == 0x00004000)) { - to_bitField0_ |= 0x00000400; - } - result.preciseDy_ = preciseDy_; + result.precisionXY_ = precisionXY_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -55647,11 +55586,8 @@ public final class OsmandOdb { } onChanged(); } - if (other.hasPreciseDx()) { - setPreciseDx(other.getPreciseDx()); - } - if (other.hasPreciseDy()) { - setPreciseDy(other.getPreciseDy()); + if (other.hasPrecisionXY()) { + setPrecisionXY(other.getPrecisionXY()); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -56634,100 +56570,51 @@ public final class OsmandOdb { return this; } - // optional sint32 preciseDx = 16; - private int preciseDx_ ; + // optional int32 precisionXY = 16; + private int precisionXY_ ; /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-       * diff between deltas of 28 and 24 zooms
+       * precision in 1-xy-xy-xy binary format
        * 
*/ - public boolean hasPreciseDx() { + public boolean hasPrecisionXY() { return ((bitField0_ & 0x00002000) == 0x00002000); } /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-       * diff between deltas of 28 and 24 zooms
+       * precision in 1-xy-xy-xy binary format
        * 
*/ - public int getPreciseDx() { - return preciseDx_; + public int getPrecisionXY() { + return precisionXY_; } /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-       * diff between deltas of 28 and 24 zooms
+       * precision in 1-xy-xy-xy binary format
        * 
*/ - public Builder setPreciseDx(int value) { + public Builder setPrecisionXY(int value) { bitField0_ |= 0x00002000; - preciseDx_ = value; + precisionXY_ = value; onChanged(); return this; } /** - * optional sint32 preciseDx = 16; + * optional int32 precisionXY = 16; * *
-       * diff between deltas of 28 and 24 zooms
+       * precision in 1-xy-xy-xy binary format
        * 
*/ - public Builder clearPreciseDx() { + public Builder clearPrecisionXY() { bitField0_ = (bitField0_ & ~0x00002000); - preciseDx_ = 0; - onChanged(); - return this; - } - - // optional sint32 preciseDy = 17; - private int preciseDy_ ; - /** - * optional sint32 preciseDy = 17; - * - *
-       * diff between deltas of 28 and 24 zooms
-       * 
- */ - public boolean hasPreciseDy() { - return ((bitField0_ & 0x00004000) == 0x00004000); - } - /** - * optional sint32 preciseDy = 17; - * - *
-       * diff between deltas of 28 and 24 zooms
-       * 
- */ - public int getPreciseDy() { - return preciseDy_; - } - /** - * optional sint32 preciseDy = 17; - * - *
-       * diff between deltas of 28 and 24 zooms
-       * 
- */ - public Builder setPreciseDy(int value) { - bitField0_ |= 0x00004000; - preciseDy_ = value; - onChanged(); - return this; - } - /** - * optional sint32 preciseDy = 17; - * - *
-       * diff between deltas of 28 and 24 zooms
-       * 
- */ - public Builder clearPreciseDy() { - bitField0_ = (bitField0_ & ~0x00004000); - preciseDy_ = 0; + precisionXY_ = 0; onChanged(); return this; } @@ -65234,38 +65121,38 @@ public final class OsmandOdb { "tegories\030\003 \003(\r\022\025\n\rsubcategories\030\005 \003(\r\"i\n" + "\020OsmAndPoiBoxData\022\014\n\004zoom\030\001 \001(\r\022\t\n\001x\030\002 \001" + "(\r\022\t\n\001y\030\003 \001(\r\0221\n\007poiData\030\005 \003(\0132 .OsmAnd." + - "OBF.OsmAndPoiBoxDataAtom\"\226\002\n\024OsmAndPoiBo", + "OBF.OsmAndPoiBoxDataAtom\"\205\002\n\024OsmAndPoiBo", "xDataAtom\022\n\n\002dx\030\002 \002(\021\022\n\n\002dy\030\003 \002(\021\022\022\n\ncat" + "egories\030\004 \003(\r\022\025\n\rsubcategories\030\005 \003(\r\022\014\n\004" + "name\030\006 \001(\t\022\016\n\006nameEn\030\007 \001(\t\022\n\n\002id\030\010 \001(\004\022\024" + "\n\014openingHours\030\n \001(\t\022\014\n\004site\030\013 \001(\t\022\r\n\005ph" + "one\030\014 \001(\t\022\014\n\004note\030\r \001(\t\022\026\n\016textCategorie" + - "s\030\016 \003(\r\022\022\n\ntextValues\030\017 \003(\t\022\021\n\tpreciseDx" + - "\030\020 \001(\021\022\021\n\tpreciseDy\030\021 \001(\021\"\032\n\007IdTable\022\017\n\007" + - "routeId\030\001 \003(\022\"F\n\017RestrictionData\022\014\n\004type" + - "\030\001 \002(\005\022\014\n\004from\030\002 \002(\005\022\n\n\002to\030\003 \002(\005\022\013\n\003via\030" + - "\004 \001(\005\"x\n\tRouteData\022\016\n\006points\030\001 \002(\014\022\022\n\npo", - "intTypes\030\004 \001(\014\022\022\n\npointNames\030\005 \001(\014\022\r\n\005ty" + - "pes\030\007 \002(\014\022\017\n\007routeId\030\014 \002(\005\022\023\n\013stringName" + - "s\030\016 \001(\014\"\304\005\n\022OsmAndRoutingIndex\022\014\n\004name\030\001" + - " \002(\t\022?\n\005rules\030\002 \003(\01320.OsmAnd.OBF.OsmAndR" + - "outingIndex.RouteEncodingRule\022>\n\trootBox" + - "es\030\003 \003(\0132+.OsmAnd.OBF.OsmAndRoutingIndex" + - ".RouteDataBox\022A\n\014basemapBoxes\030\004 \003(\0132+.Os" + - "mAnd.OBF.OsmAndRoutingIndex.RouteDataBox" + - "\022=\n\006blocks\030\005 \003(\0132-.OsmAnd.OBF.OsmAndRout" + - "ingIndex.RouteDataBlock\032;\n\021RouteEncoding", - "Rule\022\013\n\003tag\030\003 \002(\t\022\r\n\005value\030\005 \002(\t\022\n\n\002id\030\007" + - " \001(\r\032\231\001\n\014RouteDataBox\022\014\n\004left\030\001 \002(\021\022\r\n\005r" + - "ight\030\002 \002(\021\022\013\n\003top\030\003 \002(\021\022\016\n\006bottom\030\004 \002(\021\022" + - "\023\n\013shiftToData\030\005 \001(\007\022:\n\005boxes\030\007 \003(\0132+.Os" + - "mAnd.OBF.OsmAndRoutingIndex.RouteDataBox" + - "\032\303\001\n\016RouteDataBlock\022$\n\007idTable\030\005 \001(\0132\023.O" + - "smAnd.OBF.IdTable\022*\n\013dataObjects\030\006 \003(\0132\025" + - ".OsmAnd.OBF.RouteData\0221\n\014restrictions\030\007 " + - "\003(\0132\033.OsmAnd.OBF.RestrictionData\022,\n\013stri" + - "ngTable\030\010 \001(\0132\027.OsmAnd.OBF.StringTableB\036", - "\n\021net.osmand.binaryB\tOsmandOdb" + "s\030\016 \003(\r\022\022\n\ntextValues\030\017 \003(\t\022\023\n\013precision" + + "XY\030\020 \001(\005\"\032\n\007IdTable\022\017\n\007routeId\030\001 \003(\022\"F\n\017" + + "RestrictionData\022\014\n\004type\030\001 \002(\005\022\014\n\004from\030\002 " + + "\002(\005\022\n\n\002to\030\003 \002(\005\022\013\n\003via\030\004 \001(\005\"x\n\tRouteDat" + + "a\022\016\n\006points\030\001 \002(\014\022\022\n\npointTypes\030\004 \001(\014\022\022\n", + "\npointNames\030\005 \001(\014\022\r\n\005types\030\007 \002(\014\022\017\n\007rout" + + "eId\030\014 \002(\005\022\023\n\013stringNames\030\016 \001(\014\"\304\005\n\022OsmAn" + + "dRoutingIndex\022\014\n\004name\030\001 \002(\t\022?\n\005rules\030\002 \003" + + "(\01320.OsmAnd.OBF.OsmAndRoutingIndex.Route" + + "EncodingRule\022>\n\trootBoxes\030\003 \003(\0132+.OsmAnd" + + ".OBF.OsmAndRoutingIndex.RouteDataBox\022A\n\014" + + "basemapBoxes\030\004 \003(\0132+.OsmAnd.OBF.OsmAndRo" + + "utingIndex.RouteDataBox\022=\n\006blocks\030\005 \003(\0132" + + "-.OsmAnd.OBF.OsmAndRoutingIndex.RouteDat" + + "aBlock\032;\n\021RouteEncodingRule\022\013\n\003tag\030\003 \002(\t", + "\022\r\n\005value\030\005 \002(\t\022\n\n\002id\030\007 \001(\r\032\231\001\n\014RouteDat" + + "aBox\022\014\n\004left\030\001 \002(\021\022\r\n\005right\030\002 \002(\021\022\013\n\003top" + + "\030\003 \002(\021\022\016\n\006bottom\030\004 \002(\021\022\023\n\013shiftToData\030\005 " + + "\001(\007\022:\n\005boxes\030\007 \003(\0132+.OsmAnd.OBF.OsmAndRo" + + "utingIndex.RouteDataBox\032\303\001\n\016RouteDataBlo" + + "ck\022$\n\007idTable\030\005 \001(\0132\023.OsmAnd.OBF.IdTable" + + "\022*\n\013dataObjects\030\006 \003(\0132\025.OsmAnd.OBF.Route" + + "Data\0221\n\014restrictions\030\007 \003(\0132\033.OsmAnd.OBF." + + "RestrictionData\022,\n\013stringTable\030\010 \001(\0132\027.O" + + "smAnd.OBF.StringTableB\036\n\021net.osmand.bina", + "ryB\tOsmandOdb" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -65523,7 +65410,7 @@ public final class OsmandOdb { internal_static_OsmAnd_OBF_OsmAndPoiBoxDataAtom_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_OsmAnd_OBF_OsmAndPoiBoxDataAtom_descriptor, - new java.lang.String[] { "Dx", "Dy", "Categories", "Subcategories", "Name", "NameEn", "Id", "OpeningHours", "Site", "Phone", "Note", "TextCategories", "TextValues", "PreciseDx", "PreciseDy", }); + new java.lang.String[] { "Dx", "Dy", "Categories", "Subcategories", "Name", "NameEn", "Id", "OpeningHours", "Site", "Phone", "Note", "TextCategories", "TextValues", "PrecisionXY", }); internal_static_OsmAnd_OBF_IdTable_descriptor = getDescriptor().getMessageTypes().get(36); internal_static_OsmAnd_OBF_IdTable_fieldAccessorTable = new diff --git a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java index a9c3411b68..97e921a3d4 100644 --- a/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/main/java/net/osmand/util/MapUtils.java @@ -48,12 +48,12 @@ public class MapUtils { 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_', '~' }; - - public static int calculateFromBaseZoomPrecisionXY(int bazeZoom, int finalZoom, int xBase, int yBase) { - int px = xBase; - int py = yBase; + + public static int calculateFromBaseZoomPrecisionXY(int baseZoom, int finalZoom, int xFinal, int yFinal) { + int px = xFinal; + int py = yFinal; int precisionNumber = 1; - for (int zoom = finalZoom - 1; zoom >= bazeZoom; zoom--) { + for (int zoom = finalZoom - 1; zoom >= baseZoom; zoom--) { int x = px / 2; // (int) MapUtils.getTileNumberX(zoom, lon); int y = py / 2; // (int) MapUtils.getTileNumberY(zoom, lat); int deltax = px - x * 2; @@ -67,7 +67,7 @@ public class MapUtils { px = x; py = y; } - System.out.println(String.format("Bits: %d %s (%d)", Integer.toBinaryString(precisionNumber).length(), Integer.toBinaryString(precisionNumber), precisionNumber)); + // System.out.println(String.format("Bits: %d %s (%d)", Integer.toBinaryString(precisionNumber).length(), Integer.toBinaryString(precisionNumber), precisionNumber)); return precisionNumber; } From 67649f3ffec9f2e0b8d721e1fc28f5fc54932885 Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Fri, 12 Feb 2021 17:39:02 +0000 Subject: [PATCH 15/46] Translated using Weblate (French) Currently translated at 100.0% (3674 of 3674 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 8bb98035c4..886da9a0be 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3290,7 +3290,7 @@ Profils ajoutés par le greffon Désactiver Nouveau greffon ajouté - Relier les segments + Joindre les segments Ajouter le profil \'%1$s\' \? Inclure la direction Inclure la direction de chaque point lors de l\'enregistrement d\'une trace. From 5f00b9601015a3b0e8dc08dd50924fca85267ace Mon Sep 17 00:00:00 2001 From: solokot Date: Fri, 12 Feb 2021 16:03:08 +0000 Subject: [PATCH 16/46] Translated using Weblate (Russian) Currently translated at 99.5% (3659 of 3674 strings) --- OsmAnd/res/values-ru/strings.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index ed0e98cd5f..dbe8dec63f 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3944,7 +3944,7 @@ Введите параметр Пешеход Самокат - Анализ по интервалам (по отдельности) + Анализ по интервалам Заблаговременно Заранее При прохождении @@ -4008,4 +4008,8 @@ Внедорожник Мотоцикл Автомобиль + Использовать test.openplacereviews.org + Вход в OpenPlaceReviews + Снегоход + Горный велосипед \ No newline at end of file From b8986d17ff3fc77e11682e247adc3619879a70d9 Mon Sep 17 00:00:00 2001 From: Softmap Date: Fri, 12 Feb 2021 22:04:57 +0000 Subject: [PATCH 17/46] Translated using Weblate (Arabic) Currently translated at 100.0% (3674 of 3674 strings) --- OsmAnd/res/values-ar/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 7f98d7ffb9..79f39ca4c8 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -2075,7 +2075,7 @@ اللون والسمك خذ المخرج %1$d ثم واصل المدينة أو المنطقة - مقالات ويكيبيديا القريبة + مقالات ويكيبيديا مجاورة استخدام الطرق السريعة السماح للطرق السريعة. الصربية (اللاتينية) @@ -3384,7 +3384,7 @@ اختر اللون لا يمكنك حذف أوضاع أوسماند الافتراضية ، ولكن يمكنك تعطيلها في الشاشة السابقة ، أو نقلها إلى الأسفل. تحرير الأوضاع - يؤثر نوع التنقل على قواعد حسابات المسار. + يؤثر نوع التنقل على كييفية حساب المسارات. مظهر الوضع اختر الايقونة واللون والاسم تحرير قائمة الأوضاع From 11d3187396edf44ee59e424aa1e1c78630ed406d Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Fri, 12 Feb 2021 16:17:37 +0000 Subject: [PATCH 18/46] Translated using Weblate (Arabic) Currently translated at 100.0% (3674 of 3674 strings) --- OsmAnd/res/values-ar/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index 79f39ca4c8..25ed7a94b9 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -4086,7 +4086,7 @@ \nجميع بيانات OpenPlaceReview مفتوحة ومتاحة للجميع: http://openplacereviews.org/data. \n \nيمكنك قراءة المزيد على: http://openplacereviews.org
- OpenPlaceReviews + موقع OpenPlaceReviews استخدام test.openplacereviews.org الدخول إلى OpenPlaceReviews ماء From 2d909e71455930893e23cf652a18310e8bfb4865 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 12 Feb 2021 23:48:42 +0000 Subject: [PATCH 19/46] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3674 of 3674 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index b1bdd574c8..f54e9bd076 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3674,7 +3674,7 @@ Proporciona la altura del vehículo, pueden aplicarse algunas restricciones de ruta para vehículos altos. Proporciona el peso del vehículo, pueden aplicarse algunas restricciones de ruta para vehículos pesados. Tiempo de espera de la pantalla - tonos + toneladas metros Muestra u oculta los detalles adicionales del mapa Mapa nocturno @@ -4022,4 +4022,17 @@ OpenPlaceReviews Usar test.openplacereviews.org Acceder a OpenPlaceReviews + Agua + Invierno + Motonieve + Equitación + Carreras + Bicicleta de montaña + Bicicleta + Senderismo + Correr + Peatón + Todo terreno + Motocicleta + Automóvil \ No newline at end of file From 7d474b661b1b49dc1dccb410e54092d4f9c6cd96 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 12 Feb 2021 22:31:07 +0000 Subject: [PATCH 20/46] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3891 of 3891 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index fea0e519d7..c42ad76035 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3222,7 +3222,7 @@ Bomba Perforación Camión de agua - Depósito de agua + Tanque de agua Botella de agua Comunidad Familia @@ -3869,7 +3869,7 @@ Río Pozo Bomba accionada - Depósito de agua + Tanque de agua Canilla Planta potabilizadora Pozo entubado @@ -3881,4 +3881,14 @@ Puente para murciélagos Cruce de vida silvestre Área de natación + Biblioteca móvil (parada) + Registro de la cumbre: no + Registro de la cumbre: sí + Estado de la pista: cerrado + Estado de la pista: abierto + Patrullado: no + Patrullado: sí + Arboleda: sí + Nombre de la pista + Salto con esquís \ No newline at end of file From cdd315c255e9d2d69e1a813ed27c75dc9a2e34cf Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 12 Feb 2021 23:47:56 +0000 Subject: [PATCH 21/46] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3674 of 3674 strings) --- OsmAnd/res/values-es-rUS/strings.xml | 162 ++++++++++++++++++--------- 1 file changed, 111 insertions(+), 51 deletions(-) diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index 13de05dc23..b0bcc4a13f 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -772,25 +772,25 @@ \n Los PDI de OsmAnd están siendo desarrollados activamente. Nuestro proyecto y su continuo progreso, se basa en contribuciones económicas para desarrollar y probar nuevas funcionalidades. Por favor, considera comprar OsmAnd+, financiar nuevas funciones o hacer una donación general en https://osmand.net.
Navegación y Mapas OsmAnd+ Visor y navegador móvil global de mapas OSM con y sin conexión - OsmAnd+ (OSM Automated Navigation Directions, y en español, Guía de Navegación Automatizada de OSM) -\n -\nOsmAnd+ es un software de navegación de código abierto con acceso a una amplia variedad de datos globales de OSM. Todos los datos del mapa (vectores y teselas), pueden ser almacenados en la memoria del teléfono para su uso sin conexión. Ofrece funcionalidades de rutas con y sin conexión, incluyendo guía de giro-a-giro por voz. -\n -\n OsmAnd+ es la versión de pago de la aplicación, comprándola ayudas al proyecto, financias el desarrollo de nuevas funciones, y recibes las últimas actualizaciones. -\n -\n Algunas de las funciones fundamentales: -\n - Completa funcionalidad sin conexión (guarda los mapas vectoriales o teselas descargados en el almacenamiento del dispositivo) -\n - Mapas mundiales vectoriales compactos disponibles -\n - Descarga ilimitada de mapas de países o regiones directamente desde la aplicación -\n - Posibilidad de superponer varias capas de mapa, como GPX o rutas de navegación, Puntos de Interés, Favoritos, curvas de nivel, paradas de transporte público, mapas adicionales con transparencia personalizable -\n -\n - Búsqueda sin conexión de direcciones y sitios (PDI) -\n - Rutas sin conexión para distancias de rango medio -\n - Modos de automóvil, bicicleta y peatón con opcional: -\n - Cambio automático de modo diurno/nocturno -\n - Zoom del mapa según la velocidad -\n - Alineación del mapa, según brújula o dirección del movimiento -\n - Indicación de carriles, mostrar límites de velocidad, voces grabadas y sintetizadas + OsmAnd+ (OSM Automated Navigation Directions, y en español, Guía de Navegación Automatizada de OSM) +\n +\n OsmAnd+ es un software de navegación de código abierto con acceso a una amplia variedad de datos globales de OSM. Todos los datos del mapa (vectores y teselas), pueden ser almacenados en la memoria del teléfono para su uso sin conexión. Ofrece funcionalidades de rutas con y sin conexión, incluyendo guía de giro-a-giro por voz. +\n +\n OsmAnd+ es la versión de pago de la aplicación, comprándola ayudas al proyecto, financias el desarrollo de nuevas funciones, y recibes las últimas actualizaciones. +\n +\n Algunas de las funciones fundamentales: +\n - Completa funcionalidad sin conexión (guarda los mapas vectoriales o teselas descargados en el almacenamiento del dispositivo) +\n - Mapas mundiales vectoriales compactos disponibles +\n - Descarga ilimitada de mapas de países o regiones directamente desde la aplicación +\n - Posibilidad de superponer varias capas de mapa, como GPX o rutas de navegación, Puntos de Interés, Favoritos, curvas de nivel, paradas de transporte público, mapas adicionales con transparencia personalizable +\n +\n - Búsqueda sin conexión de direcciones y sitios (PDI) +\n - Rutas sin conexión para distancias de rango medio +\n - Modos de automóvil, bicicleta y peatón con opcional: +\n - Cambio automático de modo diurno/nocturno +\n - Zoom del mapa según la velocidad +\n - Alineación del mapa, según brújula o dirección del movimiento +\n - Indicación de carriles, mostrar límites de velocidad, voces grabadas y sintetizadas \n Crear filtro PDI Modo transporte: @@ -1222,8 +1222,7 @@ Todos los datos sin conexión en la versión vieja de OsmAnd son compatibles con la nueva versión, pero los puntos de Favoritos deben exportarse desde la versión vieja y luego, importarse en la nueva. Compilación {0} instalada ({1}). Descargando compilación… - ¿Instalar OsmAnd? -\nVersión: {0} + ¿Instalar OsmAnd {0}\? \nFecha: {1} \nTamaño: {2} MB Error al recuperar la lista de compilaciones de OsmAnd @@ -2063,7 +2062,7 @@ Notificaciones Sin archivos de trazas aún También puedes añadir archivos de trazas a la carpeta - Añadir GPX + Añadir más… Aspecto Muy fino Cálculo de la ruta @@ -2438,7 +2437,7 @@ Promedio %1$d de %2$d Ascenso/Descenso - Tiempo moviéndose + Tiempo en movimiento Máx/Min Min/Máx Rosa translúcido @@ -3650,7 +3649,7 @@ Usar el tiempo de espera de la pantalla del sistema Formato de almacenamiento Archivo SQLiteDB - tonos + toneladas Mapa nocturno metros ¿Borrar todo\? @@ -3728,8 +3727,8 @@ Ruta entre puntos Planificar ruta Nota de OSM cerrada - Marca la opción de división deseada: por tiempo o por distancia. - Marca el intervalo en el que se mostrarán las marcas con distancia o tiempo en la traza. + Elige la opción de división deseada: por tiempo o por distancia. + Elige el intervalo de la traza en el que se mostrarán las marcas con la distancia o el tiempo. Flechas de dirección Silla de ruedas (hacia adelante) Silla de ruedas @@ -3947,32 +3946,93 @@ Perfil de usuario Perfil de OsmAnd Elige el perfil que será usado al iniciar la aplicación. - Tiempo de indicaciones por voz + Tiempo de los avisos por voz Elegir carpeta Carpetas Cambiar carpeta - - - - - - - - - - - - - - - - - - - - - - - - + Añadir motor de navegación en línea + Editar motor de navegación en línea + Subtipo + Vehículo + Clave de la API + URL del servidor + Ingresa parámetro + Si no, mantenerlo vacío + La URL con todos los parámetros se verá así: + Cálculo de la ruta de prueba + Automóvil + Peatón + Bicicleta + Automóvil + + Copiar dirección + Motor de navegación en línea + Motores de navegación en línea + Elegir carpeta o añadir una nueva + Vacío + Analizar intervalos divididos + Subir a OpenStreetMap + Editar traza + Renombrar traza + Subiendo %1$d de %2$d + Se subieron %1$d de %2$d + Subida completa + Subiendo + Marcar ediciones a subir + Iniciar grabación + Mostrar traza en el mapa + Girar + seg + Silla de ruedas + Peatón + Camión + Camión pequeño + Motoneta + Bicicleta de carreras + Bicicleta de montaña + Senderismo + Vehículos pesados + Ciclismo de ruta + Ciclismo regular + Ciclismo de montaña + Ciclismo eléctrico + Usar test.openplacereviews.org + OpenPlaceReviews es un proyecto impulsado por la comunidad sobre lugares públicos como restaurantes, hoteles, museos, puntos de referencia. Recoge toda la información pública sobre ellos como fotos, reseñas, enlaces a otros servicios como OpenStreetMap y Wikipedia. +\n +\nTodos los datos de OpenPlaceReviews son abiertos y están disponibles para todos: http://openplacereviews.org/data. +\n +\nPuedes leer más en: https://openplacereviews.org + OpenPlaceReviews + Error de servidor: %1$s + El nombre ya existe + Acceder a OpenPlaceReviews + Sombreado / Pendiente / Curvas de nivel + Borrar puntos de referencia + ¿Borrar este motor de navegación en línea\? + Copiar a «Marcadores del mapa» + Copiar a favoritos + Leer completo + Editar descripción + Tiempo de anuncio + Preparación larga + Preparar + Pasando + Fuera de la ruta + Intervalos de tiempo y distancia + El tiempo de anuncio de las diferentes indicaciones por voz depende del tipo de mensaje, la velocidad de navegación actual y la velocidad de navegación predefinida. + Has llegado al destino + Acercarse + Invierno + Agua + Peatón + Motonieve + Correr + Equitación + Carreras + Todo terreno + Bicicleta de montaña + Motocicleta + Senderismo + Bicicleta + Automóvil \ No newline at end of file From 6480609b693a1dcf0e724e45d040785ff3416ec3 Mon Sep 17 00:00:00 2001 From: Franco Date: Fri, 12 Feb 2021 22:28:59 +0000 Subject: [PATCH 22/46] Translated using Weblate (Spanish (American)) Currently translated at 100.0% (3891 of 3891 strings) --- OsmAnd/res/values-es-rUS/phrases.xml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index aac3ae7a7f..7241c7f79b 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -844,7 +844,7 @@ Nodo de red nacional de senderismo Nodo de red regional de senderismo Nodo de red local de senderismo - Horario de atención;Horario de apertura + Horario de apertura Horario de recolección Descripción Teléfono @@ -2723,7 +2723,7 @@ Acuicultura: mejillones Edad mínima - No + Productos orgánicos: no Únicamente Espejo de tráfico Consulado @@ -3868,7 +3868,7 @@ Lavadero público de ropa Estación de transferencia de residuos Báscula puente - Estación de guardabosque + Estación de guardabosques Lago Río Pozo @@ -3881,4 +3881,14 @@ Puente para murciélagos Cruce de vida silvestre Área de natación + Registro de la cumbre: sí + Registro de la cumbre: no + Estado de la pista: abierto + Estado de la pista: cerrado + Salto con esquís + Nombre de la pista + Patrullado: sí + Patrullado: no + Biblioteca móvil (parada) + Arboleda: sí \ No newline at end of file From df4bc11fc6ef54be9df5b325ebf8d5ffcdcd4356 Mon Sep 17 00:00:00 2001 From: Ahmad Alfrhood Date: Fri, 12 Feb 2021 19:01:06 +0000 Subject: [PATCH 23/46] Translated using Weblate (Arabic) Currently translated at 92.9% (3618 of 3891 strings) --- OsmAnd/res/values-ar/phrases.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-ar/phrases.xml b/OsmAnd/res/values-ar/phrases.xml index 262c6b1844..88a19d0e1e 100644 --- a/OsmAnd/res/values-ar/phrases.xml +++ b/OsmAnd/res/values-ar/phrases.xml @@ -3075,7 +3075,7 @@ السماح بدخول السيارات: للعبور للوجهة السماح بدخول السيارات: لا السماح بدخول السيارات:خاص - السماح بدخول السيارات: + السماح بدخول السيارات:نعم السماح بدخول المركبات: الخاصة بالغابات السماح بدخول المركبات: لتسليم الطلبات السماح بدخول المركبات: العسكرية @@ -3586,7 +3586,7 @@ الوصول إلى الإنترنت: خدمة الوصول إلى الإنترنت: عام ولوج الإنترنت: سلكي - "ولوج الإنترنت: terminal" + ولوج الإنترنت: terminal ولوج الإنترنت: wlan ماهايانا ماروني @@ -3679,4 +3679,14 @@ جسر خفافيش معبر الحيوانات البرية شريط التمرير + مصنع شراب + هانامي + ضريح على جانب الطريق + صليب جانبي + ديرصومعة + الديانة + كنيسة المصلحة الهولندية + الكنيسة الميثودية + الخمسينية + المشيخية \ No newline at end of file From 66a2472c76b3752bb9fa087f8518b4d65f3a5adb Mon Sep 17 00:00:00 2001 From: Liu Tao Date: Fri, 12 Feb 2021 18:36:27 +0000 Subject: [PATCH 24/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 78.7% (2894 of 3674 strings) --- OsmAnd/res/values-zh-rCN/strings.xml | 92 ++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 20 deletions(-) diff --git a/OsmAnd/res/values-zh-rCN/strings.xml b/OsmAnd/res/values-zh-rCN/strings.xml index 3250958bbb..a0432e5cd4 100644 --- a/OsmAnd/res/values-zh-rCN/strings.xml +++ b/OsmAnd/res/values-zh-rCN/strings.xml @@ -21,7 +21,7 @@ 目的地 途径目的地 停車 - + 紧急救助 公共交通 娛樂 住宿 @@ -62,7 +62,7 @@ 显示目标方向 启用跟踪插件使用日志位置服务(GPX记录,网上查询) 请在设置中启用GPS - 显示车道 + 车道 无未铺设道路 避开轮渡 避让… @@ -94,7 +94,7 @@ 可追踪 私人 坐标 - 我的最爱搜索 + 搜索收藏的方法 出发点尚未确定。 位置尚不清楚。 插件 @@ -182,7 +182,7 @@ 市郊 村庄 - + 乡镇 城市 升级OsmAnd+ 重命名 @@ -214,14 +214,14 @@ 行政 屏障 教育 - + 紧急救助 娱乐 金融 藏宝 医疗保健 历史性 土地利用 - 闲暇 + 休闲娱乐 人造 军事 自然 @@ -254,8 +254,8 @@ 由于Yandex的交通信息。 Yandex的流量 路线 - 我的最爱 - OSM注记(在线) + 收藏 + OSM 注记(在线) 网络 分钟 @@ -270,8 +270,8 @@ 后来 下载区域 正在搜索信号… - 肖像 - 景观 + 竖屏 + 横屏 屏幕方向 路线 停止 @@ -312,7 +312,7 @@ 搜索 浏览地图 驾驶 - 自行车出行 + 自行车 走路 中心 底部 @@ -626,7 +626,7 @@ POI索引中… 交通设施索引中… 已废弃的地图数据格式 \'\'{0}\'\' 不再支持 - 最近的POI + 最近的兴趣点 自定义过滤器 正在读取缓存瓦片… 索引 \'\'{0}\'\' 太大而无法载入内存 @@ -1115,7 +1115,7 @@ 添加第一个途径地 错误 地图字体 - 右侧通行 + 右侧行驶 自动 不发送匿名应用使用情况统计信息 恢复购买内容 @@ -1451,7 +1451,7 @@ 返回到搜索 从“历史”中删除所选项目? 在地图上显示 %1$s - 搜索 %1$s 离开 + 搜索 %1$s 开外 通过 OsmAnd 分享 邮政编码 @@ -1669,7 +1669,7 @@ 有轨电车线路 分享出租车线路 无轨电车线路 - 运输 + 公共交通 剩余的元素 之间 选择限速容许幅度,超过限速容许幅度将收到语音警告。 @@ -1883,7 +1883,7 @@ 徒步 摩托车 小船 - 航空器 + 飞机 你确定你要删除 %1$d 个 OSM 更改? 请先计算路径 使用计算的路线进行模拟 @@ -2941,8 +2941,8 @@ %1$s 已删除 卸载并重新启动 删除下一个目的地 - 启用以使用设备音量按钮控制地图缩放级别。 - 音量按钮用于缩放 + 启用以使用设备音量键控制地图缩放级别。 + 音量键用于缩放 请提供该点的名称 轮椅 您需要设置工作日以继续 @@ -2976,7 +2976,7 @@ 细砂砾 表面坚固度 仅在夜晚显示 - OSM编辑 + OSM 编辑 在地图上显示或隐藏公共交通的按钮。 公共交通类型 在地图上显示低排放区。不影响路线规划。 @@ -3108,7 +3108,7 @@ 连接 远足 雪橇 - 分析 + 数据分析 示例 @@ -3419,4 +3419,56 @@ 赛车 山地车 越野 + 按下设备电源键,就会在锁屏上方用OsmAnd打开屏幕。 + 电源键 + 接近传感器 + 屏幕控制 + 沿途显示 + 轨迹 + 这些插件设置是全局的,并应用于所有配置文件 + 登录、密码、离线编辑 + 从其他配置文件复制 + 隐私和安全 + 对整个应用生效 + 运动 + 紧急救助 + 重新排列类别 + 选择之后重新计算路径的距离。 + 如果从路线到当前位置的距离超过了所选的值,路线将被重新计算。 + 选择组 + 自定义 \"抽屉\"、\"配置地图\"、\"上下文菜单 \"中的项目数量。 +\n +\n关闭未使用的插件,隐藏其所有控件。%1$s. + 抽屉项目,上下文菜单 + UI 自定义 + 选择地图上维基百科文章的语言,在阅读文章时切换到任何可用的语言。 + %1$s / %2$s + 合并不同类别的兴趣点类型。点击开关全选,点击左侧选择类别。 + 额外地图 + 不支持的操作 %1$s + OsmAnd 跟踪器 + OsmAnd + Mapillary + 快捷操作 + 测量距离 + 旅行(维基导游和维基百科) + 地图标记 + OsmAnd 购买 + 地图符号系统指南。 + 导航配置文件 + 停车位置 + 添加或编辑收藏 + 还原默认项目顺序 + 返回编辑 + 添加配置文件 + 更改应用配置文件 + 找不到任何此类配置文件。 + 世界概览地图(详细) + 不支持的类型 + 提供你的车辆宽度,较宽的车辆可能会受到一些路线限制。 + 提供你的车辆高度,较高的车辆可能会受到一些路线限制。 + 提供你的车辆重量,较重的车辆可能会受到一些路线限制。 + 提供你的车辆长度,较长的车辆可能会受到一些路线限制。 + OsmAnd GPX 格式不正确,请联系支持团队进一步调查。 + 只有路线线会被保存,航点会被删除。 + 文件名 \ No newline at end of file From 5ab7987b8783e01ce19c692ab09ab3b5dbd811f2 Mon Sep 17 00:00:00 2001 From: Liu Tao Date: Fri, 12 Feb 2021 16:46:35 +0000 Subject: [PATCH 25/46] Translated using Weblate (Chinese (Simplified)) Currently translated at 19.5% (762 of 3891 strings) --- OsmAnd/res/values-zh-rCN/phrases.xml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-zh-rCN/phrases.xml b/OsmAnd/res/values-zh-rCN/phrases.xml index 3af1a76522..07cbf034cb 100644 --- a/OsmAnd/res/values-zh-rCN/phrases.xml +++ b/OsmAnd/res/values-zh-rCN/phrases.xml @@ -68,7 +68,7 @@ 类型 户外座位 吸烟 - 外带 + 外卖 鸡尾酒 洗衣机 服务 @@ -87,7 +87,7 @@ 类型 类型 商店 - + 紧急救助 人造 土地利用 行政 @@ -97,7 +97,7 @@ 旅游 遊覽 住宿 - 闲暇 + 休闲娱乐 金融 自然 军事 @@ -360,7 +360,7 @@ 家具 - + 乡镇 村庄 市郊 @@ -500,7 +500,7 @@ - 外带 + 外卖 @@ -766,4 +766,7 @@ 脚手架 沉船 + 充电站 + 无外卖 + 仅限外卖 \ No newline at end of file From 03d379b0551fb7feecae0258cde3a2f262e2ea09 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sun, 14 Feb 2021 00:56:35 +0200 Subject: [PATCH 26/46] Small fix for final mapActivity --- .../MeasurementToolFragment.java | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index 5361ebf7cb..bf6ee212dc 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -231,7 +231,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - final MapActivity mapActivity = (MapActivity) getActivity(); + MapActivity mapActivity = (MapActivity) getActivity(); if (mapActivity == null) { return null; } @@ -375,13 +375,16 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route mainView.findViewById(R.id.options_button).setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { - boolean trackSnappedToRoad = !editingCtx.isApproximationNeeded(); - boolean addNewSegmentAllowed = editingCtx.isAddNewSegmentAllowed(); - OptionsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(), - MeasurementToolFragment.this, - trackSnappedToRoad, addNewSegmentAllowed, - editingCtx.getAppMode().getStringKey() - ); + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + boolean trackSnappedToRoad = !editingCtx.isApproximationNeeded(); + boolean addNewSegmentAllowed = editingCtx.isAddNewSegmentAllowed(); + OptionsBottomSheetDialogFragment.showInstance(mapActivity.getSupportFragmentManager(), + MeasurementToolFragment.this, + trackSnappedToRoad, addNewSegmentAllowed, + editingCtx.getAppMode().getStringKey() + ); + } } }); @@ -431,7 +434,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route @Override public void onSelectPoint(int selectedPointPos) { - if (selectedPointPos != -1) { + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null && selectedPointPos != -1) { openSelectedPointMenu(mapActivity); } } @@ -440,7 +444,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route measurementLayer.setOnMeasureDistanceToCenterListener(new MeasurementToolLayer.OnMeasureDistanceToCenter() { @Override public void onMeasure(float distance, float bearing) { - String distStr = OsmAndFormatter.getFormattedDistance(distance, mapActivity.getMyApplication()); + String distStr = OsmAndFormatter.getFormattedDistance(distance, app); String azimuthStr = OsmAndFormatter.getFormattedAzimuth(bearing, app); distanceToCenterTv.setText(String.format("%1$s • %2$s", distStr, azimuthStr)); TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration( @@ -499,6 +503,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route } else if (editingCtx.isNewData() || editingCtx.hasChanges()) { saveChanges(FinalSaveAction.SHOW_SNACK_BAR_AND_CLOSE, false); } else { + MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { dismiss(mapActivity, false); } @@ -539,9 +544,12 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route configBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - RouteOptionsBottomSheet.showInstance( - mapActivity, MeasurementToolFragment.this, DialogMode.PLAN_ROUTE, - editingCtx.getAppMode().getStringKey()); + MapActivity mapActivity = getMapActivity(); + if (mapActivity != null) { + RouteOptionsBottomSheet.showInstance( + mapActivity, MeasurementToolFragment.this, DialogMode.PLAN_ROUTE, + editingCtx.getAppMode().getStringKey()); + } } }); @@ -935,7 +943,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route app.getTargetPointsHelper().updateRouteAndRefresh(true); app.getRoutingHelper().onSettingsChanged(true); } else { - mapActivity.getMapActions().stopNavigationActionConfirm(null , new Runnable() { + mapActivity.getMapActions().stopNavigationActionConfirm(null, new Runnable() { @Override public void run() { MapActivity mapActivity = getMapActivity(); @@ -1149,7 +1157,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route @Override public void onChangeApplicationMode(ApplicationMode mode, RouteBetweenPointsDialogType dialogType, - RouteBetweenPointsDialogMode dialogMode) { + RouteBetweenPointsDialogMode dialogMode) { MeasurementToolLayer measurementLayer = getMeasurementLayer(); if (measurementLayer != null) { ChangeRouteType changeRouteType = ChangeRouteType.NEXT_SEGMENT; @@ -1951,7 +1959,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route } public static boolean showInstance(FragmentManager fragmentManager, MeasurementEditingContext editingCtx, - boolean followTrackMode) { + boolean followTrackMode) { MeasurementToolFragment fragment = new MeasurementToolFragment(); fragment.setEditingCtx(editingCtx); fragment.setMode(FOLLOW_TRACK_MODE, followTrackMode); From 00438f913637f3cfefe1c6283db50a6f89ba7df0 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 13 Feb 2021 15:51:38 +0000 Subject: [PATCH 27/46] Translated using Weblate (German) Currently translated at 100.0% (3674 of 3674 strings) --- OsmAnd/res/values-de/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 7256b74618..3a02dbb58c 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -4034,7 +4034,8 @@ Geländegängig Motorrad Auto - Vorbereiten + Zweite Ankündigung (mittlere Distanz) sek Rennsport + Erste Ankündigung (größere Distanz) \ No newline at end of file From 0f6a07b4744e6aa64f502a789f1385f93ddb10e8 Mon Sep 17 00:00:00 2001 From: Artem Date: Sat, 13 Feb 2021 12:31:10 +0000 Subject: [PATCH 28/46] Translated using Weblate (Russian) Currently translated at 99.7% (3665 of 3674 strings) --- OsmAnd/res/values-ru/strings.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index dbe8dec63f..1b051f904b 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -4012,4 +4012,10 @@ Вход в OpenPlaceReviews Снегоход Горный велосипед + Вождение + Пешком + OpenPlaceReviews + Вода + Зима + Верховая езда \ No newline at end of file From 93da3447bfbcdd7741d02d9726ea137369656aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D0=BE=D1=80=D0=B3=D1=96=D0=B9=20=D0=A6=D1=96?= =?UTF-8?q?=D1=82=D0=BE=D1=9E?= Date: Sat, 13 Feb 2021 14:37:20 +0000 Subject: [PATCH 29/46] Translated using Weblate (Belarusian) Currently translated at 100.0% (3674 of 3674 strings) --- OsmAnd/res/values-be/strings.xml | 227 ++++++++++++++++++++++++++++--- 1 file changed, 207 insertions(+), 20 deletions(-) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 1a01c2fcf0..cb263d869a 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -88,7 +88,7 @@ засталося %1$d файлаў Засталося %1$d файлаў для спампоўвання Поўная версія - Скасаваць маршрут + Скасаваць маршрут\? Спыніць навігацыю Выдаліць месца прызначэння Wi-Fi не падлучаны. Выкарыстаць дзейнае падлучэнне да Інтэрнэту для спампоўвання? @@ -515,7 +515,7 @@ Флюарэсцэнтныя пласты Ужываць флюарэсцэнтныя колеры для слядоў і шляхоў. Пазасеціўнае рэдагаванне - Заўсёды выкарыстоўваць аўтаномнае рэдагаванне. + Калі выкарыстоўваецца рэдагаванне на прыладзе, то змены будуць захаваныя лакальна і загружаныя на сервер толькі па запыце, інакш яны будуць загружацца неадкладна. Змены цікавых пунктаў (POI) у праграме не паўплываюць на cпампаваныя файлы мапаў, змены захоўваюцца як файлы на вашай прыладзе. Запампоўка… {0} POI/нататкі запампаваныя @@ -1574,7 +1574,7 @@ Абмежаванне па вышыні Пазначыць вышыню транспартнага сродку для разліку маршруту. Разумны пераразлік маршруту - Пераразлічваць толькі пачатак маршруту. Падыходзіць для доўгіх паездак. + Пераразлічваць толькі пачатак маршруту. Карысна для доўгіх паездак. Выйсці Выключана Афарбоўка па пешаходнаму сімвалу OSMC @@ -1985,7 +1985,7 @@ Адносны азімут Магнітны азімут Навігацыя OsmAnd Live - Пункт прызначэння не зададзены + Убудова спецыяльных магчымасцей: Пункт прызначэння не зададзены Сачыце за намі Гукавая напрамкі Індыцыраваць гукам кірунак на мэтавы пункт. @@ -2483,7 +2483,7 @@ Сярэдняя %1$d з %2$d Пад\'ём/Cпуск - Час руху + Час у руху Макс/Мін Мін/Макс Паўпразрысты ружовы @@ -2671,7 +2671,7 @@ Дадае першы прыпынак Перамясціць прызначэнне далей і стварыць яго Паказаць закрытыя нататкі - Паказаць/схаваць OSM-нататкі на мапе. + Паказаць або схаваць OSM-нататкі на мапе. GPX падыходзіць для экспарту ў JOSM і іншыя OSM-рэдактары. OSC падыходзіць для экспарту ў OpenStreetMap. GPX-файл @@ -3159,9 +3159,9 @@ Навігацыя OsmAnd Іншая навігацыя Дадаць прынамсі адзін элемент у спіс \"Хуткае дзеянне\" у наладах - Альпійская/горныя лыжы + Альпійскія і горныя лыжы Схілы для горных лыжаў і доступ да пад\'ёмнікаў. - Лыжныя гонкі / паўночныя тыпы + Бегавыя і скандынаўскія лыжы Трасы для лыжных гонак і іх паўночных тыпаў. Дазволіць прамежкавыя маршруты Больш складаныя трасы са стромкімі ўчасткамі. Пэўныя перашкоды, якіх варта пазбягаць. @@ -3429,9 +3429,9 @@ Пакупкі OsmAnd Даведка па знаках мапы. Профілі навігацыі - Стварыць/Рэдагаваць POI + Стварыць ці Рэдагаваць POI Месца паркоўкі - Дадаць / рэдагаваць улюбёнае + Дадаць ці рэдагаваць улюбёнае Аднавіць прадвызначаны парадак элементаў Вярнуцца да рэдагавання Паказаць грамадскі транспарт @@ -3439,7 +3439,7 @@ Дадаць профіль %1$s з %2$s Схілы - Паказаць/схаваць рэльеф + Паказаць ці схаваць рэльеф Схаваць рэльеф Паказаць рэльеф Выдаліць апісанне @@ -3517,7 +3517,7 @@ Змяніць профіль праграмы Аглядная мапа свету (падрабязная) Схаваць грамадскі транспарт - Паказаць/схаваць грамадскі транспарт + Паказаць ці схаваць грамадскі транспарт Пералічыць маршрут у выпадку адхілення Выдаліць Вызначце шырыню судна, каб пазбягаць вузкіх мастоў @@ -3531,7 +3531,7 @@ Выдалена: %1$s Перазапусціце праграму для поўнага выдалення даных камер кантролю хуткасці. Кіраванне ўзроўнем маштабавання мапы пры дапамозе кнопак рэгулявання гучнасці. - Інфармацыя пра славутасці з Вікіпедыі. Гэта ваш кішэнны даведнік - уключыце ўбудову вікіпедыі і чытайце артыкулы пра аб’екты вакол вас. + Інфармацыя пра славутасці з Вікіпедыі, вашага кішэннага даведніка з артыкуламі пра аб’екты вакол вас. Матацыкл Эндура Мотаролер Выдаліць і перазапусціць @@ -3549,8 +3549,8 @@ Адкрыць захаваны след захавана Аўтаматычна запісваць след падчас навігацыі - Запіс GPX прыпыніцца, калі праграма будзе забітая (праз надаўнія праграмы). (Апавяшчэнне ў вобласці падказак Android пра фонавы рэжым OsmAnd знікне.) - Вызначце інтэрвал запісу следу (уключаецца праз віджэт запісу GPX на мапе). + Спыненне запісу GPX, падчас прымусовага спынення (праз апошнія прыкладанні). (Апавяшчэнне ў вобласці падказак Android пра фонавы рэжым OsmAnd знікне.) + Вызначце інтэрвал запісу трэка (уключаецца праз віджэт \"Запіс паездкі\" на мапе). ЗАПІС Завершана Захаваць як новы файл следу @@ -3655,7 +3655,7 @@ Папярэдні сегмент Усе папярэднія сегменты Толькі абраны сегмент пералічыцца з выкарыстаннем абранага профілю. - Прагляд вашых правак альбо хібаў OSM, яшчэ не адпраўленых у %1$s. Запампаваныя пункты больш не будуць паказвацца. + Прагледзець усе вашы яшчэ не загружаныя паўкі OSM або памылкі ў %1$s. Ужо загружаныя змены больш не будуць паказвацца. Пазначце сеціўны адрас з наступнымі параметрамі: lat={0}, lon={1}, timestamp={2}, hdop={3}, altitude={4}, speed={5}, bearing={6}. Рэкамендацыя: наладка ў 5 метраў можа вас задаволіць, калі вам не патрэбна фіксаваць больш кароткія перамяшчэнні, і вы не хочаце відавочна збіраць даныя ў стане спакою. Пабочныя эфекты: перыяды ў стане спакою не запісваюцца наогул альбо па адным пункце кожны. Невялікія (у рэальным свеце) перамяшчэнні (напрыклад, убок, што адзначаюць магчымы паварот у вашай паездцы) могуць быць адфільтраваныя. Файл змяшчае менш інфармацыі для наступнай апрацоўкі і мае горшую статыстыку, адфільтроўваючы відавочна лішнія пункты падчас запісу. Пры гэтым патэнцыйна захоўваюцца артэфакты, выкліканыя дрэнным прыёмам альбо эфектамі модуля GPS. @@ -3861,7 +3861,7 @@ Вярнуць • Абноўлена функцыя планавання маршруту. З’явілася магчымасць выкарыстоўваць розныя тыпы навігацыі для кожнага сегмента і прымацоўваць сляды \n -\n • Новае меню \"Выгляд\" для слядоў. Можна абраць колер, таўшчыню, уключыць стрэлкі кірунку, адзнакі старту / фінішу +\n • Новае меню \"Выгляд\" для слядоў. Можна абраць колер, таўшчыню, уключыць стрэлкі кірунку, адзнакі старту і фінішу \n \n • Палепшана бачнасць роварных вузлоў. \n @@ -3892,12 +3892,199 @@ Натыўны грамадскі транспарт (у распрацоўцы) Увайсці праз OAuth Выкарыстоўваць 2-фазны алгарытм маршрутызацыі A * - Перайсці на разлік маршруту грамадскага транспарту на Java (бяспечны) + Перайсці на разлік маршруту грамадскага транспарту з дапамогай Java (бяспечны) Файл ужо імпартаваны ў OsmAnd Значкі старту і фінішу - Увайдзіце праз OAuth, каб выкарыстоўваць функцыі osmedit + Выканайце ўваход з дапамогай OAuth, каб выкарыстоўваць функцыі osmedit Ачысціць токен OpenStreetMap OAuth - Выхад выкананы + Вы выйшлі Даныя OsmAnd Live Даныя OsmAnd Live + Час галасавых падказак + Нямецкая (неафіцыйная) + MGRS + Для язды на снегаходах па вызначаных дарогах і трасах. + MGRS + OsmAnd выкарыстоўвае MGRS, які падобны да фармату UTM NATO. + Графік + Даныя %1$s даступныя толькі для дарог, разлічылі маршрут, выкарыстоўваючы \"Маршрут паміж кропкамі\", каб убачыць графікі. + Калі ласка пачакайце. +\nГрафік будзе даступны пасля пераразліку маршруту. + Лакальныя мапы + %1$s — %2$s + Разрыў + Выгады + Спецыяльныя + Транспарт + Паслугі + Сімвалы + Спорт + Экстраныя службы + Вандроўка + Дадайце прынамсі два пункты + Увайсці ў OpenStreetMap + Увайсці ў OpenStreetMap.org + Увайсці з дапамогай OpenStreetMap + Вам неабходна ўвайсці ў сістэму, каб загрузіць новыя або адрэдагаваныя змены. +\n +\nВы можаце ўвайсці, выкарыстоўваючы бяспечны метад OAuth, або з дапамогай сваіх імя карыстальніка і пароля. + Выкарыстоўваць імя карыстальніка і пароль + Уліковы запіс + Аўтарызавацца + Кіраванне падпіскай + Націсніце кнопку, каб перайсці ў налады падпіскі Google Play і выправіць спосаб аплаты. + Мінуў тэрмін дзеяння падпіскі OsmAnd Live + Падпіска OsmAnd Live была прыпынена + Падпіска OsmAnd Live прыпынена + Гісторыя маркераў + Адправіць файл GPX на OpenStreetMap + Увадзіце тэгі праз коску. + \"Агульнадаступны\" азначае, што трасіроўка публічна адлюстроўваецца ў вашых GPS-трасіроўках і ў агульнадаступных спісах GPS-трасіровак, а таксама ў агульнадаступным спісе трасіровак з пазнакамі часу ў неапрацаваным выглядзе. Даныя, прадстаўленыя праз API, не спасылаюцца на вашу старонку трасіроўкі. Меткі часу трасіроўкі недаступныя праз агульнадаступны API GPS і не размяшчаюцца ў храналагічным парадку. + \"Прыватны\" азначае, што след не з\'явіцца ў любым агульнадаступным спісе, але кантрольныя пункты з яго даступныя ў адвольным парадку праз агульнадаступны GPS API без пазнак часу. + \"Ідэнтыфікаваны\" азначае, што трасіроўка будзе публічна адлюстроўвацца ў вашай GPS-трасіроўкі і ў агульнадаступных спісах GPS-трасіровак, гэта значыць, што іншыя карыстальнікі змогуць загрузіць неапрацаваны след і звязаць яго з вашым імем карыстальніка. Агульнадаступныя даныя трасіроўкі з GPS API, якія абслугоўваюцца з дапамогай API пунктаў адсочвання, спасылаюцца на пачатковую старонку трасіроўкі. + \"Адсочванне\" азначае, што трэк не з\'явіцца ў любым агульнадаступным спісе, але апрацоўка маршрутных пунктаў з яго (якія не могуць быць непасрэдна звязаны з вамі) ажыццяўляецца з выкарыстаннем загрузак з агульнадаступнага API GPS. + Закрыць нататку OSM + Каментаваць нататку OSM + Вы можаце ўвайсці, выкарыстоўваючы бяспечны метад OAuth або з дапамогай сваіх імя карыстальніка і пароля. + Дадаць фотаздымак + Зарэгістравацца на +\nOpenPlaceReviews.org + Фотаздымкі прадастаўлены праектам з адкрытымі данымі OpenPlaceReviews.org. Каб загрузіць фатаграфіі, зарэгіструйцеся на іх сайце. + Стварыць уліковы запіс + У мяне ўжо ёсць уліковы запіс + Гісторыя пошуку + Каяк + Маторная лодка + Немагчыма загрузіць выяву, паўтарыце спробу пазней + Выберыце выявы + Рэсурсы + Прыблізны памер файла + Выберыце даныя, якія вы хочаце экспартаваць у файл. + Неабходна для імпартавання + На вашай прыладзе свабодна толькі %1$s. Вызваліце месца альбо зніміце пазнаку з некаторых элементаў для экспартавання. + Недастаткова месца + Выберыце групы, якія трэба імпартаваць. + Выберыце элементы, якія трэба імпартаваць. + Дадаць да Mapillary + Дадаць да OpenPlaceReviews + Пераключыцца на выкарыстанне dev.openstreetmap.org замест openstreetmap.org для тэсціравання адпраўкі нататак OSM / POI / GPX. + Выкарыстоўваць dev.openstreetmap.org + OsmAnd паказвае фотаздымкі з некалькіх крыніц; +\nOpenPlaceReviews - фотаздымкі POI; +\nMapillary - выявы вуліц; +\nWeb / Wikimedia - фотаздымкі POI паводле дадзеных з OpenStreetMap. + %1$s * %2$s + Вы можаце выкарыстоўваць даныя пра вышыні, каб улічыць ўздымы/спускі падчас вашай паездкі + Лёгкі самалёт + Аб\'яднаць сегменты + Падзяліць да + Падзяліць пасля + Дадаць новы сегмент + Профіль карыстальніка + "• Дададзена магчымасць экспарту і імпарту ўсіх даных, уключаючы налады, рэсурсы, мае месцы. +\n +\n • Планаванне маршруту: графікі для сегментаў трэка з маршрутам, дададзена магчымасць ствараць і рэдагаваць некалькі сегментаў трэка. +\n +\n • Дададзены OAuth метад аўтэнтыфікацыі для OpenStreetMap, палепшаны інтэрфейс дыялогаў OSM. +\n +\n • Падтрымка карыстальніцкіх колераў для абранага і маршрутных пунктаў трэка. +\n +\n" + Вярнуць назад усе пункты + Выберыце профіль, які будзе выкарыстоўвацца падчас запуску прыкладання. + Апошні раз выкарыстоўвалася + Аддаваць перавагу пешаходным маршрутам + Аддаваць перавагу пешаходным маршрутам + Дазвольце ручаі і меліярацыйныя каналы + Дазвольце ручаі і меліярацыйныя каналы + Дазволіць перарывістыя водныя маршруты + Дазволіць перарывістыя водныя маршруты + Дадаць анлайн-маршрутызатар + Рэдагаваць анлайн-маршрутызатар + Падтып + Транспартны сродак + Ключ API + URL-адрас сервера + Увядзіце параметр + Пакінуць пустым, калі не + URL-адрас з усімі параметрамі будзе выглядаць так: + Тэст разліку маршруту + Ваджэнне + Пешшу + Ровар + Аўтамабіль + Капіраваць адрас + Анлайн-маршрутызатар + Анлайн-маршрутызатары + Папкі + Выберыце папку + Выберыце папку або стварыце новую + Пуста + Аналіз паводле інтэрвалаў + Выгрузіць на OpenStreetMap + Змяніць трэк + Перайменаваць трэк + Змяніць папку + сек. + Пры праходжанні + Набліжэнне + Заўчасная падрыхтоўка + Падрыхтавацца + Па-за маршрутам + Прыбыццё ў пункт прызначэння + Паварот + Інтэрвалы часу і адлегласці + Профіль OsmAnd + Час абвяшчэння + Час розных галасавых падказак залежыць ад тыпу запыту, бягучай хуткасці навігацыі і хуткасці навігацыі па змаўчанні. + Пачаць запіс + Паказаць трэк на мапе + Інвалідны вазок + Пешы турызм + Хадзьба + Электраровар + Горны ровар + Дарожны ровар + Звычайны ровар + Грузавік + Малы грузавік + Грузавік + Скутэр + Гоначны ровар + Горны ровар + Памылка сервера: %1$s + Назва ўжо існуе + Выдаліць анлайн-маршрутызатар\? + Чытаць цалкам + Змяніць апісанне + Выдаліць маршрутныя пункты + Капіраваць да пазнак мапы + Капіраваць да абранага + Выгрузка + Выгрузка завершана + Выгрузка %1$d з %2$d + Выгружана %1$d з %2$d + Выберыце змены для выгрузкі + Рэльеф мясцовасці / Схілы / Гарызанталі + OpenPlaceReviews — гэта грамадскі праект пра месцы агульнага карыстання, такія як, рэстараны, гатэлі, музеі, пункты шляху. Ён збірае ўсе агульнадаступныя даныя пра іх, такія як, выявы, водгукі, спасылкі на іншыя сістэмы, спасылкі OpenStreetMap, Вікіпедыя. +\n +\nУсе даныя OpenPlaceReview з\'яўляюцца адкрытымі і даступны тут: http://openplacereviews.org/data. +\n +\nВы можаце прачытаць больш па адрасу: http://openplacereviews.org + OpenPlaceReviews + Выкарыстаць test.openplacereviews.org + Увайсці ў OpenPlaceReviews + Вада + Зіма + Снегаход + Язда + Гонка + Горны ровар + Язда на ровары + Пешы турызм + Бег + Пешаход + Пазадарожнік + Матацыкл + Аўтамабіль \ No newline at end of file From c6343c8a4473d6013709722389d3daec4d3366fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D0=BE=D1=80=D0=B3=D1=96=D0=B9=20=D0=A6=D1=96?= =?UTF-8?q?=D1=82=D0=BE=D1=9E?= Date: Sat, 13 Feb 2021 12:04:48 +0000 Subject: [PATCH 30/46] Translated using Weblate (Belarusian) Currently translated at 97.9% (3812 of 3891 strings) --- OsmAnd/res/values-be/phrases.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-be/phrases.xml b/OsmAnd/res/values-be/phrases.xml index 5cb8aa3810..0cdf6d0599 100644 --- a/OsmAnd/res/values-be/phrases.xml +++ b/OsmAnd/res/values-be/phrases.xml @@ -3823,5 +3823,11 @@ Маленькія электрапрыборы Вулей Крама арэхаў - + + Паслугі для грамадзян + Іміграцыйныя візы + Неіміграцыйныя візы + Сувязь + Консульства + Амбасада \ No newline at end of file From 5786181b20a2029d47c53ac79d1f69374151746a Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Sat, 13 Feb 2021 00:40:17 +0000 Subject: [PATCH 31/46] Translated using Weblate (Ukrainian) Currently translated at 100.0% (271 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/uk/ --- OsmAnd-telegram/res/values-uk/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd-telegram/res/values-uk/strings.xml b/OsmAnd-telegram/res/values-uk/strings.xml index 571076ca63..1cf8bf63b6 100644 --- a/OsmAnd-telegram/res/values-uk/strings.xml +++ b/OsmAnd-telegram/res/values-uk/strings.xml @@ -138,7 +138,7 @@ nmi хв/м хв/км - вузл + вузлів м/с км/г мл/г From 81504a64f1ce8fd30a6d2746a020b03eb23d609a Mon Sep 17 00:00:00 2001 From: Artem Date: Sat, 13 Feb 2021 12:44:19 +0000 Subject: [PATCH 32/46] Translated using Weblate (Russian) Currently translated at 99.8% (3884 of 3891 strings) --- OsmAnd/res/values-ru/phrases.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index d230f225cf..f9cf872da1 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3879,4 +3879,10 @@ Станция рейнджеров Место для купания Экодук + Состояние трассы: закрыта + Состояние трассы: открыта + Патрулируется: нет + Патрулируется: да + Название трассы + Лыжный трамплин \ No newline at end of file From 14ce40ddda771171e91a267b4dff1809853d1587 Mon Sep 17 00:00:00 2001 From: cepprice Date: Sun, 14 Feb 2021 13:41:30 +0500 Subject: [PATCH 33/46] Refactor to lighten OsmandApplication --- .../src/net/osmand/plus/AppInitializer.java | 2 - .../net/osmand/plus/OsmandApplication.java | 73 ++-------------- .../net/osmand/plus/helpers/LocaleHelper.java | 86 ++++++++++++++++++- .../fragments/GlobalSettingsFragment.java | 2 +- .../net/osmand/plus/widgets/WebViewEx.java | 2 +- .../explore/WikivoyageExploreActivity.java | 2 +- 6 files changed, 95 insertions(+), 72 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 13b3102c93..065c7aba2e 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -36,7 +36,6 @@ import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask; import net.osmand.plus.helpers.AvoidSpecificRoads; import net.osmand.plus.helpers.DayNightHelper; -import net.osmand.plus.helpers.LocaleHelper; import net.osmand.plus.helpers.LockHelper; import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.inapp.InAppPurchaseHelperImpl; @@ -472,7 +471,6 @@ public class AppInitializer implements IProgress { app.osmOAuthHelper = startupInit(new OsmOAuthHelper(app), OsmOAuthHelper.class); app.oprAuthHelper = startupInit(new OprAuthHelper(app), OprAuthHelper.class); app.onlineRoutingHelper = startupInit(new OnlineRoutingHelper(app), OnlineRoutingHelper.class); - app.localeHelper = startupInit(new LocaleHelper(app), LocaleHelper.class); initOpeningHoursParser(); } diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 285a0135eb..83386b481b 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -166,12 +166,9 @@ public class OsmandApplication extends MultiDexApplication { OprAuthHelper oprAuthHelper; MeasurementEditingContext measurementEditingContext; OnlineRoutingHelper onlineRoutingHelper; - LocaleHelper localeHelper; + LocaleHelper localeHelper = new LocaleHelper(this); - private Resources localizedResources; private Map customRoutingConfigs = new ConcurrentHashMap<>(); - private Locale preferredLocale; - private Locale defaultLocale; private File externalStorageDirectory; private boolean externalStorageDirectoryReadOnly; @@ -220,7 +217,7 @@ public class OsmandApplication extends MultiDexApplication { removeSqliteDbTravelFiles(); } - checkPreferredLocale(); + localeHelper.checkPreferredLocale(); appInitializer.onCreateApplication(); // if(!osmandSettings.FOLLOW_THE_ROUTE.get()) { // targetPointsHelper.clearPointToNavigate(false); @@ -423,6 +420,7 @@ public class OsmandApplication extends MultiDexApplication { @Override public void onConfigurationChanged(Configuration newConfig) { + Locale preferredLocale = localeHelper.getPreferredLocale(); if (preferredLocale != null && !newConfig.locale.getLanguage().equals(preferredLocale.getLanguage())) { super.onConfigurationChanged(newConfig); // ugly fix ! On devices after 4.0 screen is blinking when you rotate device! @@ -436,47 +434,6 @@ public class OsmandApplication extends MultiDexApplication { } } - - public void checkPreferredLocale() { - Configuration config = getBaseContext().getResources().getConfiguration(); - - String pl = osmandSettings.PREFERRED_LOCALE.get(); - String[] split = pl.split("_"); - String lang = split[0]; - String country = (split.length > 1) ? split[1] : ""; - - if (defaultLocale == null) { - defaultLocale = Locale.getDefault(); - } - if (!Algorithms.isEmpty(lang)) { - if (!Algorithms.isEmpty(country)) { - preferredLocale = new Locale(lang, country); - } else { - preferredLocale = new Locale(lang); - } - } - Locale selectedLocale = null; - - if (!Algorithms.isEmpty(lang) && !config.locale.equals(preferredLocale)) { - selectedLocale = preferredLocale; - } else if (Algorithms.isEmpty(lang) && defaultLocale != null && Locale.getDefault() != defaultLocale) { - selectedLocale = defaultLocale; - preferredLocale = null; - } - if (selectedLocale != null) { - Locale.setDefault(selectedLocale); - config.locale = selectedLocale; - config.setLayoutDirection(selectedLocale); - - getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); - if (android.os.Build.VERSION.SDK_INT >= 17) { - Configuration conf = new Configuration(config); - conf.locale = selectedLocale; - localizedResources = createConfigurationContext(conf).getResources(); - } - } - } - public static final int PROGRESS_DIALOG = 5; public void checkApplicationIsBeingInitialized(Activity activity, AppInitializeListener listener) { @@ -828,7 +785,7 @@ public class OsmandApplication extends MultiDexApplication { themeResId = R.style.OsmandLightTheme; } } - setLanguage(c); + localeHelper.setLanguage(c); c.setTheme(themeResId); } @@ -855,25 +812,9 @@ public class OsmandApplication extends MultiDexApplication { return s; } - public void setLanguage(Context context) { - if (preferredLocale != null) { - Configuration config = context.getResources().getConfiguration(); - String lang = preferredLocale.getLanguage(); - if (!Algorithms.isEmpty(lang) && !config.locale.getLanguage().equals(lang)) { - preferredLocale = new Locale(lang); - Locale.setDefault(preferredLocale); - config.locale = preferredLocale; - context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics()); - } else if (Algorithms.isEmpty(lang) && defaultLocale != null && Locale.getDefault() != defaultLocale) { - Locale.setDefault(defaultLocale); - config.locale = defaultLocale; - getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics()); - } - } - } - public String getCountry() { String country; + Locale preferredLocale = localeHelper.getPreferredLocale(); if (preferredLocale != null) { country = preferredLocale.getCountry(); } else { @@ -884,6 +825,7 @@ public class OsmandApplication extends MultiDexApplication { public String getLanguage() { String lang; + Locale preferredLocale = localeHelper.getPreferredLocale(); if (preferredLocale != null) { lang = preferredLocale.getLanguage(); } else { @@ -897,11 +839,12 @@ public class OsmandApplication extends MultiDexApplication { @Override public AssetManager getAssets() { - return localizedResources != null ? localizedResources.getAssets() : super.getAssets(); + return getResources() != null ? getResources().getAssets() : super.getAssets(); } @Override public Resources getResources() { + Resources localizedResources = localeHelper.getLocalizedResources(); return localizedResources != null ? localizedResources : super.getResources(); } diff --git a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java index 02250098bc..a0bf32fb8e 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java @@ -1,10 +1,21 @@ package net.osmand.plus.helpers; +import android.content.Context; +import android.content.res.Configuration; +import android.content.res.Resources; + import net.osmand.StateChangedListener; import net.osmand.plus.OsmandApplication; +import net.osmand.util.Algorithms; + +import java.util.Locale; public class LocaleHelper implements StateChangedListener { + private Resources localizedResources; + private Locale preferredLocale; + private Locale defaultLocale; + private boolean needRestart = false; private OsmandApplication app; @@ -13,6 +24,65 @@ public class LocaleHelper implements StateChangedListener { this.app = app; } + public void checkPreferredLocale() { + Configuration config = app.getBaseContext().getResources().getConfiguration(); + + String pl = app.getSettings().PREFERRED_LOCALE.get(); + String[] split = pl.split("_"); + String lang = split[0]; + String country = (split.length > 1) ? split[1] : ""; + + if (defaultLocale == null) { + defaultLocale = Locale.getDefault(); + } + if (!Algorithms.isEmpty(lang)) { + if (!Algorithms.isEmpty(country)) { + preferredLocale = new Locale(lang, country); + } else { + preferredLocale = new Locale(lang); + } + } + Locale selectedLocale = null; + + if (!Algorithms.isEmpty(lang) && !config.locale.equals(preferredLocale)) { + selectedLocale = preferredLocale; + } else if (Algorithms.isEmpty(lang) && defaultLocale != null && Locale.getDefault() != defaultLocale) { + selectedLocale = defaultLocale; + preferredLocale = null; + } + if (selectedLocale != null) { + Locale.setDefault(selectedLocale); + config.locale = selectedLocale; + config.setLayoutDirection(selectedLocale); + + Resources resources = app.getBaseContext().getResources(); + resources.updateConfiguration(config, resources.getDisplayMetrics()); + if (android.os.Build.VERSION.SDK_INT >= 17) { + Configuration conf = new Configuration(config); + conf.locale = selectedLocale; + localizedResources = app.createConfigurationContext(conf).getResources(); + } + } + } + + public void setLanguage(Context context) { + if (preferredLocale != null) { + Configuration config = context.getResources().getConfiguration(); + String lang = preferredLocale.getLanguage(); + if (!Algorithms.isEmpty(lang) && !config.locale.getLanguage().equals(lang)) { + preferredLocale = new Locale(lang); + Locale.setDefault(preferredLocale); + config.locale = preferredLocale; + context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics()); + } else if (Algorithms.isEmpty(lang) && defaultLocale != null && Locale.getDefault() != defaultLocale) { + Locale.setDefault(defaultLocale); + config.locale = defaultLocale; + Resources resources = app.getBaseContext().getResources(); + resources.updateConfiguration(config, resources.getDisplayMetrics()); + } + } + } + public void listenLocaleChanges() { app.getSettings().PREFERRED_LOCALE.addListener(this); } @@ -29,9 +99,21 @@ public class LocaleHelper implements StateChangedListener { this.needRestart = needRestart; } + public Resources getLocalizedResources() { + return localizedResources; + } + + public Locale getPreferredLocale() { + return preferredLocale; + } + + public Locale getDefaultLocale() { + return defaultLocale; + } + @Override public void stateChanged(String change) { needRestart = true; - app.checkPreferredLocale(); + checkPreferredLocale(); } -} +} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/GlobalSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/GlobalSettingsFragment.java index 071d7be709..8114874547 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/GlobalSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/GlobalSettingsFragment.java @@ -108,7 +108,7 @@ public class GlobalSettingsFragment extends BaseSettingsFragment Activity activity = getActivity(); OsmandApplication app = getMyApplication(); if (app != null && activity != null) { - app.checkPreferredLocale(); + app.getLocaleHelper().checkPreferredLocale(); app.restartApp(activity); } } else if (prefId.equals(settings.SPEED_CAMERAS_UNINSTALLED.getId())) { diff --git a/OsmAnd/src/net/osmand/plus/widgets/WebViewEx.java b/OsmAnd/src/net/osmand/plus/widgets/WebViewEx.java index c83e1110cb..747e1bff57 100644 --- a/OsmAnd/src/net/osmand/plus/widgets/WebViewEx.java +++ b/OsmAnd/src/net/osmand/plus/widgets/WebViewEx.java @@ -40,7 +40,7 @@ public class WebViewEx extends WebView { // also see: https://gist.github.com/amake/0ac7724681ac1c178c6f95a5b09f03ce if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { OsmandApplication app = (OsmandApplication) ctx.getApplicationContext(); - app.checkPreferredLocale(); + app.getLocaleHelper().checkPreferredLocale(); ctx.getResources().updateConfiguration( new Configuration(app.getResources().getConfiguration()), ctx.getResources().getDisplayMetrics()); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java index dae47525aa..64a1de6dee 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java @@ -71,7 +71,7 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv nightMode = !settings.isLightContent(); int themeId = nightMode ? R.style.OsmandDarkTheme_NoActionbar : R.style.OsmandLightTheme_NoActionbar_LightStatusBar; - app.setLanguage(this); + app.getLocaleHelper().setLanguage(this); setTheme(themeId); super.onCreate(savedInstanceState); From ebe4057f687e91a02fd730143315abc9bbc7c723 Mon Sep 17 00:00:00 2001 From: cepprice Date: Sun, 14 Feb 2021 14:36:17 +0500 Subject: [PATCH 34/46] Add description to some route parameters --- OsmAnd/res/values/strings.xml | 9 ++++++--- .../settings/bottomsheets/ElevationDateBottomSheet.java | 5 ++--- .../settings/fragments/MapDuringNavigationFragment.java | 1 + .../plus/settings/fragments/RouteParametersFragment.java | 5 +++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a15fb40cbd..885ebd13f4 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -12,6 +12,12 @@ --> + Routing could avoid strong uphills + Don\'t rotate map view if speed is less than a threshold + Current location icon will be snapped to the current navigation route + Select driving purpose to get shorter, faster or safer route + Optimized shorter route (energy saving) + Use road restrictions that are active now on the map Login to OpenPlaceReviews Use test.openplacereviews.org OpenPlaceReviews @@ -104,7 +110,6 @@ Split before Join segments Light aircraft - You can use elevation data to account for ascent/descent of your trip %1$s * %2$s OsmAnd shows photos from several sources:\nOpenPlaceReviews - POI photos;\nMapillary - street-level imagery;\nWeb / Wikimedia - POI photos as per OpenStreetMap data. Use dev.openstreetmap.org @@ -1731,7 +1736,6 @@ Update all maps now? Clear all tiles Fuel-efficient way - Use fuel-efficient way (usually shorter). Are you sure you want to replace Favorite %1$s? Overground objects Change @@ -2895,7 +2899,6 @@ No motorways Zoom level according to your speed (while map is synchronized with current position). Auto zoom map - Snap position to roads during navigation. Snap to road Voice prompts pause music playback. Pause music diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java index 427bda7521..bbec8b4ec3 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java @@ -18,7 +18,7 @@ import net.osmand.plus.base.MenuBottomSheetDialogFragment; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerSpaceItem; -import net.osmand.plus.base.bottomsheetmenu.simpleitems.LongDescriptionItem; +import net.osmand.plus.base.bottomsheetmenu.simpleitems.ShortDescriptionItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; import net.osmand.plus.routepreparationmenu.RouteOptionsBottomSheet; import net.osmand.plus.settings.backend.ApplicationMode; @@ -114,8 +114,7 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment { int contentPaddingSmall = getResources().getDimensionPixelSize(R.dimen.content_padding_small); items.add(new DividerSpaceItem(app, contentPaddingSmall)); - items.add(new LongDescriptionItem(getString(R.string.elevation_data))); - items.add(new DividerSpaceItem(app, contentPaddingSmall)); + items.add(new ShortDescriptionItem((getString(R.string.elevation_data_descr)))); createReliefFactorButtons(themedCtx); } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java index 0fe5a6d6a3..3ac28ca523 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/MapDuringNavigationFragment.java @@ -90,6 +90,7 @@ public class MapDuringNavigationFragment extends BaseSettingsFragment { } } ListPreferenceEx switchMapDirectionToCompass = (ListPreferenceEx) findPreference(settings.SWITCH_MAP_DIRECTION_TO_COMPASS_KMH.getId()); + switchMapDirectionToCompass.setDescription(R.string.map_orientation_threshold_descr); switchMapDirectionToCompass.setEntries(names); switchMapDirectionToCompass.setEntryValues(valuesKmh); } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/RouteParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/RouteParametersFragment.java index 123c49b316..a344647573 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/RouteParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/RouteParametersFragment.java @@ -156,6 +156,7 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP timeConditionalRouting.setIcon(getRoutingPrefIcon(settings.ENABLE_TIME_CONDITIONAL_ROUTING.getId())); timeConditionalRouting.setSummaryOn(R.string.shared_string_on); timeConditionalRouting.setSummaryOff(R.string.shared_string_off); + timeConditionalRouting.setDescription(R.string.temporary_conditional_routing_descr); getPreferenceScreen().addPreference(timeConditionalRouting); } @@ -580,6 +581,7 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP private ListPreferenceEx createRoutingBooleanListPreference(String groupKey, List routingParameters) { String defaultTitle = Algorithms.capitalizeFirstLetterAndLowercase(groupKey.replace('_', ' ')); String title = AndroidUtils.getRoutingStringPropertyName(app, groupKey, defaultTitle); + String description = AndroidUtils.getRoutingStringPropertyDescription(app, groupKey, ""); ApplicationMode am = getSelectedAppMode(); Object[] entryValues = new Object[routingParameters.size()]; @@ -599,6 +601,9 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP routingListPref.setPersistent(false); routingListPref.setValue(selectedParameterId); routingListPref.setIcon(getRoutingPrefIcon(groupKey)); + if (!Algorithms.isEmpty(defaultTitle)) { + routingListPref.setDescription(description); + } return routingListPref; } From 5a1e72b2d13084af9752531026d104fc6b2e5408 Mon Sep 17 00:00:00 2001 From: cepprice Date: Sun, 14 Feb 2021 14:36:49 +0500 Subject: [PATCH 35/46] Remove old translations --- OsmAnd/res/values-af/strings.xml | 1 - OsmAnd/res/values-ar/strings.xml | 3 --- OsmAnd/res/values-az/strings.xml | 2 -- OsmAnd/res/values-b+ast/strings.xml | 1 - OsmAnd/res/values-b+be+Latn/strings.xml | 2 -- OsmAnd/res/values-b+hsb/strings.xml | 2 -- OsmAnd/res/values-be/strings.xml | 2 -- OsmAnd/res/values-bg/strings.xml | 2 -- OsmAnd/res/values-ca/strings.xml | 3 --- OsmAnd/res/values-cs/strings.xml | 3 --- OsmAnd/res/values-cy/strings.xml | 1 - OsmAnd/res/values-da/strings.xml | 2 -- OsmAnd/res/values-de/strings.xml | 3 --- OsmAnd/res/values-el/strings.xml | 2 -- OsmAnd/res/values-eo/strings.xml | 3 --- OsmAnd/res/values-es-rAR/strings.xml | 3 --- OsmAnd/res/values-es-rUS/strings.xml | 3 --- OsmAnd/res/values-es/strings.xml | 3 --- OsmAnd/res/values-et/strings.xml | 3 --- OsmAnd/res/values-eu/strings.xml | 2 -- OsmAnd/res/values-fa/strings.xml | 2 -- OsmAnd/res/values-fi/strings.xml | 2 -- OsmAnd/res/values-fr/strings.xml | 3 --- OsmAnd/res/values-gl/strings.xml | 3 --- OsmAnd/res/values-hu/strings.xml | 3 --- OsmAnd/res/values-hy/strings.xml | 2 -- OsmAnd/res/values-id/strings.xml | 1 - OsmAnd/res/values-is/strings.xml | 3 --- OsmAnd/res/values-it/strings.xml | 3 --- OsmAnd/res/values-iw/strings.xml | 3 --- OsmAnd/res/values-ja/strings.xml | 2 -- OsmAnd/res/values-ka/strings.xml | 1 - OsmAnd/res/values-ko/strings.xml | 1 - OsmAnd/res/values-lt/strings.xml | 2 -- OsmAnd/res/values-lv/strings.xml | 2 -- OsmAnd/res/values-ml/strings.xml | 2 -- OsmAnd/res/values-nb/strings.xml | 3 --- OsmAnd/res/values-nl/strings.xml | 3 --- OsmAnd/res/values-pl/strings.xml | 3 --- OsmAnd/res/values-pt-rBR/strings.xml | 3 --- OsmAnd/res/values-pt/strings.xml | 3 --- OsmAnd/res/values-ro/strings.xml | 2 -- OsmAnd/res/values-ru/strings.xml | 3 --- OsmAnd/res/values-sc/strings.xml | 3 --- OsmAnd/res/values-sk/strings.xml | 3 --- OsmAnd/res/values-sl/strings.xml | 2 -- OsmAnd/res/values-sr/strings.xml | 3 --- OsmAnd/res/values-sv/strings.xml | 3 --- OsmAnd/res/values-ta/strings.xml | 1 - OsmAnd/res/values-tr/strings.xml | 3 --- OsmAnd/res/values-uk/strings.xml | 3 --- OsmAnd/res/values-zh-rCN/strings.xml | 4 +--- OsmAnd/res/values-zh-rTW/strings.xml | 3 --- 53 files changed, 1 insertion(+), 128 deletions(-) diff --git a/OsmAnd/res/values-af/strings.xml b/OsmAnd/res/values-af/strings.xml index c64a87f3da..712f1ae8cb 100644 --- a/OsmAnd/res/values-af/strings.xml +++ b/OsmAnd/res/values-af/strings.xml @@ -795,7 +795,6 @@ Besigtigingstoere Verstel verkeer waarskuwings (spoedbeperkings, geforseerde stoppe, spoedhobbels), spoed kameras, en laan inligting Vermy snelweë - Knip posisie aan paaie vas gedurende navigasie Knip vas aan pad OsmAnd (OSM Automated Navigation Directions) is `n ope bron navigasie toepassing met toegang tot `n wye verskeidenheid wêreldwye OpenStreetMap (OSM) inligting. Alle kaart inligting (vektor of teël kaarte) kan gestoor word op die foon geheue kaart vir aflyn gebruik. OsmAnd bied ook aan- en aflyn routeberekening funksionaliteit insluitend draai-vir-draai stem begeleiding. Sommige van die kern funksies: - Volledege aflyn funksionaliteit (stoor afgelaaide vektor of teël kaarte in `n kiesbare leër) - Kompakte aflyn vektor kaarte vir die hele wëreld beskikbaar - aflaai van land of streek kaarte direk uit die toepassing - Oorlegging van verskeie kaart lae moontlik, bv GPX of navigasie spore, Belangepunte, gunstelinge, kontoerlyne, publieke vervoer haltes, ekstra kaarte met verstelbare deurskynendheid - Aflyn diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index d94cd5692f..66dcb3c3e8 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -353,7 +353,6 @@ استخدم البوصلة عندما لا تكون هناك أي وجهة محددة. ملائمة تقريب الخريطة تزامناً مع موقعك. التكبير التلقائي - التقط الموقع إلى الطرق أثناء الملاحة. التقاط الطريق خرائط أوسماند والملاحة برنامج عرض الخرائط العالمية والملاحة باستخدام خرائط الشوارع المفتوحة OSM أثناء الاتصال بالإنترنت أو من دونه @@ -1996,7 +1995,6 @@ تغيير ابدأ طريق أقل استهلاكاً للوقود - استخدم طريق أقل استهلاكا للوقود (عادة أقصر). هل تريد استبدال المفضلة %1$s؟ حذف جميع الطبقات هل تريد تحديث كافة الخرائط الآن؟ @@ -3982,7 +3980,6 @@ تحديد صورة %1$s * %2$s الألمانية (تقليدية) - يمكنك استخدام بيانات الارتفاع للنظر في الارتفاع / النزول لرحلتك طائرة ربط الأجزاء تقسيم قبل diff --git a/OsmAnd/res/values-az/strings.xml b/OsmAnd/res/values-az/strings.xml index b4470c5851..e4f88ddc9c 100644 --- a/OsmAnd/res/values-az/strings.xml +++ b/OsmAnd/res/values-az/strings.xml @@ -979,7 +979,6 @@ Yollardan yayın… Pullu yollardan yayın Son nöqtə ən yaxın yoldan çox uzaqdır. - Naviqasiya zamanı mövqeni yollara bərkit. Yola bərkit Asfaltsız yollardan yayın Pullu yollardan yayın @@ -1967,7 +1966,6 @@ Filtr: Nöqtənin qeydiyyatı üçün minimum dəqiqlik seçin. Yol səthinin keyfiyyəti Yanacağa qənaətli yol - Yanacağa qənaətli yoldan istifadə et (adətən daha qısa). Hədəf nöqtənin istiqamətini titrəmə ilə göstər. OsmAnd Live dəyişiklikləri üçün naviqasiyanı aktivləşdir. İndi proqramın xarici yaddaşa yazmasına icazə verilir, lakin bunun üçün yenidən başlatmaq lazımdır. diff --git a/OsmAnd/res/values-b+ast/strings.xml b/OsmAnd/res/values-b+ast/strings.xml index cfae19939f..fd7c7ffabd 100644 --- a/OsmAnd/res/values-b+ast/strings.xml +++ b/OsmAnd/res/values-b+ast/strings.xml @@ -1278,7 +1278,6 @@ PdI cercanos Evitar carreteres ensin pavimentar Evitar autopistes - Axusta la posición a los caminos na navegación. Axustar a la carretera Namái a mano (toca na flecha) Repitir les instrucciones de navegación diff --git a/OsmAnd/res/values-b+be+Latn/strings.xml b/OsmAnd/res/values-b+be+Latn/strings.xml index a61eff41b3..6c09337e92 100644 --- a/OsmAnd/res/values-b+be+Latn/strings.xml +++ b/OsmAnd/res/values-b+be+Latn/strings.xml @@ -562,7 +562,6 @@ Punktaŭ maršrutu %2$s Paźbiahać aŭtamahіstralaŭ Uzrovień pavieličennia zhodna vašaj chutkasci (kali mapa sinchranizujecca z ciapierašnim stanoviščam). Aŭtamatyčnaje pamianšeńnie/pavieličeńnie - Pryviazvacca da daroh padčas navihacyi. Pryviazvacca da daroh Halasavyja padkazki prypyniajuć muzyku, a nie toĺki pryhlušajuć jaje. Pierapynieńnie muzykі @@ -1983,7 +1982,6 @@ Praparcyjnaj pamiacі %4$s MB (Abmiežavańnie Android %5$s MB, Dalvik %6$s MB). Abnavić usie mapy zaraz? Ačyścіć keš siecіŭnych mapaŭ Paliŭna-aščadny maršrut - Različvaje paliva-aščadny maršrut (zvyčajna najkaraciejšy). Vy sapraŭdy chočacie zamianić upadabanaje %1$s? Nadziemnyja abjekty Źmianіć diff --git a/OsmAnd/res/values-b+hsb/strings.xml b/OsmAnd/res/values-b+hsb/strings.xml index 4b04909302..242e4465ce 100644 --- a/OsmAnd/res/values-b+hsb/strings.xml +++ b/OsmAnd/res/values-b+hsb/strings.xml @@ -444,7 +444,6 @@ Awtodróhi wobeńć Přiměrja wulkosć karty wotpowědujo aktualnej spěšnosći (karta so z tuchwilnym stejišćom synchronizuje). Awtomatiski zoom - W běhu nawigacije poziciski dypk na dróhach zdźeržować. Na dróze wostać Připowědźenje přetorhnje hudźbu. Wothrawanje hudźby přetorhować @@ -1360,7 +1359,6 @@ Dowolić Přistup k stejišću dowolić Naftu lutowacy puć - Naftu lutowacy puć wužić (zwjetša krótši). Wubrane objekty z archiwa wotstronić? Chorhojčku wubrać Druhe chorhojčki diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 1a01c2fcf0..6c6a3a77cb 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -232,7 +232,6 @@ Без аўтамагістраляў Узровень павелічэння згодна вашай хуткасці (калі мапа сінхранізуецца з цяперашнім становішчам). Аўтаматычнае памяншэнне/павелічэнне - Прывязвацца да дарог падчас навігацыі. Прывязвацца да дарог OsmAnd Мапы і навігацыя Прагляд глабальнай мабільнай мапы і навігатар для аўтаномных і сеціўных мапаў OSM @@ -2028,7 +2027,6 @@ Змяніць Пачаць Паліўна-ашчадны маршрут - Разлічвае паліва-ашчадны маршрут (звычайна найкарацейшы). Вы сапраўды хочаце замяніць улюбёную мясціну %1$s\? Абнавіць усе мапы зараз? Ачысціць кэш сеціўных мапаў diff --git a/OsmAnd/res/values-bg/strings.xml b/OsmAnd/res/values-bg/strings.xml index f5b532dabb..868d2d9386 100644 --- a/OsmAnd/res/values-bg/strings.xml +++ b/OsmAnd/res/values-bg/strings.xml @@ -208,7 +208,6 @@ Без магистрали Авто-мащабиране съобразно вашата скорост (само за синхронизирани карти) Авто-мащабиране - Позицията да се придържа към пътя по време на пътуване Придържай мястото към пътя OsmAnd за карти и навигация Мобилни карти и навигация от OSM @@ -1925,7 +1924,6 @@ Обновяване на всички карти сега\? Изчистване на всички плочки Икономичен маршрут - Използване на икономичен маршрут (обичайно по-кратък). Наистина ли искате да заместите %1$s? Надземни обекти Абонаментна такса се начислява всеки месец. Можете да я отмените от Google Play по всяко време. diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index 22bd63a4bd..c5537ac281 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -641,7 +641,6 @@ Sense autopistes Nivell de zoom en funció de la velocitat (mentre el mapa estigui sincronitzat amb la posició actual). Zoom automàtic del mapa - Ajusta la posició a les carreteres durant la navegació. Desplaça a la carretera MCP Els connectors activen els paràmetres del mode expert i de funcionalitats addicionals. @@ -1987,7 +1986,6 @@ Modifica Comença Ruta amb menys consum - Utilitza la ruta de menys consum (normalment la més curta). Confirmeu que voleu substituir el Preferit %1$s? Voleu actualitzar tots els mapes ara mateix? Esborra totes les tessel·les @@ -3813,7 +3811,6 @@ \nWeb / Wikimedia: fotos dels PDIs d\'OpenStreetMap. %1$s * %2$s Equipament - Podeu utilitzar les dades d’elevació per acumular l\'ascens/descens de la vostra ruta Avioneta \"Identificable\" vol dir que la traça es mostrarà públicament a les vostres traces GPS i als llistats públics de traces GPS, és a dir, els altres usuaris la podran baixar en brut i associada al vostre usuari. Les dades cronològiques de pas per les fites de l’API GPS que es publiquen mitjançant l’API de fites faran referència a la pàgina de la vostra traça original. \"Privada\" vol dir que la traça no es mostra a cap llistat públic, però les fites que conté estan disponibles a través de l\'API pública GPS, desordenades i sense enregistraments temporals. diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index ed36b49158..10ec2cce11 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -781,7 +781,6 @@ Denní/noční info Styl mapy Žádné dálnice - Zachytí kurzor na nejbližší silnici/cestu během navigace. Vlastnosti vykreslování Parkoviště Veřejná doprava @@ -2004,7 +2003,6 @@ Aktualizovat všechny mapy ihned? Vymazat všechny dlaždice Ekonomická trasa - Použít ekonomickou trasu (obvykle kratší). Opravdu chcete nahradit Oblíbené místo „%1$s“\? Nadzemní objekty Změnit @@ -3919,7 +3917,6 @@ Použít dev.openstreetmap.org %1$s * %2$s Němčina (hovorová) - Můžete použít výšková data pro započítání výstupu/sestupu na trase Lehké letadlo Spojit úseky Rozdělit před diff --git a/OsmAnd/res/values-cy/strings.xml b/OsmAnd/res/values-cy/strings.xml index e969c2d217..acaeb2c7b6 100644 --- a/OsmAnd/res/values-cy/strings.xml +++ b/OsmAnd/res/values-cy/strings.xml @@ -51,7 +51,6 @@ Ceisiwch osgoi traffyrdd Zoom Auto mapio yn ôl eich cyflymder (tra map wedi eu cydamseru gyda\'r sefyllfa bresennol) Auto chwyddo map - Snap sefyllfa i ffyrdd yn ystod llywio Snap i\'r ffordd OsmAnd yn gais ffynhonnell agored ar gyfer llywio fapiau all-lein ac ar-lein OsmAnd yn gais ffynhonnell agored ar gyfer llywio fapiau all-lein ac ar-lein diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index abdedb57ef..c2d2fe7bc9 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -128,7 +128,6 @@ Brug kamera Lat %1$.3f, Lon %2$.3f Mellemliggende destination %1$s - Hold position på vejen under navigation. Fastgør til vejen Globale mobilkort og navigation til offline og online OSM-kort Global mobilkortvisning og navigation til offline og online OSM-kort @@ -1995,7 +1994,6 @@ %1$s stop før Objekter over jorden Brændstofbesparende rute - Brug brændstofbesparende rute (normalt kortere). Erstat Favorit %1$s? Skift Kom i gang diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 215d278648..7704aba613 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -97,7 +97,6 @@ Keine Autobahnen Kartenvergrößerung der Geschwindigkeit anpassen (während der Kartennachführung). Automatische Vergrößerung - Standort während der Navigation auf Straßen einrasten. Auf Straße einrasten OsmAnd Karten & Navigation Globale Landkarten- und Navigationsanwendung für Offline- und Online-OSM-Karten @@ -1999,7 +1998,6 @@ %1$s Haltestellen davor Oberirdische Objekte Kraftstoffsparende Route - Kraftstoffsparende Route verwenden (in der Regel kürzer). Wollen Sie den Favoriten \'%1$s\' wirklich ersetzen? Ändern Erste Schritte @@ -3923,7 +3921,6 @@ Bild kann nicht hochgeladen werden, bitte versuchen Sie es später erneut Bild auswählen %1$s * %2$s - Sie können Höhendaten verwenden, um Steigungen und Gefälle auf Ihrer Reise zu berücksichtigen Kleinflugzeug Teilen vor Teilen nach diff --git a/OsmAnd/res/values-el/strings.xml b/OsmAnd/res/values-el/strings.xml index a2601e7c97..49d5c237d7 100644 --- a/OsmAnd/res/values-el/strings.xml +++ b/OsmAnd/res/values-el/strings.xml @@ -20,7 +20,6 @@ Όχι αυτοκινητόδρομους Επίπεδο εστίασης χάρτη ανάλογα με την ταχύτητά σας (ενώ ο χάρτης συγχρονίζεται με την τρέχουσα θέση). Αυτόματη εστίαση χάρτη - Προσανατολισμός στους δρόμους κατά τη διάρκεια της πλοήγησης. Προσανατολισμός στο δρόμο Προβολή φορητού παγκόσμιου χάρτη & πλοήγηση για χάρτες OSM χωρίς και με διαδίκτυο OsmAnd (OSM Αυτοματοποιημένες Οδηγίες Πλοήγησης) @@ -1965,7 +1964,6 @@ Θέλετε να ενημερώσετε όλους τους χάρτες τώρα; Καθαρισμός όλων των πλακιδίων Διαδρομή με οικονομία καυσίμων - Χρησιμοποιήστε τη διαδρομή με οικονομία καυσίμων (συνήθως συντομότερη). Είσαστε σίγουρος/η ότι θέλετε να αντικαταστήσετε το Αγαπημένο %1$s; Υπέργεια αντικείμενα Αλλαγή diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index da7a929cf2..5e9de246f6 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -1056,7 +1056,6 @@ Sen aŭtovojojn Aŭtomate skali mapon Skali mapon depende de via rapido (kiam mapo estas samtempigita kun aktuala pozicio). - Proksimumigi pozicion al vojo dum navigado. Proksimumigi al vojo Paŭzigi muzikon Voĉaj anoncoj paǔzigas ludadon de muziko. @@ -1991,7 +1990,6 @@ Ŝanĝi Ekigi Brulaĵ-ŝparema kurso - Kalkuli brulaĵ-ŝpareman kurson (kutime plej mallongan). Ĉu vi volas anstataŭigi la ŝatatan ejon %1$s? Forviŝi ĉiujn kahelojn Ĉu ĝisdatigi ĉiujn mapojn nun? @@ -3919,7 +3917,6 @@ Elektu bildon %1$s * %2$s Germana (ordinara) - Vi povas uzi datumojn pri altitudo por kalkuli suprenirojn/malsuprenirojn de via kurso Malpeza aviadilo Kunigi segmentojn Dividi antaŭ diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index b1bdd574c8..e6959c4b57 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -742,7 +742,6 @@ Sin autopistas Nivel de zoom según la velocidad (mientras el mapa se sincroniza con la ubicación actual). Zoom automático del mapa - Ajusta la ubicación al camino durante la navegación. Ajustar al camino Las indicaciones por voz pausan la reproducción de música. Pausar música @@ -1992,7 +1991,6 @@ Objetos en superficie ¿Reemplazar el Favorito «%1$s»? Ruta de bajo consumo (corta) - Usa la ruta de menor consumo en combustible (usualmente la más corta). Cambiar Empezar ¿Actualizar todos los mapas ahora? @@ -3921,7 +3919,6 @@ Elegir imagen Alemán (casual) %1$s * %2$s - Puedes usar los datos de elevación para tener en cuenta el ascenso y descenso del viaje Avión ligero Unir segmentos Dividir antes diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index 13de05dc23..f4618b8da3 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -742,7 +742,6 @@ Sin autopistas Nivel de zoom según la velocidad (mientras el mapa se sincroniza con la ubicación actual). Zoom automático del mapa - Ajusta la ubicación al camino durante la navegación. Ajustar al camino Las indicaciones por voz pausan la reproducción de música. Pausar música @@ -1992,7 +1991,6 @@ %1$s parada(s) anterior(es) Objetos en superficie Ruta de bajo consumo (corta) - Usa la ruta de menor consumo en combustible (usualmente la más corta). ¿Reemplazar el Favorito «%1$s»? Cambiar Empezar @@ -3934,7 +3932,6 @@ Añadir nuevo segmento %1$s * %2$s Alemán (casual) - Puedes usar los datos de elevación para tener en cuenta el ascenso y descenso del viaje Avión ligero Usado por última vez Preferir rutas de senderismo diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index a49abf7b0d..eed7a15a11 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -825,7 +825,6 @@ \n - Indicación de carriles, mostrar límites de velocidad, voces grabadas y sintetizadas \n Sin autopistas - Ajusta la ubicación al camino durante la navegación. Ajustar al camino Añadir como primer destino intermedio Añadir como último destino intermedio @@ -1988,7 +1987,6 @@ ¿Actualizar todos los mapas ahora? Limpiar todas las teselas Ruta de bajo consumo (corta) - Usa la ruta de menor consumo en combustible (usualmente la más corta). ¿Reemplazar el Favorito «%1$s»? Objetos en superficie Cambiar @@ -3927,7 +3925,6 @@ Seleccione los elementos que se importarán. Cambie para usar dev.openstreetmap.org en lugar de openstreetmap.org para probar la carga de OSM Note / POI / GPX. Usar dev.openstreetmap.org - Puede utilizar los datos de elevación para tener en cuenta el ascenso/descenso de su viaje Aeronave ligera Unir segmentos Dividir antes diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index 1375440bb8..a42e33c3a4 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -1469,7 +1469,6 @@ Eelista kiirteid Eelista kiirteid Kütusesäästlik tee - Kasuta kütusesäästlikku teed (tavaliselt lühem). Väldi tasulisi teid Väldib tasulisi teid Väldi sillutamata teid @@ -1691,7 +1690,6 @@ Kasuta kompassi Väldi kiirteid Automaatne kaardi suurendamine - Hoia navigeerimise ajal asukoht teel. Kinnitu teele Hääljuhised peatavad muusika esitamise. Peata muusika @@ -3841,7 +3839,6 @@ Markerite ajalugu %1$s * %2$s Kerglennukid - Võid kasutada kõugusandmeid teekonna tõusu ja laskumise arvutamisel Lisa uus lõik Tükelda pärast Tükelda enne diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml index c0d0bb8e13..6c356b4117 100644 --- a/OsmAnd/res/values-eu/strings.xml +++ b/OsmAnd/res/values-eu/strings.xml @@ -234,7 +234,6 @@ Autobiderik ez Zooma maila abiaduraren arabera (mapa uneko kokapenarekin sinkronizatua dagoela). Auto zoom-a egin mapan - Atxikitu kokapena errepidera nabigatu bitartean. Atxikitu errepidera OsmAnd Maps & Nabigazioa Mapa ikusle eta nabigatzaile mugikor globala lineaz kanpoko eta sare bidezko OSM mapetarako @@ -1996,7 +1995,6 @@ mapak eta nabigazioa Eguneratu mapa guztiak orain? Garbitu tesela guztiak Bide erregai-efizientea - Erabili bide erregai-efizientea (normalean laburragoa). Ziur %1$s gogokoa ordezkatu nahi duzula? Aldatu Hasi diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index ac3bab1d03..76b8a3ea0a 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -503,7 +503,6 @@ پیکربندی‌های مربوط به هشدارهای ترافیکی (مانند محدودیت‌های سرعت، توقف‌های اجباری، سرعتگیرها، تونل‌ها)، اخطارهای دوربین سرعت و اطلاعات خط عبوری را انجام دهید. اگر جهت شناسایی نشد از قطب‌نما استفاده شود. آزادراه - در هنگام ناوبری، موقعیت را به جاده‌ها بچسبان. چسبیدن به راه نقشه و ناوبری با OsmAnd برنامهٔ همراه برای مشاهدهٔ نقشه جهانی و ناوبری با نقشه‌های آفلاین و آنلاین OSM @@ -1651,7 +1650,6 @@ اکنون همهٔ نقشه‌ها را به‌روز می‌کنید؟ پاک‌کردن همهٔ کاشی‌ها راه صرفه‌جویی سوخت - انتخاب راه مناسب برای مصرف سوخت کمتر (معمولاً کوتاه‌تر). آیا این نقطهٔ جدید را جانشین «%1$s» می‌کنید؟ اشیای روی زمین تغییر diff --git a/OsmAnd/res/values-fi/strings.xml b/OsmAnd/res/values-fi/strings.xml index c188b64182..08c023bef1 100644 --- a/OsmAnd/res/values-fi/strings.xml +++ b/OsmAnd/res/values-fi/strings.xml @@ -33,7 +33,6 @@ Käytä kompassia Vältä moottoriteitä Automaattinen kartan zoomaus - Kiinnitä sijainti teihin navigoinnin aikana Kiinnitä tiehen OsmAnd on avoimen lähdekoodin navigointisovellus offline ja online kartoille OsmAnd on avoimen lähdekoodin navigointisovellus offline ja online kartoille @@ -876,7 +875,6 @@ Maailmanlaajuiset tiedot (välillä 70 astetta pohjoista ja 70 astetta eteläist Päivitetäänkö kaikki kartat nyt? Poista kaikki tiilet Polttoainetaloudellinen reitti - Käytä polttoainetta säästävää reittiä (tavallisesti lyhin). Muuta Aloita Koordinaattihaku diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 1f8808c5dc..a6f42876cf 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -781,7 +781,6 @@ En continu Logiciel de cartographie et de navigation fonctionnant avec des cartes OSM hors-ligne et en ligne OsmAnd est un logiciel libre de navigation pouvant fonctionner avec des cartes hors-ligne ou en ligne - Déplacer la position sur la route en cours de navigation. Déplacer sur la route OsmAnd (OSM Automated Navigation Directions) \n @@ -1984,7 +1983,6 @@ Modifier Démarrer Trajet économe en carburant - Suivre un trajet économe en carburant (habituellement plus court). Ignorer le téléchargement des cartes Aucune carte hors ligne n\'est installée. Vous pouvez sélectionner une carte dans la liste ou télécharger une carte plus tard depuis le menu « %1$s ». Sélectionner une autre région @@ -3907,7 +3905,6 @@ %1$s * %2$s Allemand (courant) Aviation légère - Vous pouvez utiliser l\'altitude pour prendre en compte le dénivellé de votre itinéraire « Traçable » signifie que la trace ne s\'affichera pas dans les listes publiques, mais que les points de cheminement horodatés qu\'elle contient seront téléchargeables depuis l\'API GPS publique (ces points sont traités afin de n\'avoir aucun lien direct avec vous). • Ajout d\'une option pour exporter et importer toutes les données, y compris les paramètres, les ressources, mes lieux \n diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index 6c078f0d5b..990ad44972 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -494,7 +494,6 @@ Sen autoestradas Variar o achegamento do mapa segundo a velocidade (mentres o mapa estiver sincronizado coa posición actual). Achegamento automático do mapa - Axustar a posición ás estradas durante a navegación. Axustar á estrada As indicacións por voz deteñen a reprodución de música. Deter a música @@ -1976,7 +1975,6 @@ Lon %2$s Listaxe en árbore Descargas ilimitadas dos mapas, actualizacións e plugin da Wikipedia. Camiño con aforro no combustíbel - Empregar o camiño con aforro no combustíbel (normalmente máis curto). Mudar Comezar %1$s paradas antes @@ -3928,7 +3926,6 @@ Lon %2$s \nWeb / Wikimedia - imaxes POI segundo datos do OpenStreetMap. %1$s * %2$s Alemán casual - Podes empregar os datos de elevación para ter en conta o ascenso e descenso da viaxe Avión lixeiro Unir segmentos Dividir antes diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 5355241d87..e8bf4c7134 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -822,7 +822,6 @@ \n Globális mobil térkép és navigáció, offline és online OSM térképekkel Autópálya nélkül - Úthoz rögzítés navigáció közben. Úthoz illesztés Hozzáadás utolsó köztes célpontként Hozzáadás első köztes célpontként @@ -2010,7 +2009,6 @@ Frissíted most az összes térképet? Összes csempe törlése Üzemanyag-takarékos útvonal - Üzemanyag-takarékos útvonal tervezése (általában rövidebb). Lecseréled a(z) %1$s Kedvencet\? Ausztrália Beszerzés %1$s-ért @@ -3912,7 +3910,6 @@ Kép kijelölése német (tegeződő) %1$s * %2$s - A magassági adatok felhasználásával figyelembe veheti az utazás során az emelkedést / lejtést Könnyű légi jármű Elvágás előtte Elvágás utána diff --git a/OsmAnd/res/values-hy/strings.xml b/OsmAnd/res/values-hy/strings.xml index 2fa00f6174..b01a74768c 100644 --- a/OsmAnd/res/values-hy/strings.xml +++ b/OsmAnd/res/values-hy/strings.xml @@ -430,7 +430,6 @@ Թարմացնել բոլոր քարտեզները հիմա? Ջնջել բոլոր տայլերը Վառելիք տնտեսող ճանապարհ - Կիրառել վառելիք տնտեսող ճանապարհ (սովորաբար ավելի կարճ)։ Վստահ եք, որ ցանկանում եք փոխարինել Սիրածները %1$s\? Վերգետնյա օբյեկտներ Փոխել @@ -1437,7 +1436,6 @@ Առանց ավտոմայրուղիներից Ավտոմատ կերպով փոխել քարտեզի մասշտաբը ըստ արագությանը։ Ավտո-մասշտաբ - Կապել ընթացիկ դիրքը ճանապարհին։ Կապել ճանապարհին Ձայնային հրահանգներ դադարեցնում են երաժշտության նվագումը։ Ընդհատել երաժշտությունը diff --git a/OsmAnd/res/values-id/strings.xml b/OsmAnd/res/values-id/strings.xml index d788854d2a..6661a37328 100644 --- a/OsmAnd/res/values-id/strings.xml +++ b/OsmAnd/res/values-id/strings.xml @@ -424,7 +424,6 @@ Apakah anda ingin memperbahurui semua peta sekarang? Bersihkan Semua ubin Cara hemat bahan bakar - Gunakan cara hemat bahan bakar (biasanya lebih pendek). Apakah kamu yakin kamu ingin mengganti favorit %1$s? Benda-benda di atas tanah Ganti diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml index ebb0385e37..8d0eadc3b3 100644 --- a/OsmAnd/res/values-is/strings.xml +++ b/OsmAnd/res/values-is/strings.xml @@ -1374,7 +1374,6 @@ Ná í það Ná í það fyrir %1$s Leið með hagkvæmri eldsneytisnýtingu - Nota leið með hagkvæmri eldsneytisnýtingu (venjulega styttri). Ertu viss að þú viljir skipta út eftirlætinu %1$s? Fjarlægja valin atriði úr breytingaskránni? Breyta staðsetningu kortamerkis @@ -1835,7 +1834,6 @@ Loka breytingasetti Nota áttavita þegar stefna finnst ekki á annan máta. Sjálfvirkur aðdráttur korts miðað við hraða þinn (á meðan kort er samstillt við virka staðsetningu). - Staðsetning grípi í vegi á meðan leiðsögn stendur. Gera hlé á tónlist á meðan talskilaboð eru flutt. Ekki senda nafnlausar upplýsingar um notkun forritsins OsmAnd sendir almennar upplýsingar um þá hluta forritsins sem þó opnar. Við söfnum ekki neinum gögnum um staðsetningar eða hegðun notenda, né heldur um neitt af því sem notendur setja inn til leitar, niðurhald eða skoðunar. @@ -3904,7 +3902,6 @@ Ljósmyndir eru í boði frá opna gagnaverkefninu OpenPlaceReviews.org. Til að geta sent inn myndir þarftu að skrá þig á vefsvæðinu þeirra. Gera athugasemd við OSM-minnispunkt \"Rekjanlegt\" þýðir að ferillinn birtist ekki á neinum opinberum listum, en meðhöndlaðir ferilpunktar með tímamerkjum úr ferlinum (sem ekki er hægt að tengja beint við þig) munu birtast í gögnum sem eru sótt í gegnum opinbert GPS API-forritsviðmót. - Þú getur notað hæðargögn til útreikninga á hækkun/lækkun í ferðunum þínum OsmAnd birtir ljósmyndir frá ýmsum þjónustum: \nOpenPlaceReviews - ljósmyndir POI-merkisstaða; \nMapillary - myndefni í götuhæð; diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index e8a03879ba..18e12db1ea 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -791,7 +791,6 @@ \n - Allineamento della mappa in base alla direzione o alla bussola \n - Indicazioni di corsia, indicazione del limite di velocità, voci registrate e dal testo-alla-voce \n - Blocca la posizione sulle strade durante la navigazione. Blocca sulle strade Evita le autostrade La destinazione intermedia %1$s è troppo lontana dalla strada più vicina. @@ -1981,7 +1980,6 @@ Sorabo superiore Oggetti sopra il terreno Percorso più efficiente rispetto ai consumi - Utilizza la via migliore rispetto ai consumi (di solito la più breve). Sei sicuro di voler sostituire il preferito %1$s? Cambia Inizia @@ -3910,7 +3908,6 @@ Scegli la foto %1$s * %2$s Tedesco (informale) - Puoi utililizzare i dati dell\'altitudine per valutare la Salita/Discesa del tuo percorso Ultraleggeri Spezza dopo Aggiungi un nuovo segmento diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index d91880e6d1..b2c39e5eef 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -47,7 +47,6 @@ ללא כבישים סלולים תקריב המפה בהתאמה אוטומטית למהירות (בעוד שהמפה מסתנכרנת עם המיקום הנוכחי). שינוי תקריב אוטומטי במפה - הצמדת המיקום לדרכים במהלך הניווט. הצמדה לדרך OsmAnd הנו יישומון צפייה במפות וניווט עם מפות מקוונות ובלתי מקוונות של OSM OsmAnd הנו יישום ניווט בקוד פתוח עבור מפות מקוונות ובלתי מקוונות @@ -2023,7 +2022,6 @@ לעדכן את כל המפות כעת? מחיקת כל האריחים דרך חסכונית בדלק - שימוש בדרך חסכונית בדלק (בד״כ קצרה יותר). להחליף את המועדף %1$s? עצמים מעל הקרקע שינוי @@ -3920,7 +3918,6 @@ בחירת תמונה גרמנית (עממית) ‏%1$s‏ * %2$s - אפשר להשתמש בנתוני רום לצורך חישוב עליה/ירידה במהלך הטיול כלי טיס קל צירוף מקטעים לפצל לפני diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index 3f502d18ce..5b24b99331 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -687,7 +687,6 @@ POIの更新は利用できません 方向が全く検出できない場合電子コンパスを使用します 電子コンパスを使用 高速道路を使わない - 有効化でナビゲーション中は現在位置が道路から外れないようになります 道路に合わせる OsmAnd Maps & Navigation OSMオフライン&オンライン両対応、グローバルモバイルマップ&ナビゲーション @@ -2097,7 +2096,6 @@ POIの更新は利用できません 記録 データなし 燃費を抑えたルート - 燃費を抑えることを重視した(通常より短い)ルートを優先します。 すべてのタイルを消去 オープンロケーションコード(OLC) OLCの値が正しくありません diff --git a/OsmAnd/res/values-ka/strings.xml b/OsmAnd/res/values-ka/strings.xml index 9db9407028..786b5de97c 100644 --- a/OsmAnd/res/values-ka/strings.xml +++ b/OsmAnd/res/values-ka/strings.xml @@ -812,7 +812,6 @@ რესტორნები ღირსშესანიშნაობები მოტოციკლეტის გზებისათვის თავის არიდება - ნავიგაციისას პიზიციის გზებისათვის მიბმა. გზისთვის მიბმა OsmAnd არის ნავიგაციის აპლიკაცია ღია წყაროთი გათიშული და ონლაინ რუკების მხარდაჭერით შუალედური დანიშნულების პუნქტი diff --git a/OsmAnd/res/values-ko/strings.xml b/OsmAnd/res/values-ko/strings.xml index 6fd3bcab02..6b04c0609b 100644 --- a/OsmAnd/res/values-ko/strings.xml +++ b/OsmAnd/res/values-ko/strings.xml @@ -888,7 +888,6 @@ GPS로 진행방향이 탐지되지 않을 때 나침반을 사용 나침반 사용 전용도로 회피 - 운행하는 동안 차량을 도로에 밀착시킴 도로에 밀착 OsmAnd 지도 및 내비게이션 글로벌 모바일 맵 뷰어 및 오프라인 및 온라인 OSM 지도를 위한 운행 diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 3c683d41cf..744312bd1d 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -774,7 +774,6 @@ Atvaizdavimo stilius OsmAnd - atviro kodo navigacijos programa su interneto/parsiųstais žemėlapius Vengti greitkelių - Poziciją rodyti ant kelių kai naviguojama. Rodyti ant kelio OsmAnd (OSM Automated Navigation Directions) \n @@ -1949,7 +1948,6 @@ Tai yra puikus būdas paremti OsmAnd ir OSM, jei jie jums patinka. bendrinta iš OsmAnd Ar norite atnaujinti visus žemėlapius? Taupus kelias - Važiuoti taupiuoju keliu (paprastai trumpesnis). Antžeminiai objektai Pakeisti Pradėti diff --git a/OsmAnd/res/values-lv/strings.xml b/OsmAnd/res/values-lv/strings.xml index f2a97faf62..c80dfec131 100644 --- a/OsmAnd/res/values-lv/strings.xml +++ b/OsmAnd/res/values-lv/strings.xml @@ -789,7 +789,6 @@ Restorāni Apskates vietas Izvairīties no automaģistrālēm - Navigācijas laikā tuvināt ceļam Tuvināt ceļam OsmAnd ir atvērtā koda navigācijas lietotne bezsaistes un tiešsaistes kartēm OsmAnd (OSM Automated Navigation Directions) @@ -1948,7 +1947,6 @@ failu(s)? Vai vēlaties atjaunot visas kartes? Iztīrīt bilžu kešatmiņu Ekonomiskais maršruts - Lietot ekonomisko maršrutu (parasti īsākais). Vai nomainīt izlases vienību %1$s? Virszemes objektus Mainīt diff --git a/OsmAnd/res/values-ml/strings.xml b/OsmAnd/res/values-ml/strings.xml index 6d457adc68..9b57d104e0 100644 --- a/OsmAnd/res/values-ml/strings.xml +++ b/OsmAnd/res/values-ml/strings.xml @@ -505,7 +505,6 @@ %1$s മേടിക്കുക "മൈല്‍/മീറ്റര്‍ " "മൈലേജ് കൂടുതലുള്ള വഴി " - മൈലേജ് കൂടുതലുള്ള വഴി ഉപയോഗിക്കുക തുടങ്ങുക തെരച്ചിലിലോട്ട് തിരിച്ച് പോവുക തെരഞ്ഞെടുത്തവ ഹിസ്റ്ററിയില്‍ നിന്നും നീക്കട്ടെ? @@ -978,7 +977,6 @@ കഷണങ്ങള്‍ "ചേഞ്ച്സെറ്റ് അടയ്ക്കുക" മുന്നറിയിപ്പുകള്‍ കാണിക്കുക… - റോഡില്‍ തന്നെ നിന്ന് വഴികാട്ടുക "പാര്‍ക്കിങ്ങ് ആയി രേഖപ്പെടുത്തുക " "പുതിയതായുള്ള സവിശേഷതകള്‍ " സ്കേല്‍ കാണിക്കുക diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index 7c3e0695ce..df0b7415ea 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -41,7 +41,6 @@ Ingen motorveier Zoomnivå i henhold til hastigheten din (mens kartet er synkronisert med gjeldende posisjon). Auto-zoom kart - Hold posisjon på veien under navigering. Hold på vei Global mobilkartvisning & navigering for offline og nettbaserte OSM-kart Global mobilkartvisning & navigering for offline og nettbaserte OSM-kart @@ -1558,7 +1557,6 @@ Er du sikker på at du vil erstatte favoritt %1$s\? Kom i gang Drivstoff-effektiv vei - Bruk drivstoffeffektiv vei (vanligvis kortere). Utløper (minutter) Utløper (minutter): %1$s Aktuelle spor @@ -3846,7 +3844,6 @@ \nOpenPlaceReviews - interessepunktbilder; \nMapillary - bilder på gatenivå; \nWeb / Wikimedia - interessepunktbilder i henhold til OpenStreetMap-data. - Du kan bruke høydedata for å ta hensyn til stigning/nedstigning på turen din Småfly %1$s * %2$s Tysk (uformell) diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 6d4c127831..010ffd760d 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -790,7 +790,6 @@ \n - Rijstrookindicatie, snelheidswaarschuwingen en stembegeleiding met opgenomen- en TTS-stemmen \n Geen snelwegen - Positie op de weg uitlijnen tijdens navigatie. Positie op de weg uitlijnen Tussenpunt %1$s te ver van dichtstbijzijnde weg. Je bent aangekomen op je Tussenpunt @@ -1982,7 +1981,6 @@ Wijzig Aan de slag Economische route - Economische route gebruiken (meestal korter). Wil je Favoriet %1$s inderdaad vervangen\? Nu alle kaarten updaten\? Mijl/meter @@ -3941,7 +3939,6 @@ \nOpenPlaceReviews - foto\'s van interessepunten; \nMapillary - foto\'s vanop straatniveau; \nWikimedia / het Web - foto\'s van interessepunten zoals gelinkt in OpenStreetMap. - Je kan hoogtedata gebruiken om het hoogteverschil van je route te berekenen • Een optie is toegevoegd om alle data te exporten, waaronder instellingen, andere bronnen en mijn plaatsen \n \n • Plan een route: diagram met individuele segmenten is toegevoegd, verschillende segmenten kunnen nu gemaakt en aangepast worden diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index dc7dcf24c9..72a8a5cf93 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -796,7 +796,6 @@ \nOsmAnd jest aktywnie rozwijany i dalszy rozwój jest uzależniony od wkładu pieniężnego na finansowanie rozwoju i testowania nowych funkcjonalności. Proszę rozważyć zakup OsmAnd+, lub finansowanie konkretnych nowych funkcji lub dokonania ogólnej darowizny na https://osmand.net. OsmAnd to aplikacja open source do nawigacji obsługująca mapy offline i online Unikaj autostrad - Przyciąga położenie do dróg podczas nawigacji. Przyciąganie do drogi Informacja o dniu/nocy Atrybuty renderowania @@ -1993,7 +1992,6 @@ Zmień Rozpocznij Ekonomiczna trasa - Użyj trasy oszczędzającej paliwo (zwykle najkrótszej). Zastąpić ulubiony punkt %1$s? Pomiń pobieranie map Otrzymuj wskazówki dojazdu i odkrywaj nowe miejsca bez połączenia z Internetem @@ -3920,7 +3918,6 @@ Niemiecki (styl potoczny) \"Publiczny\" oznacza, że ślad jest pokazywany publicznie w śladach GPS i na publicznych listach śladów GPS oraz na publicznej liście śladów z surowymi znacznikami czasowymi. Dane obsługiwane przez API nie odnoszą się do strony śladów. Znaczniki czasu punktów śladowych nie są dostępne za pośrednictwem publicznego API GPS, a punkty śladowe nie są uporządkowane chronologicznie. Lekki samolot - Możesz użyć danych wysokości, aby uwzględnić wzniesienie / zejście podczas podróży Połącz segmenty Podziel przed Podziel po diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index afd52545aa..70e2422e87 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -578,7 +578,6 @@ De: Perfil predefinido Configurações de exibição e navegação de mapa são gravadas por perfil de uso. Defina seu perfil padrão aqui. - Ajustar posição às vias próximas durante a navegação. Ajustar com a via OsmAnd é um aplicativo de navegação de código aberto para mapas off-line e on-line OsmAnd (Direções de Navegação Automatizada do OSM) @@ -1876,7 +1875,6 @@ Desabilitar recálculo de rota se só estiver se movendo na direção oposta. Siga-nos Via mais econômica - Utilizar caminho econômico (geralmente mais curto). Editar categorias Subcategorias Categorias selecionadas @@ -3914,7 +3912,6 @@ Selecione a foto %1$s * %2$s Alemão (casual) - Você pode usar dados de elevação para contabilizar a subida/descida de sua viagem Avião leve "• Adicionada opção para exportar e importar todos os dados, incluindo configurações, recursos, meus lugares \n diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 5b067eeb11..b6456d3df6 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -763,7 +763,6 @@ Mostrar alertas… Configure avisos de trânsito (limites de velocidade, paragens forçadas, redutores de velocidade, túneis), avisos de radares de velocidade e informações da faixa. Sem autoestradas - Encaixe posição de estradas durante a navegação. Ajustar à estrada Visualização e navegação móvel de mapas globais do OSM offline e online OsmAnd é uma aplicação de navegação de código aberto para mapas off-line e on-line @@ -2101,7 +2100,6 @@ Atualizar todos os mapas agora\? Limpar todas as telhas Percurso económico - Utilizar percurso económico (geralmente mais curto). Tem a certeza que quer substituir o favorito %1$s\? Objetos à superfície Começar @@ -3919,7 +3917,6 @@ Mude para usar dev.openstreetmap.org ao invés de openstreetmap.org para testar enviar uma OSM Nota / POI / GPX. %1$s * %2$s Alemão (casual) - Pode usar dados de elevação para representar a subida / descida da sua viagem Aeronaves ligeiras Unir segmentos Dividir antes diff --git a/OsmAnd/res/values-ro/strings.xml b/OsmAnd/res/values-ro/strings.xml index 003d95f5e0..22bec3c3c9 100644 --- a/OsmAnd/res/values-ro/strings.xml +++ b/OsmAnd/res/values-ro/strings.xml @@ -46,7 +46,6 @@ Evită autostrăzile Auto zoom hartă funcție de viteză (când harta e sincronizată cu poziția curentă) Auto zoom hartă - Menține poziția pe drum în timpul navigării Poziționează pe drum OsmAnd este o aplicație open source pentru navigare cu hărți offline și online @@ -2276,7 +2275,6 @@ Permiteți autostrăzile. Introduceți orașul, adresa, numele POI Abonament perceput pe lună. Anulați-l pe Google Play în orice moment. - Utilizați un mod eficient de combustibil (de obicei mai scurt). Negru Lansează Pornesc navigarea de-a lungul traseului\? diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 4836ea274c..4d3589ad6f 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1155,7 +1155,6 @@ \n — подсказки полосы движения, отображение ограничения скорости, предварительно записанные и синтезированные голосовые подсказки \n Без автомагистралей - Привязывать позицию к дороге во время навигации. Привязка к дороге Промежуточный пункт %1$s слишком далеко от ближайшей дороги. Вы прибыли в промежуточный пункт @@ -2198,7 +2197,6 @@ Обновить все карты сейчас? Удалить из кеша Снижать расход топлива - Использование топливо-сберегающего пути (обычно короче). Вы уверены, что хотите заменить избранные %1$s\? Изменить Начать @@ -3938,7 +3936,6 @@ Выбор папки Выберите папку или добавьте новую Время голосовых подсказок - Можно использовать данные о высотах для учёта подъёма/спуска поездки Предпочитать пешеходные маршруты Подтип Введите параметр diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 020b6b3915..617e5e6fa3 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -356,7 +356,6 @@ Peruna autostrada Ismanniamentu mapa relativu a sa lestresa (si sa mapa est sincronizzata cun sa positzione currente). Ismanniamentu automàticu mapa - Arrea sa positzione in subra de sos caminos durante sa navigatzione. Arrea in subra de sos caminos Sos annùntzios vocales ponent sa mùsica in pàusa. Firma sa mùsica @@ -1989,7 +1988,6 @@ Chirca avantzada cun coordinadas %1$s firmadas in antis Àndala prus de atòliu pro sos consumos - Issèbera s\'àndala prus de atòliu pro sos consumos (sa prus curtza, de sòlitu). Seguru ses de bòlere sostituire su preferidu %1$s? Ogetos subra de terra Càmbia @@ -3916,7 +3914,6 @@ Ischerta un\'immàgine %1$s * %2$s Tedescu (informale) - Podes impreare sos datos de s\'artària pro valutare s\'Artziada / Achirrada pro su biàgiu tuo Aèreu lèbiu Auni sos segmentos Iscroba in antis de diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index ada5be40c9..1473a555c3 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -32,7 +32,6 @@ Palivo Pridať značku Pokročilý režim… - Prichytiť pozíciu k cestám počas navigácie. Prichytiť k ceste Žiadne diaľnice Konfigurovať obrazovku @@ -1989,7 +1988,6 @@ Zmeniť Začať Ekonomická trasa - Použiť ekonomickú trasu (obyčajne kratšia). Naozaj chcete nahradiť Obľúbený bod %1$s? Preskočiť sťahovanie máp Nemáte nainštalovanú žiadnu offline mapu. Môžete vybrať mapu zo zoznamu alebo stiahnuť mapy neskôr cez \"Menu - %1$s\". @@ -3914,7 +3912,6 @@ \"Súkromná\" znamená, že trasa sa nezobrazí vo verejných zoznamoch, ale body trasy z nej v budú dostupné v neusporiadanom poradí cez verejné GPS rozhranie (API) bez časových pečiatok. \"Identifikovateľná\" znamená, že trasa sa zobrazí verejne vo vašich GPS stopách a vo verejných zoznamoch GPS stôp, tzn. iní používatelia budú môcť stiahnuť nespracovanú trasu a prepojiť su s vašim používateľkým menom. Verejné body trasy s časovými pečiatkami poskytované cez GPS rozhranie (API) budú odkazovať na vašu pôvodnú stránku s trasou. \"Sledovateľná\" znamená, že trasa sa nezobrazí vo verejných zoznamoch, ale spracované body trasy s časovými pečiatkami (ktoré nie je možné spojiť s vami), budú dostupné na stiahnutie cez verejné GPS rozhranie (API). - Údaje o nadmorskej výške môžete použiť na zaznamenanie stúpania / klesania vašej cesty Ľahké lietadlo Prepojte segmenty Rozdeliť predtým diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml index b453cd4b40..ad00a45f32 100644 --- a/OsmAnd/res/values-sl/strings.xml +++ b/OsmAnd/res/values-sl/strings.xml @@ -279,7 +279,6 @@ Gorivo Približevanje zemljevida glede na hitrost vožnje (zemljevid se usklajuje s trenutnim mestom). Samodejna povečava zemljevida - Med navigacijo pripni položaj na ceste. Pripni na cesto OsmAnd je odprtokodni program za navigacijo z uporabo shranjenih ali spletnih zemljevidov OsmAnd je odprtokodni program za navigacijo z uporabo shranjenih ali spletnih zemljevidov @@ -1985,7 +1984,6 @@ %1$s se zaustavi pred Ne izriši nadzemnih zgradb Pot z najmanjšo porabo goriva - Prednostno izberi pot z najmanjšo porabo goriva (običajno najkrajša). Ali ste prepričani, da želite zamenjati priljubljeno točko %1$s? Spremeni Kako začeti ... diff --git a/OsmAnd/res/values-sr/strings.xml b/OsmAnd/res/values-sr/strings.xml index e7a1151b43..70463bce02 100644 --- a/OsmAnd/res/values-sr/strings.xml +++ b/OsmAnd/res/values-sr/strings.xml @@ -1030,7 +1030,6 @@ Освежити све карте сада? Очисти све плочице Пут који штеди гориво - Користи пут који штеди гориво (обично краћи). Да ли сте сигурни да желите заменити Омиљени %1$s? Надземне грађевине Измени @@ -1897,7 +1896,6 @@ Карта увезена Неповезан на бежичну мрежу. Искористите тренутну интернет везу за преузимање? Аутоматско зумирање карте - Прилепи позицију за путеве приликом навођења. Прилепи на пут Тачка поласка је превише далеко од најближег пута. Полигоне @@ -3916,7 +3914,6 @@ Употреби dev.openstreetmap.org %1$s * %2$s Немачки (говорни) - Податке о надморској висини можете користити за разматрање успона / спуштања за ваше путовање Лака летелица Споји сегменте Подели пре diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index 17572bce1a..6142457817 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -21,7 +21,6 @@ Undvik motorvägar Zooma in/ut automatiskt på kartan beroende på din hastighet (när kartan är synkroniserad med aktuell position). Automatisk kartzoomning - Fäst positionen på vägen under navigering. Fäst på vägen Skapa POI-filter Transportsätt: @@ -1953,7 +1952,6 @@ Om du tycker om OsmAnd och OSM och vill stödja dem så är detta ett utmärkt s Tillåt platsåtkomst Uppdatera alla kartor nu\? Bränslesnål väg - Använd bränslesnål väg (oftast kortare). Ändra Kom igång Är du säker på att du vill ersätta favoriten %1$s? @@ -2962,7 +2960,6 @@ Vänligen tillhandahåll fullständig kod \nOpenPlaceReviews - Foton av sevärdheter; \nMapillary - Bilder på gatunivå; \nWeb/Wikimedia - Foton av sevärdheter enligt OpenStreetMap-data. - Du kan använda höjddata för att ta hänsyn till upp- / nedstigning på din resa Sammanslå segment Dela innan Dela efter diff --git a/OsmAnd/res/values-ta/strings.xml b/OsmAnd/res/values-ta/strings.xml index 8b2762d85e..0e623cd79a 100644 --- a/OsmAnd/res/values-ta/strings.xml +++ b/OsmAnd/res/values-ta/strings.xml @@ -389,7 +389,6 @@ இப்போது எல்லா வரைபடங்களையும் புதுப்பிக்குமா\? அனைத்து ஓலைகளையும் அழி எரிபொருள்-திறனுள்ள வழி - எரிபொருள்-திறனுள்ள வழி (வழக்கமாக குறுகியது) பயன்படுத்தவும். %1$s விருப்பத்தை நிச்சயமாக மாற்ற விரும்புகிறீர்களா \? நிலப்பரப்பு பொருட்கள் மாற்றம் diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index 1f9d208ac4..69509b9fd9 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -154,7 +154,6 @@ Yollar-sadece haritalar Trafik uyarıları (hız sınırları, zorunlu duruşlar, hız tümsekleri, tüneller), hız kamerası uyarıları ve şerit bilgilerini ayarlayın. Başka bir başlık algılanmadığında pusulayı kullan. - Navigasyon sırasında konumu yola tuttur. Yola tuttur OsmAnd (OSM Automated Navigation Directions) \n @@ -1962,7 +1961,6 @@ Al Mil/metre Yakıt-tasarruflu yol - Yakıt tasarruflu yolu kullan (çoğunlukla daha kısadır). Yeni klasör ekle Nokta(lar) silindi. Takip et @@ -3920,7 +3918,6 @@ Resim yüklenemiyor, lütfen daha sonra tekrar deneyin Resim seç %1$s * %2$s - Yolculuğunuzun yükselme/alçalma değerlerini hesaplamak için yükseklik verilerini kullanabilirsiniz Hafif uçak Bölümleri birleştir Önce böl diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 470ebc3850..11c919d2d6 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -880,7 +880,6 @@ Швидка побудова маршруту (можливо неоптимальна) Налаштування попередження про дорожній рух (обмеження швидкості, вимушені зупинки, штучні нерівності, тунелі), попередження про камери контролю швидкості, відомості про смуги руху. Уник. автомагістралей - Прив\'язуватися до доріг під час навігації. Прив’язуватися до доріг Перегляд та навігація в автономному та мережевому режимах мапами OSM Перегляд та навігація в автономному та мережевому режимах мапами ОСМ @@ -2049,7 +2048,6 @@ Оновити усі мапи зараз? Очистити кеш мережевих мап Паливно-ефективний шлях - Розраховувати паливо-ощадний маршрут (зазвичай найкоротший). Ви впевнені, що хочете замінити закладку %1$s? Надземні об’єкти Змінити @@ -3918,7 +3916,6 @@ Вибрати зображення %1$s * %2$s Німецька (неформальна) - Ви можете використовувати дані про висоту, щоб врахувати підйом/спуск у вашої подорожі Легкий літак Об’єднати сегменти Розділити перед diff --git a/OsmAnd/res/values-zh-rCN/strings.xml b/OsmAnd/res/values-zh-rCN/strings.xml index 9550f1fb9c..bed1fe7dcc 100644 --- a/OsmAnd/res/values-zh-rCN/strings.xml +++ b/OsmAnd/res/values-zh-rCN/strings.xml @@ -1308,7 +1308,6 @@ 距离已修正 这里没有照片。 节油道路 - 使用节油道路(通常更短)。 快捷操作 显示全部 全球移动地图浏览,以及使用离线和在线 OSM 地图进行导航 @@ -1931,8 +1930,7 @@ 配置交通警告(车速限制、强制停止、减速带),测速相机警告和车道信息 没有检测到朝向的时候使用罗盘。 根据你的速度(地图与当前的位置同步)自动缩放地图 - 在导航过程中对齐道路的位置。 - " OsmAnd (OSM Automated Navigation Directions) + " OsmAnd (OSM Automated Navigation Directions) \n \n OsmAnd 是开放源代码的导航应用程序,访问各式各样的全球性 OpenStreetMap(简称 OSM 开放街道地图)数据。所有数据(矢量图或地图图砖)可存放于手机的记忆卡上,可用作离线与在线导航,包含转弯提醒 \n (turn by turn) 语音导航。一些主要功能: - 完整的离线功能(存放下载的矢量图或地图图砖于设备存储器) - 提供细致的全球离线矢量数据 - 直接从应用程序下载各国或区域数据 - 可叠加不同的多种地图层于自订的透明度,如 GPX 或导航轨迹、兴趣点、我的收藏、公共运输站 - 离线查寻地址、场所 (POI) - 中程距离的离线使用路线 - 汽车、自行车、步行模式有下列选项: - 可选择自动日夜模式切换 - 可依据速度选择地图缩放 - 可依据罗盘或运动方向选择地图选择对齐方式 - 可选的车道引导、速限显示、使用真人语音或 TTS 语音 OsmAnd 免费版限制: - 地图下载数量 - 无法使用离线维基百科的 POI OsmAnd 正在积极开发我们的项目,并且它的更进一步发展依赖于提供资金的捐助,用以资助发展和新功能的测试。请考虑购买 OsmAnd+,或资助特定的新功能或在 osmand.net 网站上做一些一般捐助。 " diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 388b13d671..292ff3fdb6 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -43,7 +43,6 @@ 避開高速公路 依據您的速度去縮放級別(當地圖與目前位置同步時)。 自動縮放地圖 - 導航過程中對齊道路位置。 對齊道路 離線與線上的 OSM 地圖用於全球行動地圖檢視與導航 OsmAnd (OSM Automated Navigation Directions) @@ -1984,7 +1983,6 @@ %1$s 之前停止 地上的物件 省油的方式 - 使用省油的方式 (通常路途較短)。 您確定想要替換我的收藏 %1$s 嗎? 更換 開始 @@ -3912,7 +3910,6 @@ 選取圖片 德語(非正式) %1$s * %2$s - 您可以將海拔資料用來說明您旅程的上升與下降 輕型飛機 加入線段 分離前 From 2bf1c899fd8eb0d368c093797bb87a41fc4cc6d1 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Sun, 14 Feb 2021 11:05:48 +0100 Subject: [PATCH 36/46] Update GPXUtilities.java don't write too much noisy data so it's better handled in graphs & other programs - https://github.com/osmandapp/OsmAnd/issues/10864 --- OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index c7b1ebd63b..9f5b954015 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -60,7 +60,8 @@ public class GPXUtilities { private final static NumberFormat latLonFormat = new DecimalFormat("0.00#####", new DecimalFormatSymbols( new Locale("EN", "US"))); - private final static NumberFormat decimalFormat = new DecimalFormat("#.###", new DecimalFormatSymbols( + // speed, ele, hdop + private final static NumberFormat decimalFormat = new DecimalFormat("#.#", new DecimalFormatSymbols( new Locale("EN", "US"))); public enum GPXColor { @@ -2594,4 +2595,4 @@ public class GPXUtilities { to.error = from.error; } } -} \ No newline at end of file +} From e1b7175919a1d0d63a36b2ab790ae3a48d6dffc3 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sun, 14 Feb 2021 12:55:50 +0200 Subject: [PATCH 37/46] Small fixes --- .../src/net/osmand/plus/AppInitializer.java | 2 +- .../net/osmand/plus/OsmandApplication.java | 31 ++--------- .../net/osmand/plus/helpers/LocaleHelper.java | 55 +++++++++++++------ 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 065c7aba2e..819590a516 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -514,7 +514,7 @@ public class AppInitializer implements IProgress { return null; } }); - app.regions.setLocale(app.getLanguage(), app.getCountry()); + app.regions.setLocale(app.getLanguage(), app.getLocaleHelper().getCountry()); } diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 83386b481b..165a9a9c07 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -127,6 +127,7 @@ public class OsmandApplication extends MultiDexApplication { private final SQLiteAPI sqliteAPI = new SQLiteAPIImpl(this); private final OsmAndTaskManager taskManager = new OsmAndTaskManager(this); private final UiUtilities iconsCache = new UiUtilities(this); + private final LocaleHelper localeHelper = new LocaleHelper(this); // start variables ResourceManager resourceManager; @@ -166,7 +167,6 @@ public class OsmandApplication extends MultiDexApplication { OprAuthHelper oprAuthHelper; MeasurementEditingContext measurementEditingContext; OnlineRoutingHelper onlineRoutingHelper; - LocaleHelper localeHelper = new LocaleHelper(this); private Map customRoutingConfigs = new ConcurrentHashMap<>(); private File externalStorageDirectory; @@ -419,7 +419,7 @@ public class OsmandApplication extends MultiDexApplication { } @Override - public void onConfigurationChanged(Configuration newConfig) { + public void onConfigurationChanged(@NonNull Configuration newConfig) { Locale preferredLocale = localeHelper.getPreferredLocale(); if (preferredLocale != null && !newConfig.locale.getLanguage().equals(preferredLocale.getLanguage())) { super.onConfigurationChanged(newConfig); @@ -434,12 +434,10 @@ public class OsmandApplication extends MultiDexApplication { } } - public static final int PROGRESS_DIALOG = 5; - public void checkApplicationIsBeingInitialized(Activity activity, AppInitializeListener listener) { // start application if it was previously closed startApplication(); - if(listener != null) { + if (listener != null) { appInitializer.addListener(listener); } } @@ -812,29 +810,8 @@ public class OsmandApplication extends MultiDexApplication { return s; } - public String getCountry() { - String country; - Locale preferredLocale = localeHelper.getPreferredLocale(); - if (preferredLocale != null) { - country = preferredLocale.getCountry(); - } else { - country = Locale.getDefault().getCountry(); - } - return country; - } - public String getLanguage() { - String lang; - Locale preferredLocale = localeHelper.getPreferredLocale(); - if (preferredLocale != null) { - lang = preferredLocale.getLanguage(); - } else { - lang = Locale.getDefault().getLanguage(); - } - if (lang != null && lang.length() > 3) { - lang = lang.substring(0, 2).toLowerCase(); - } - return lang; + return localeHelper.getLanguage(); } @Override diff --git a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java index a0bf32fb8e..a0facaf61c 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java @@ -12,14 +12,14 @@ import java.util.Locale; public class LocaleHelper implements StateChangedListener { - private Resources localizedResources; - private Locale preferredLocale; + private final OsmandApplication app; + private Locale defaultLocale; + private Locale preferredLocale; + private Resources localizedResources; private boolean needRestart = false; - private OsmandApplication app; - public LocaleHelper(OsmandApplication app) { this.app = app; } @@ -83,6 +83,18 @@ public class LocaleHelper implements StateChangedListener { } } + public Resources getLocalizedResources() { + return localizedResources; + } + + public Locale getPreferredLocale() { + return preferredLocale; + } + + public Locale getDefaultLocale() { + return defaultLocale; + } + public void listenLocaleChanges() { app.getSettings().PREFERRED_LOCALE.addListener(this); } @@ -99,21 +111,32 @@ public class LocaleHelper implements StateChangedListener { this.needRestart = needRestart; } - public Resources getLocalizedResources() { - return localizedResources; - } - - public Locale getPreferredLocale() { - return preferredLocale; - } - - public Locale getDefaultLocale() { - return defaultLocale; - } - @Override public void stateChanged(String change) { needRestart = true; checkPreferredLocale(); } + + public String getCountry() { + String country; + if (preferredLocale != null) { + country = preferredLocale.getCountry(); + } else { + country = Locale.getDefault().getCountry(); + } + return country; + } + + public String getLanguage() { + String lang; + if (preferredLocale != null) { + lang = preferredLocale.getLanguage(); + } else { + lang = Locale.getDefault().getLanguage(); + } + if (lang != null && lang.length() > 3) { + lang = lang.substring(0, 2).toLowerCase(); + } + return lang; + } } \ No newline at end of file From de86d1c24e59e1e569433f0e31f2282d563e1277 Mon Sep 17 00:00:00 2001 From: cepprice Date: Mon, 15 Feb 2021 13:15:27 +0500 Subject: [PATCH 38/46] Small refactoring --- .../net/osmand/plus/CustomOsmandPlugin.java | 2 +- .../net/osmand/plus/helpers/LocaleHelper.java | 26 +-------------- .../plus/importfiles/SettingsImportTask.java | 6 ++-- .../backend/backup/SettingsHelper.java | 33 +++++++++++-------- .../fragments/ImportCompleteFragment.java | 11 +++++-- .../fragments/ImportSettingsFragment.java | 4 +-- 6 files changed, 35 insertions(+), 47 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java index 9f3003e925..8c8a1dafa0 100644 --- a/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/CustomOsmandPlugin.java @@ -237,7 +237,7 @@ public class CustomOsmandPlugin extends OsmandPlugin { final SettingsHelper.SettingsImportListener importListener = new SettingsHelper.SettingsImportListener() { @Override - public void onSettingsImportFinished(boolean succeed, @NonNull List items) { + public void onSettingsImportFinished(boolean succeed, boolean needRestart, @NonNull List items) { if (AndroidUtils.isActivityNotDestroyed(activity)) { progress.dismiss(); } diff --git a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java index a0facaf61c..bdacd02c62 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/LocaleHelper.java @@ -10,7 +10,7 @@ import net.osmand.util.Algorithms; import java.util.Locale; -public class LocaleHelper implements StateChangedListener { +public class LocaleHelper { private final OsmandApplication app; @@ -18,8 +18,6 @@ public class LocaleHelper implements StateChangedListener { private Locale preferredLocale; private Resources localizedResources; - private boolean needRestart = false; - public LocaleHelper(OsmandApplication app) { this.app = app; } @@ -95,28 +93,6 @@ public class LocaleHelper implements StateChangedListener { return defaultLocale; } - public void listenLocaleChanges() { - app.getSettings().PREFERRED_LOCALE.addListener(this); - } - - public void stopListeningLocaleChanges() { - app.getSettings().PREFERRED_LOCALE.removeListener(this); - } - - public boolean needRestart() { - return needRestart; - } - - public void setNeedRestart(boolean needRestart) { - this.needRestart = needRestart; - } - - @Override - public void stateChanged(String change) { - needRestart = true; - checkPreferredLocale(); - } - public String getCountry() { String country; if (preferredLocale != null) { diff --git a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java index 1f886a23bb..a80ed45126 100644 --- a/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java +++ b/OsmAnd/src/net/osmand/plus/importfiles/SettingsImportTask.java @@ -134,7 +134,7 @@ class SettingsImportTask extends BaseLoadAsyncTask { private SettingsImportListener getImportListener(final File file) { return new SettingsImportListener() { @Override - public void onSettingsImportFinished(boolean succeed, @NonNull List items) { + public void onSettingsImportFinished(boolean succeed, boolean needRestart, @NonNull List items) { if (succeed) { app.getRendererRegistry().updateExternalRenderers(); app.getPoiFilters().loadSelectedPoiFilters(); @@ -150,7 +150,7 @@ class SettingsImportTask extends BaseLoadAsyncTask { } if (!silentImport && file != null && activity != null) { FragmentManager fm = activity.getSupportFragmentManager(); - ImportCompleteFragment.showInstance(fm, items, file.getName()); + ImportCompleteFragment.showInstance(fm, items, file.getName(), needRestart); } } } @@ -174,7 +174,7 @@ class SettingsImportTask extends BaseLoadAsyncTask { final SettingsImportListener importListener = new SettingsImportListener() { @Override - public void onSettingsImportFinished(boolean succeed, @NonNull List items) { + public void onSettingsImportFinished(boolean succeed, boolean needRestart, @NonNull List items) { FragmentActivity activity = activityRef.get(); if (progress != null && AndroidUtils.isActivityNotDestroyed(activity)) { progress.dismiss(); 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 2e548f0c2b..4204fded0b 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/SettingsHelper.java @@ -11,6 +11,7 @@ import net.osmand.Collator; import net.osmand.IndexConstants; import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; +import net.osmand.StateChangedListener; import net.osmand.data.LatLon; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager; @@ -111,7 +112,7 @@ public class SettingsHelper { private Map exportAsyncTasks = new HashMap<>(); public interface SettingsImportListener { - void onSettingsImportFinished(boolean succeed, @NonNull List items); + void onSettingsImportFinished(boolean succeed, boolean needRestart, @NonNull List items); } public interface SettingsCollectListener { @@ -173,7 +174,7 @@ public class SettingsHelper { } } - private void finishImport(@Nullable SettingsImportListener listener, boolean success, @NonNull List items) { + private void finishImport(@Nullable SettingsImportListener listener, boolean success, @NonNull List items, boolean needRestart) { importTask = null; List warnings = new ArrayList<>(); for (SettingsItem item : items) { @@ -183,18 +184,19 @@ public class SettingsHelper { app.showToastMessage(AndroidUtils.formatWarnings(warnings).toString()); } if (listener != null) { - listener.onSettingsImportFinished(success, items); + listener.onSettingsImportFinished(success, needRestart, items); } } @SuppressLint("StaticFieldLeak") private class ImportItemsAsyncTask extends AsyncTask { - private SettingsImporter importer; - private File file; - private SettingsImportListener listener; - private List items; - private LocaleHelper localeHelper; + private final SettingsImporter importer; + private final File file; + private final SettingsImportListener listener; + private final List items; + private final StateChangedListener localeListener; + private boolean needRestart = false; ImportItemsAsyncTask(@NonNull File file, @Nullable SettingsImportListener listener, @@ -203,12 +205,17 @@ public class SettingsHelper { this.file = file; this.listener = listener; this.items = items; - localeHelper = app.getLocaleHelper(); + localeListener = new StateChangedListener() { + @Override + public void stateChanged(String change) { + needRestart = true; + } + }; } @Override protected void onPreExecute() { - localeHelper.listenLocaleChanges(); + app.getSettings().PREFERRED_LOCALE.addListener(localeListener); } @Override @@ -226,8 +233,8 @@ public class SettingsHelper { @Override protected void onPostExecute(Boolean success) { - localeHelper.stopListeningLocaleChanges(); - finishImport(listener, success, items); + app.getSettings().PREFERRED_LOCALE.removeListener(localeListener); + finishImport(listener, success, items, needRestart); } } @@ -348,7 +355,7 @@ public class SettingsHelper { protected void onPreExecute() { ImportAsyncTask importTask = SettingsHelper.this.importTask; if (importTask != null && !importTask.importDone) { - finishImport(importListener, false, items); + finishImport(importListener, false, items, false); } SettingsHelper.this.importTask = this; } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java index ddee0e1393..abcd5afc0a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportCompleteFragment.java @@ -52,14 +52,16 @@ public class ImportCompleteFragment extends BaseOsmAndFragment { private RecyclerView recyclerView; private List settingsItems; private String fileName; + private boolean needRestart; private boolean nightMode; public static void showInstance(FragmentManager fm, @NonNull List settingsItems, - @NonNull String fileName) { + @NonNull String fileName, boolean needRestart) { ImportCompleteFragment fragment = new ImportCompleteFragment(); fragment.setSettingsItems(settingsItems); fragment.setFileName(fileName); fragment.setRetainInstance(true); + fragment.setNeedRestart(needRestart); fm.beginTransaction() .replace(R.id.fragmentContainer, fragment, TAG) .addToBackStack(SETTINGS_LIST_TAG) @@ -99,8 +101,7 @@ public class ImportCompleteFragment extends BaseOsmAndFragment { dismissFragment(); } }); - if (app.getLocaleHelper().needRestart()) { - app.getLocaleHelper().setNeedRestart(false); + if (needRestart) { setupRestartButton(root); } if (Build.VERSION.SDK_INT >= 21) { @@ -276,4 +277,8 @@ public class ImportCompleteFragment extends BaseOsmAndFragment { public void setFileName(String fileName) { this.fileName = fileName; } + + public void setNeedRestart(boolean needRestart) { + this.needRestart = needRestart; + } } diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java index b614bc57dd..3cae444157 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ImportSettingsFragment.java @@ -155,7 +155,7 @@ public class ImportSettingsFragment extends BaseSettingsListFragment { public SettingsHelper.SettingsImportListener getImportListener() { return new SettingsHelper.SettingsImportListener() { @Override - public void onSettingsImportFinished(boolean succeed, @NonNull List items) { + public void onSettingsImportFinished(boolean succeed, boolean needRestart, @NonNull List items) { if (succeed) { app.getRendererRegistry().updateExternalRenderers(); AppInitializer.loadRoutingFiles(app, null); @@ -166,7 +166,7 @@ public class ImportSettingsFragment extends BaseSettingsListFragment { } FragmentManager fm = getFragmentManager(); if (fm != null && file != null) { - ImportCompleteFragment.showInstance(fm, items, file.getName()); + ImportCompleteFragment.showInstance(fm, items, file.getName(), needRestart); } } } From 5c59f65e1575e4cf2529a8e317cdce65e4c79904 Mon Sep 17 00:00:00 2001 From: cepprice Date: Mon, 15 Feb 2021 13:17:42 +0500 Subject: [PATCH 39/46] Add missing file --- .../plus/settings/fragments/ConfigureProfileFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java index cea9b0e17c..e421a981b9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ConfigureProfileFragment.java @@ -202,7 +202,7 @@ public class ConfigureProfileFragment extends BaseSettingsFragment implements Co private void importBackupSettingsItems(File file, List items) { app.getSettingsHelper().importSettings(file, items, "", 1, new SettingsHelper.SettingsImportListener() { @Override - public void onSettingsImportFinished(boolean succeed, @NonNull List items) { + public void onSettingsImportFinished(boolean succeed, boolean needRestart, @NonNull List items) { app.showToastMessage(R.string.profile_prefs_reset_successful); updateCopiedOrResetPrefs(); } From 9b7446f57a4761b18371a911235ee6026c5997b0 Mon Sep 17 00:00:00 2001 From: cepprice Date: Mon, 15 Feb 2021 15:01:55 +0500 Subject: [PATCH 40/46] Add support of URLs in plain text inside favourites and waypoints context menu --- OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java | 6 +++++- .../plus/mapcontextmenu/builders/AmenityMenuBuilder.java | 2 +- .../plus/mapcontextmenu/builders/WptPtMenuBuilder.java | 4 ++-- OsmAnd/src/net/osmand/plus/views/layers/POIMapLayer.java | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java index 51e7370da6..77193c7c16 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuBuilder.java @@ -808,7 +808,11 @@ public class MenuBuilder { View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { - POIMapLayer.showHtmlDescriptionDialog(view.getContext(), app, description, descriptionLabel); + if (description.contains(" Date: Mon, 15 Feb 2021 12:02:06 +0100 Subject: [PATCH 41/46] Update constant definition (same value) --- .../src/main/java/net/osmand/binary/BinaryMapIndexReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java index dc16b89f30..34483b01b7 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapIndexReader.java @@ -83,7 +83,7 @@ public class BinaryMapIndexReader { public final static int TRANSPORT_STOP_ZOOM = 24; public static final int SHIFT_COORDINATES = 5; - public static final int LABEL_ZOOM_ENCODE = 26; + public static final int LABEL_ZOOM_ENCODE = 31 - SHIFT_COORDINATES; private final static Log log = PlatformUtil.getLog(BinaryMapIndexReader.class); public static boolean READ_STATS = false; public static final SearchPoiTypeFilter ACCEPT_ALL_POI_TYPE_FILTER = new SearchPoiTypeFilter() { From 0eddb3503865d8111bdea535ad75dc6df4d1f779 Mon Sep 17 00:00:00 2001 From: ivanPyrohivskyi Date: Mon, 15 Feb 2021 13:15:25 +0200 Subject: [PATCH 42/46] Added constants --- .../binary/BinaryMapPoiReaderAdapter.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java index 9c0f30ebe2..742eae1f61 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -37,7 +37,12 @@ public class BinaryMapPoiReaderAdapter { private static final int CATEGORY_MASK = (1 << SHIFT_BITS_CATEGORY) - 1; private static final int ZOOM_TO_SKIP_FILTER_READ = 6; private static final int ZOOM_TO_SKIP_FILTER = 3; - private static final int BUCKET_SEARCH_BY_NAME = 15; // should be bigger 100? + private static final int BUCKET_SEARCH_BY_NAME = 15; // should be bigger 100? + private static final int BASE_POI_SHIFT = SHIFT_BITS_CATEGORY;// 7 + private static final int FINAL_POI_SHIFT = BinaryMapIndexReader.SHIFT_COORDINATES;// 5 + private static final int BASE_POI_ZOOM = 31 - BASE_POI_SHIFT;// 24 zoom + private static final int FINAL_POI_ZOOM = 31 - FINAL_POI_SHIFT;// 26 zoom + public static class PoiSubType { public boolean text; @@ -744,9 +749,9 @@ public class BinaryMapPoiReaderAdapter { } if (hasLocation) { if (precisionXY != 0) { - int[] xy = MapUtils.calculateFinalXYFromBaseAndPrecisionXY(24, 26, precisionXY, x >> 7, y >> 7, true); - int x31 = xy[0] << 5; - int y31 = xy[1] << 5; + int[] xy = MapUtils.calculateFinalXYFromBaseAndPrecisionXY(BASE_POI_ZOOM, FINAL_POI_ZOOM, precisionXY, x >> BASE_POI_SHIFT, y >> BASE_POI_SHIFT, true); + int x31 = xy[0] << FINAL_POI_SHIFT; + int y31 = xy[1] << FINAL_POI_SHIFT; am.setLocation(MapUtils.get31LatitudeY(y31), MapUtils.get31LongitudeX(x31)); } else { am.setLocation(MapUtils.get31LatitudeY(y), MapUtils.get31LongitudeX(x)); @@ -754,10 +759,10 @@ public class BinaryMapPoiReaderAdapter { } return am; case OsmandOdb.OsmAndPoiBoxDataAtom.DX_FIELD_NUMBER: - x = (codedIS.readSInt32() + (px << (24 - zoom))) << 7; + x = (codedIS.readSInt32() + (px << (BASE_POI_ZOOM - zoom))) << BASE_POI_SHIFT; break; case OsmandOdb.OsmAndPoiBoxDataAtom.DY_FIELD_NUMBER: - y = (codedIS.readSInt32() + (py << (24 - zoom))) << 7; + y = (codedIS.readSInt32() + (py << (BASE_POI_ZOOM - zoom))) << BASE_POI_SHIFT; req.numberOfVisitedObjects++; if (checkBounds) { if (left31 > x || right31 < x || top31 > y || bottom31 < y) { From 9fe74b12cdbdd56471467cc76e2eae0502aff2e4 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 15 Feb 2021 16:48:22 +0200 Subject: [PATCH 43/46] Fix GPX file from bookmarked articles doesn't show without file --- .../data/TravelLocalDataHelper.java | 94 +++++++++++----- .../plus/wikivoyage/data/TravelObfHelper.java | 106 +++++++++--------- .../explore/travelcards/TravelGpxCard.java | 18 ++- 3 files changed, 134 insertions(+), 84 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index d95b9239ee..6778b3c736 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -7,13 +7,19 @@ import android.database.sqlite.SQLiteDatabase; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import net.osmand.GPXUtilities; import net.osmand.IndexConstants; +import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.util.Algorithms; +import org.apache.commons.logging.Log; + +import java.io.ByteArrayInputStream; import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -27,6 +33,8 @@ import java.util.Set; public class TravelLocalDataHelper { + private static final Log LOG = PlatformUtil.getLog(TravelLocalDataHelper.class); + private static final int HISTORY_ITEMS_LIMIT = 300; private final WikivoyageLocalDataDbHelper dbHelper; @@ -189,7 +197,7 @@ public class TravelLocalDataHelper { private static class WikivoyageLocalDataDbHelper { - private static final int DB_VERSION = 7; + private static final int DB_VERSION = 8; private static final String DB_NAME = "wikivoyage_local_data"; private static final String HISTORY_TABLE_NAME = "wikivoyage_search_history"; @@ -227,6 +235,7 @@ public class TravelLocalDataHelper { private static final String BOOKMARKS_COL_CONTENT_JSON = "content_json"; private static final String BOOKMARKS_COL_CONTENT = "content"; private static final String BOOKMARKS_COL_LAST_MODIFIED = "last_modified"; + private static final String BOOKMARKS_COL_GPX_GZ = "gpx_gz"; private static final String BOOKMARKS_TABLE_CREATE = "CREATE TABLE IF NOT EXISTS " + BOOKMARKS_TABLE_NAME + " (" + @@ -240,7 +249,8 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_ROUTE_ID + " TEXT, " + BOOKMARKS_COL_CONTENT_JSON + " TEXT, " + BOOKMARKS_COL_CONTENT + " TEXT, " + - BOOKMARKS_COL_LAST_MODIFIED + " long" + ");"; + BOOKMARKS_COL_LAST_MODIFIED + " long, " + + BOOKMARKS_COL_GPX_GZ + " blob" + ");"; private static final String BOOKMARKS_TABLE_SELECT = "SELECT " + BOOKMARKS_COL_ARTICLE_TITLE + ", " + @@ -253,7 +263,8 @@ public class TravelLocalDataHelper { BOOKMARKS_COL_ROUTE_ID + ", " + BOOKMARKS_COL_CONTENT_JSON + ", " + BOOKMARKS_COL_CONTENT + ", " + - BOOKMARKS_COL_LAST_MODIFIED + + BOOKMARKS_COL_LAST_MODIFIED + ", " + + BOOKMARKS_COL_GPX_GZ + " FROM " + BOOKMARKS_TABLE_NAME; private final OsmandApplication context; @@ -322,6 +333,9 @@ public class TravelLocalDataHelper { conn.execSQL("UPDATE " + BOOKMARKS_TABLE_NAME + " SET " + BOOKMARKS_COL_PARTIAL_CONTENT + " = null"); } + if (oldVersion < 8) { + conn.execSQL("ALTER TABLE " + BOOKMARKS_TABLE_NAME + " ADD " + BOOKMARKS_COL_GPX_GZ + " blob"); + } } @NonNull @@ -465,35 +479,48 @@ public class TravelLocalDataHelper { return count > 0; } - void addSavedArticle(@NonNull TravelArticle article) { - String travelBook = article.getTravelBook(context); + void addSavedArticle(@NonNull final TravelArticle article) { + final String travelBook = article.getTravelBook(context); if (travelBook == null) { return; } - SQLiteConnection conn = openConnection(false); - if (conn != null) { - try { - String query = "INSERT INTO " + BOOKMARKS_TABLE_NAME + " (" + - BOOKMARKS_COL_ARTICLE_TITLE + ", " + - BOOKMARKS_COL_LANG + ", " + - BOOKMARKS_COL_IS_PART_OF + ", " + - BOOKMARKS_COL_IMAGE_TITLE + ", " + - BOOKMARKS_COL_TRAVEL_BOOK + ", " + - BOOKMARKS_COL_LAT + ", " + - BOOKMARKS_COL_LON + ", " + - BOOKMARKS_COL_ROUTE_ID + ", " + - BOOKMARKS_COL_CONTENT_JSON + ", " + - BOOKMARKS_COL_CONTENT + ", " + - BOOKMARKS_COL_LAST_MODIFIED + - ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; - conn.execSQL(query, new Object[]{article.title, article.lang, - article.aggregatedPartOf, article.imageTitle, - travelBook, article.lat, article.lon, article.routeId, article.contentsJson, - article.content, article.getFile().lastModified()}); - } finally { - conn.close(); - } - } + context.getTravelHelper().getArticleById(article.generateIdentifier(), article.lang, true, + new TravelHelper.GpxReadCallback() { + @Override + public void onGpxFileReading() { + + } + + @Override + public void onGpxFileRead(@Nullable GPXUtilities.GPXFile gpxFile) { + SQLiteConnection conn = openConnection(false); + if (conn != null) { + try { + String query = "INSERT INTO " + BOOKMARKS_TABLE_NAME + " (" + + BOOKMARKS_COL_ARTICLE_TITLE + ", " + + BOOKMARKS_COL_LANG + ", " + + BOOKMARKS_COL_IS_PART_OF + ", " + + BOOKMARKS_COL_IMAGE_TITLE + ", " + + BOOKMARKS_COL_TRAVEL_BOOK + ", " + + BOOKMARKS_COL_LAT + ", " + + BOOKMARKS_COL_LON + ", " + + BOOKMARKS_COL_ROUTE_ID + ", " + + BOOKMARKS_COL_CONTENT_JSON + ", " + + BOOKMARKS_COL_CONTENT + ", " + + BOOKMARKS_COL_LAST_MODIFIED + ", " + + BOOKMARKS_COL_GPX_GZ + + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + conn.execSQL(query, new Object[]{article.title, article.lang, + article.aggregatedPartOf, article.imageTitle, + travelBook, article.lat, article.lon, article.routeId, article.contentsJson, + article.content, article.getFile().lastModified(), + Algorithms.stringToGzip(GPXUtilities.asString(article.gpxFile))}); + } finally { + conn.close(); + } + } + } + }); } void removeSavedArticle(@NonNull TravelArticle article) { @@ -584,6 +611,15 @@ public class TravelLocalDataHelper { res.file = context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR + travelBook); res.lastModified = cursor.getLong(cursor.getColumnIndex(BOOKMARKS_COL_LAST_MODIFIED)); } + try { + byte[] blob = cursor.getBlob(cursor.getColumnIndex(BOOKMARKS_COL_GPX_GZ)); + if (blob != null) { + String gpxContent = Algorithms.gzipToString(blob); + res.gpxFile = GPXUtilities.loadGPXFile(new ByteArrayInputStream(gpxContent.getBytes("UTF-8"))); + } + } catch (IOException e) { + LOG.error(e.getMessage(), e); + } return res; } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index cd215fc28c..27ccb89f64 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -116,48 +116,50 @@ public class TravelObfHelper implements TravelHelper { String lang = app.getLanguage(); List popularArticles = new ArrayList<>(this.popularArticles); int pagesCount; - do { - if (foundAmenities.size() - foundAmenitiesIndex < MAX_POPULAR_ARTICLES_COUNT) { - final LatLon location = app.getMapViewTrackingUtilities().getMapLocation(); - for (final BinaryMapIndexReader reader : getReaders()) { - try { - searchAmenity(foundAmenities, location, reader, searchRadius, -1, ROUTE_ARTICLE); - searchAmenity(foundAmenities, location, reader, searchRadius / 5, 15, ROUTE_TRACK); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - if (foundAmenities.size() > 0) { - Collections.sort(foundAmenities, new Comparator>() { - @Override - public int compare(Pair article1, Pair article2) { - Amenity amenity1 = (Amenity) article1.second; - double d1 = MapUtils.getDistance(amenity1.getLocation(), location) - / (ROUTE_ARTICLE.equals(amenity1.getSubType()) ? 5 : 1); - Amenity amenity2 = (Amenity) article2.second; - double d2 = MapUtils.getDistance(amenity2.getLocation(), location) - / (ROUTE_ARTICLE.equals(amenity2.getSubType()) ? 5 : 1); - return Double.compare(d1, d2); - } - }); - } - searchRadius *= 2; - } - pagesCount = popularArticles.size() / MAX_POPULAR_ARTICLES_COUNT; - while (foundAmenitiesIndex < foundAmenities.size() - 1) { - Pair amenity = foundAmenities.get(foundAmenitiesIndex); - if (!Algorithms.isEmpty(amenity.second.getName(lang))) { - TravelArticle article = cacheTravelArticles(amenity.first, amenity.second, lang, false, null); - if (article != null && !popularArticles.contains(article)) { - popularArticles.add(article); - if (popularArticles.size() >= (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT) { - break; + if (isAnyTravelBookPresent()) { + do { + if (foundAmenities.size() - foundAmenitiesIndex < MAX_POPULAR_ARTICLES_COUNT) { + final LatLon location = app.getMapViewTrackingUtilities().getMapLocation(); + for (final BinaryMapIndexReader reader : getReaders()) { + try { + searchAmenity(foundAmenities, location, reader, searchRadius, -1, ROUTE_ARTICLE); + searchAmenity(foundAmenities, location, reader, searchRadius / 5, 15, ROUTE_TRACK); + } catch (Exception e) { + LOG.error(e.getMessage(), e); } } + if (foundAmenities.size() > 0) { + Collections.sort(foundAmenities, new Comparator>() { + @Override + public int compare(Pair article1, Pair article2) { + Amenity amenity1 = (Amenity) article1.second; + double d1 = MapUtils.getDistance(amenity1.getLocation(), location) + / (ROUTE_ARTICLE.equals(amenity1.getSubType()) ? 5 : 1); + Amenity amenity2 = (Amenity) article2.second; + double d2 = MapUtils.getDistance(amenity2.getLocation(), location) + / (ROUTE_ARTICLE.equals(amenity2.getSubType()) ? 5 : 1); + return Double.compare(d1, d2); + } + }); + } + searchRadius *= 2; } - foundAmenitiesIndex++; - } - } while (popularArticles.size() < (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT); + pagesCount = popularArticles.size() / MAX_POPULAR_ARTICLES_COUNT; + while (foundAmenitiesIndex < foundAmenities.size() - 1) { + Pair amenity = foundAmenities.get(foundAmenitiesIndex); + if (!Algorithms.isEmpty(amenity.second.getName(lang))) { + TravelArticle article = cacheTravelArticles(amenity.first, amenity.second, lang, false, null); + if (article != null && !popularArticles.contains(article)) { + popularArticles.add(article); + if (popularArticles.size() >= (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT) { + break; + } + } + } + foundAmenitiesIndex++; + } + } while (popularArticles.size() < (pagesCount + 1) * MAX_POPULAR_ARTICLES_COUNT); + } this.popularArticles = popularArticles; return popularArticles; } @@ -667,7 +669,7 @@ public class TravelObfHelper implements TravelHelper { if (article == null && articles == null) { article = findArticleById(articleId, lang, readGpx, callback); } - if (article != null && readGpx && !Algorithms.isEmpty(lang)) { + if (article != null && readGpx && (!Algorithms.isEmpty(lang) || article instanceof TravelGpx)) { readGpxFile(article, callback); } return article; @@ -858,11 +860,7 @@ public class TravelObfHelper implements TravelHelper { @Override public File createGpxFile(@NonNull TravelArticle article) { final GPXFile gpx; - if (article instanceof TravelGpx) { - gpx = buildTravelGpxFile((TravelGpx) article); - } else { - gpx = article.getGpxFile(); - } + gpx = article.getGpxFile(); File file = app.getAppPath(IndexConstants.GPX_TRAVEL_DIR + getGPXName(article)); writeGpxFile(file, gpx); return file; @@ -898,13 +896,17 @@ public class TravelObfHelper implements TravelHelper { @Override protected GPXFile doInBackground(Void... voids) { GPXFile gpxFile = null; - List pointList = getPointList(article); - if (!Algorithms.isEmpty(pointList)) { - gpxFile = new GPXFile(article.getTitle(), article.getLang(), article.getContent()); - gpxFile.metadata.link = TravelArticle.getImageUrl(article.getImageTitle(), false); - for (Amenity amenity : pointList) { - WptPt wptPt = createWptPt(amenity, article.getLang()); - gpxFile.addPoint(wptPt); + if (article instanceof TravelGpx) { + gpxFile = buildTravelGpxFile((TravelGpx) article); + } else { + List pointList = getPointList(article); + if (!Algorithms.isEmpty(pointList)) { + gpxFile = new GPXFile(article.getTitle(), article.getLang(), article.getContent()); + gpxFile.metadata.link = TravelArticle.getImageUrl(article.getImageTitle(), false); + for (Amenity amenity : pointList) { + WptPt wptPt = createWptPt(amenity, article.getLang()); + gpxFile.addPoint(wptPt); + } } } return gpxFile; diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/TravelGpxCard.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/TravelGpxCard.java index be89018bb6..7e07b55be4 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/TravelGpxCard.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/travelcards/TravelGpxCard.java @@ -7,16 +7,19 @@ import android.widget.TextView; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; import androidx.recyclerview.widget.RecyclerView; import net.osmand.AndroidUtils; +import net.osmand.GPXUtilities; import net.osmand.osm.RouteActivityType; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.track.TrackMenuFragment; import net.osmand.plus.wikivoyage.data.TravelGpx; +import net.osmand.plus.wikivoyage.data.TravelHelper; import net.osmand.plus.wikivoyage.data.TravelLocalDataHelper; import net.osmand.util.Algorithms; @@ -64,8 +67,18 @@ public class TravelGpxCard extends BaseTravelCard { @Override public void onClick(View v) { if (activity != null) { - File file = app.getTravelHelper().createGpxFile(article); - TrackMenuFragment.openTrack(activity, file, null); + app.getTravelHelper().getArticleById(article.generateIdentifier(), null, true, + new TravelHelper.GpxReadCallback() { + @Override + public void onGpxFileReading() { + } + + @Override + public void onGpxFileRead(@Nullable GPXUtilities.GPXFile gpxFile) { + File file = app.getTravelHelper().createGpxFile(article); + TrackMenuFragment.openTrack(activity, file, null); + } + }); } } }; @@ -102,7 +115,6 @@ public class TravelGpxCard extends BaseTravelCard { if (saved) { helper.removeArticleFromSaved(article); } else { - app.getTravelHelper().createGpxFile(article); helper.addArticleToSaved(article); } updateSaveButton(holder); From c635ebfef5fec162f396904836f234e51dedc464 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Mon, 15 Feb 2021 18:18:16 +0300 Subject: [PATCH 44/46] Add phrases --- OsmAnd/res/values/phrases.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 4ffcb6202d..c3b693f87f 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4332,6 +4332,7 @@ Bat bridge Bat tunnel +<<<<<<< HEAD Ski jump Piste name Gladed: yes @@ -4344,5 +4345,12 @@ Summit register: no Mobile library stop position +======= + Conference centre + + Geodesist + + +>>>>>>> Add phrases From 2960dc93c0e37b62f32dfbd02968fb64c8e594f3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 15 Feb 2021 16:27:51 +0100 Subject: [PATCH 45/46] Fix merge --- OsmAnd/res/values/phrases.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index c3b693f87f..53138bcc18 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4332,7 +4332,6 @@ Bat bridge Bat tunnel -<<<<<<< HEAD Ski jump Piste name Gladed: yes @@ -4340,17 +4339,10 @@ Patrolled: no Piste status: open Piste status: closed - Summit register: yes Summit register: no - Mobile library stop position -======= Conference centre - Geodesist - ->>>>>>> Add phrases - From ef915fc0bc9b4e841eed9800a8a9b9711e1d891c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 15 Feb 2021 17:32:38 +0200 Subject: [PATCH 46/46] Added icon ruler_line --- OsmAnd/res/drawable/ic_action_ruler_line.xml | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 OsmAnd/res/drawable/ic_action_ruler_line.xml diff --git a/OsmAnd/res/drawable/ic_action_ruler_line.xml b/OsmAnd/res/drawable/ic_action_ruler_line.xml new file mode 100644 index 0000000000..0fb6bfc5fa --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_ruler_line.xml @@ -0,0 +1,23 @@ + + + + + +