From 21f9e6ac626e90c718afe350b4091663e98cb12b Mon Sep 17 00:00:00 2001 From: Deelite <556xxy@gmail.com> Date: Wed, 16 Sep 2020 20:16:13 +0000 Subject: [PATCH 01/20] Translated using Weblate (Russian) Currently translated at 99.9% (3483 of 3484 strings) --- OsmAnd/res/values-ru/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 55ff01a9a1..211819502e 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1386,7 +1386,7 @@ Задать пункт назначения Предпочтения маршрута Информация про маршрут - Добавить следующим пунктом назначения + Добавить как новый пункт назначения Использовать показанный путь для навигации? Рассчитать сегмент маршрута OsmAnd без интернета Рассчитать маршрут OsmAnd для первого и последнего сегмента маршрута From d771db6481821ab9615050c4819066b359fafbb4 Mon Sep 17 00:00:00 2001 From: Franco Date: Wed, 16 Sep 2020 21:02:04 +0000 Subject: [PATCH 02/20] Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (3824 of 3824 strings) --- OsmAnd/res/values-es-rAR/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml index e1839d42f2..4019b950b2 100644 --- a/OsmAnd/res/values-es-rAR/phrases.xml +++ b/OsmAnd/res/values-es-rAR/phrases.xml @@ -3850,4 +3850,5 @@ Recarga de agua potable Pequeños electrodomésticos Panal de abejas + Frutos secos \ No newline at end of file From 96650032b7da91df23c83b70cba359f2e2798d60 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Thu, 17 Sep 2020 02:16:08 +0000 Subject: [PATCH 03/20] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3824 of 3824 strings) --- OsmAnd/res/values-zh-rTW/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 352282d071..25766f928e 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -3842,4 +3842,5 @@ 飲用水補充 小電器 蜂箱 + 堅果店 \ No newline at end of file From e2d83127717a411d320df2ad3eb6e0cab311cc9c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 11:59:39 +0300 Subject: [PATCH 04/20] Fix #9746 --- .../SaveAsNewTrackBottomSheetDialogFragment.java | 4 +++- .../plus/measurementtool/adapter/FolderListAdapter.java | 3 ++- .../plus/routepreparationmenu/ChooseRouteFragment.java | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java index fb1badf2aa..40877bf8dc 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/SaveAsNewTrackBottomSheetDialogFragment.java @@ -76,6 +76,8 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial sourceFileName = savedInstanceState.getString(SOURCE_FILE_NAME_KEY); sourceFolderName = savedInstanceState.getString(SOURCE_FOLDER_NAME_KEY); showSimplifiedButton = savedInstanceState.getBoolean(SHOW_SIMPLIFIED_BUTTON_KEY); + } else { + folderName = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getName(); } items.add(new TitleItem(getString(R.string.save_as_new_track))); @@ -290,7 +292,7 @@ public class SaveAsNewTrackBottomSheetDialogFragment extends MenuBottomSheetDial private File getFile(OsmandApplication app, String folderName, String fileName) { File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); File source = dir; - if (folderName != null) { + if (folderName != null && !dir.getName().equals(folderName)) { source = new File(dir, folderName); } source = new File(source, fileName + IndexConstants.GPX_FILE_EXT); diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/FolderListAdapter.java b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/FolderListAdapter.java index b207d7aac5..b383a4bef6 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/adapter/FolderListAdapter.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/adapter/FolderListAdapter.java @@ -48,7 +48,8 @@ public class FolderListAdapter extends RecyclerView.Adapter getFolders() { List dirs = new ArrayList<>(); - final File gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); + File gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); + dirs.add(gpxDir); Algorithms.collectDirs(gpxDir, dirs); List dirItems = new ArrayList<>(); for (File dir : dirs) { diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java index b7b87f01b2..0f804013ca 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java @@ -894,7 +894,10 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe public void onSaveAsNewTrack(String folderName, String fileName, boolean showOnMap, boolean simplifiedTrack) { OsmandApplication app = getMyApplication(); if (app != null) { - File fileDir = new File(app.getAppPath(IndexConstants.GPX_INDEX_DIR), folderName == null ? "" : folderName); + File fileDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); + if (!fileDir.getName().equals(folderName)) { + fileDir = new File(fileDir, folderName); + } File toSave = new File(fileDir, fileName + GPX_FILE_EXT); new SaveDirectionsAsyncTask(app, showOnMap).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, toSave); } From 685e519a38dcdefb1f882f1034e985ef88f5ed1a Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 12:13:05 +0300 Subject: [PATCH 05/20] Fix check for folder name --- .../osmand/plus/measurementtool/MeasurementToolFragment.java | 2 +- .../osmand/plus/routepreparationmenu/ChooseRouteFragment.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index d80eddb6b7..e2e4d79531 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -1037,7 +1037,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment implements Route OsmandApplication app = getMyApplication(); if (app != null) { File dir = getMyApplication().getAppPath(GPX_INDEX_DIR); - if (folderName != null) { + if (folderName != null && !dir.getName().equals(folderName)) { dir = new File(dir, folderName); } fileName += GPX_FILE_EXT; diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java index 0f804013ca..004f5c4d2b 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ChooseRouteFragment.java @@ -895,7 +895,7 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe OsmandApplication app = getMyApplication(); if (app != null) { File fileDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); - if (!fileDir.getName().equals(folderName)) { + if (folderName != null && !fileDir.getName().equals(folderName)) { fileDir = new File(fileDir, folderName); } File toSave = new File(fileDir, fileName + GPX_FILE_EXT); From 0a034ab399cba745f56946fd893b4eacf498c01d Mon Sep 17 00:00:00 2001 From: sergosm Date: Thu, 17 Sep 2020 12:31:26 +0300 Subject: [PATCH 06/20] Address doesn't saved if it enters manualy while adding favorite --- .../editors/FavoritePointEditorFragmentNew.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java index 9bfe58324a..3e4093d253 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/FavoritePointEditorFragmentNew.java @@ -307,7 +307,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew { FavoritePointEditor editor = getFavoritePointEditor(); if (editor != null && helper != null) { if (editor.isNew()) { - doAddFavorite(name, category, description, color, backgroundType, iconId); + doAddFavorite(name, category, description, address, color, backgroundType, iconId); } else { doEditFavorite(favorite, name, category, description, address, color, backgroundType, iconId, helper); } @@ -341,7 +341,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew { } } - private void doAddFavorite(String name, String category, String description, @ColorInt int color, + private void doAddFavorite(String name, String category, String description, String address, @ColorInt int color, BackgroundType backgroundType, @DrawableRes int iconId) { OsmandApplication app = getMyApplication(); FavouritesDbHelper helper = getHelper(); @@ -350,6 +350,7 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew { favorite.setName(name); favorite.setCategory(category); favorite.setDescription(description); + favorite.setAddress(address); favorite.setColor(color); favorite.setBackgroundType(backgroundType); favorite.setIconId(iconId); From 20e6b41cbe15875b829cd9cf1abd52e76d4f1729 Mon Sep 17 00:00:00 2001 From: sergosm Date: Thu, 17 Sep 2020 13:06:25 +0300 Subject: [PATCH 07/20] Show type for "Base profiles" too, except "Browse map" --- .../plus/activities/MapActivityActions.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index ea597558e1..36fa32f634 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -738,9 +738,9 @@ public class MapActivityActions implements DialogProvider { Map profilesObjects = getRoutingProfiles(app); for (final ApplicationMode appMode : activeModes) { if (appMode.isCustomProfile()) { - modeDescription = getCustomProfileDescription(app, appMode, profilesObjects); + modeDescription = getCustomProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_custom_string)); } else { - modeDescription = getString(R.string.profile_type_base_string); + modeDescription = getCustomProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_base_string)); } int tag = currentMode.equals(appMode) ? PROFILES_CHOSEN_PROFILE_TAG : PROFILES_NORMAL_PROFILE_TAG; @@ -1047,12 +1047,13 @@ public class MapActivityActions implements DialogProvider { //switch profile button ApplicationMode currentMode = app.getSettings().APPLICATION_MODE.get(); String modeDescription; + Map profilesObjects = getRoutingProfiles(app); if (currentMode.isCustomProfile()) { - Map profilesObjects = getRoutingProfiles(app); - modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects); + modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_custom_string)); } else { - modeDescription = getString(R.string.profile_type_base_string); + modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_base_string)); } + int icArrowResId = listExpanded ? R.drawable.ic_action_arrow_drop_up : R.drawable.ic_action_arrow_drop_down; final int nextMode = listExpanded ? DRAWER_MODE_NORMAL : DRAWER_MODE_SWITCH_PROFILE; optionsMenuHelper.addItem(new ItemBuilder().setLayout(R.layout.main_menu_drawer_btn_switch_profile) @@ -1085,8 +1086,8 @@ public class MapActivityActions implements DialogProvider { } private String getCustomProfileDescription(OsmandApplication app, ApplicationMode mode, - Map profilesObjects){ - String description = getString(R.string.profile_type_custom_string); + Map profilesObjects, String defaultDescription){ + String description = defaultDescription; String routingProfileKey = mode.getRoutingProfile(); if (!Algorithms.isEmpty(routingProfileKey)) { From a0e2b260212b38504aadb2fc47ac5c248b24c1c6 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 13:14:34 +0300 Subject: [PATCH 08/20] Fix context menu visibility --- .../editors/PointEditorFragmentNew.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java index 3214817780..7500a17d77 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragmentNew.java @@ -817,11 +817,15 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { hideKeyboard(); MapActivity mapActivity = getMapActivity(); if (mapActivity != null) { + MapContextMenu mapContextMenu = mapActivity.getContextMenu(); if (includingMenu) { mapActivity.getSupportFragmentManager().popBackStack(); - mapActivity.getContextMenu().close(); + mapContextMenu.close(); } else { mapActivity.getSupportFragmentManager().popBackStack(); + if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) { + mapContextMenu.show(); + } } } } @@ -932,17 +936,6 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment { private void exitEditing() { cancelled = true; dismiss(); - showContextMenu(); - } - - private void showContextMenu() { - MapActivity mapActivity = getMapActivity(); - if (mapActivity != null) { - MapContextMenu mapContextMenu = mapActivity.getContextMenu(); - if (!mapContextMenu.isVisible() && mapContextMenu.isActive()) { - mapContextMenu.show(); - } - } } private AlertDialog.Builder createWarningDialog(Activity activity, int title, int message, int negButton) { From 4aabbfaef635a57b3869caf48e4d08243aad9cea Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 13:22:12 +0300 Subject: [PATCH 09/20] Rename method --- .../osmand/plus/activities/MapActivityActions.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 36fa32f634..5414b9c0f7 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -738,9 +738,9 @@ public class MapActivityActions implements DialogProvider { Map profilesObjects = getRoutingProfiles(app); for (final ApplicationMode appMode : activeModes) { if (appMode.isCustomProfile()) { - modeDescription = getCustomProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_custom_string)); + modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_custom_string)); } else { - modeDescription = getCustomProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_base_string)); + modeDescription = getProfileDescription(app, appMode, profilesObjects, getString(R.string.profile_type_base_string)); } int tag = currentMode.equals(appMode) ? PROFILES_CHOSEN_PROFILE_TAG : PROFILES_NORMAL_PROFILE_TAG; @@ -1049,9 +1049,9 @@ public class MapActivityActions implements DialogProvider { String modeDescription; Map profilesObjects = getRoutingProfiles(app); if (currentMode.isCustomProfile()) { - modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_custom_string)); + modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_custom_string)); } else { - modeDescription = getCustomProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_base_string)); + modeDescription = getProfileDescription(app, currentMode, profilesObjects, getString(R.string.profile_type_base_string)); } int icArrowResId = listExpanded ? R.drawable.ic_action_arrow_drop_up : R.drawable.ic_action_arrow_drop_down; @@ -1085,8 +1085,8 @@ public class MapActivityActions implements DialogProvider { .createItem()); } - private String getCustomProfileDescription(OsmandApplication app, ApplicationMode mode, - Map profilesObjects, String defaultDescription){ + private String getProfileDescription(OsmandApplication app, ApplicationMode mode, + Map profilesObjects, String defaultDescription){ String description = defaultDescription; String routingProfileKey = mode.getRoutingProfile(); From d263131a75b2ecae6ce8ac4aefba45cf62da3f25 Mon Sep 17 00:00:00 2001 From: Ferdi Date: Thu, 17 Sep 2020 08:10:12 +0000 Subject: [PATCH 10/20] Translated using Weblate (German) Currently translated at 99.9% (3822 of 3824 strings) --- OsmAnd/res/values-de/phrases.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-de/phrases.xml b/OsmAnd/res/values-de/phrases.xml index 53f9e13926..14173b1d76 100644 --- a/OsmAnd/res/values-de/phrases.xml +++ b/OsmAnd/res/values-de/phrases.xml @@ -3844,4 +3844,5 @@ Abbiegepfeil: nein Anzeige der Abreisezeiten Nachfüllen von Trinkwasser + Bienenstock \ No newline at end of file From 46be5ece691509bd876500e77e41d0b24917892e Mon Sep 17 00:00:00 2001 From: Ferdi Date: Thu, 17 Sep 2020 08:12:17 +0000 Subject: [PATCH 11/20] Translated using Weblate (French) Currently translated at 99.7% (3813 of 3824 strings) --- OsmAnd/res/values-fr/phrases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fr/phrases.xml b/OsmAnd/res/values-fr/phrases.xml index b90c5e8bde..638995c1f2 100644 --- a/OsmAnd/res/values-fr/phrases.xml +++ b/OsmAnd/res/values-fr/phrases.xml @@ -3814,7 +3814,7 @@ Niveau d\'eau : au-dessus du niveau d\'eau moyen Niveau d\'eau : en-dessous du niveau d\'eau moyen Obstacle - Remplissage d\'eau potable : oui + Oui Remplissage d\'eau potable : non Réseau de remplissage d\'eau potable Uniquement si la marche est autorisée From 554e6a1844b54394a7bc8d15b03d0120a8ecbf2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Priit=20J=C3=B5er=C3=BC=C3=BCt?= Date: Thu, 17 Sep 2020 10:27:05 +0000 Subject: [PATCH 12/20] Translated using Weblate (Estonian) Currently translated at 98.5% (3434 of 3484 strings) --- OsmAnd/res/values-et/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml index 2c829dcfd0..fea216bce3 100644 --- a/OsmAnd/res/values-et/strings.xml +++ b/OsmAnd/res/values-et/strings.xml @@ -3181,7 +3181,7 @@ Nupp alloleva loendi sirvimiseks. OsmAnd (OSM automatiseeritud navigeerimisjuhised) on kaardi- ja navigatsioonirakendus, millel on juurdepääs tasuta, ülemaailmsetele ja kvaliteetsetele OpenStreetMap (OSM) andmetele. \n -\n Naudi hääl- ja optilist navigaatorit, HP-de (huvipunktide) vaatamist, GPX radade loomist ja haldamist, kõrgusjoonte visuaalse kuvamise ja kõrguse teabe kasutamist (lisa kaudu), valikut sõidu, jalgrattasõidu, jalakäijate režiimide, OSM redigeerimise ja palju muu vahel. +\n Naudi hääl- ja optilist navigaatorit, HP-de (huvipunktide) vaatamist, GPX radade loomist ja haldamist, kõrgusjoonte visuaalse kuvamise ja kõrguse teabe kasutamist (lisa kaudu), valikut sõidu, jalgrattasõidu, jalakäijate režiimide, OSM\'i andmete muutmise ja palju muu vahel. Kaart \n • Kuvab HP-d (huvipunktid) sinu ümber \n • Kohandab kaarti sinu liikumissuunaga (või kompassiga) @@ -3557,7 +3557,7 @@ Helitugevuse nupud toimivad suumina Palun sisestage punkti nimi Lae alla Vikipeedia kaardid - Hangi huviväärsuste kohta teavet Vikipeediast. See on sinu võrguühenduseta reisiraamat - luba lihtsalt Vikipeedia lisaprogramm ja loe artikleid enda ümber asuvate objektide kohta. + Hangi huviväärsuste kohta teavet Vikipeediast. See on sinu võrguühenduseta reisiraamat - lihtsalt võta kasutusele Vikipeedia lisaprogramm ja loe artikleid enda ümber asuvate objektide kohta. Kuna valitud grupp on peidetud, siis lisatud punkt ei ole kaardil nähtav. Vajadusel leiad ta „%s“ alt. Kartauto Parkimiskohad @@ -3728,7 +3728,7 @@ Kärbi enne Kinnita teede külge Selle valiku kasutamiseks mõne oma navigeerimisprofiili kasutamisel kinnita oma rada lähimale lubatud teele. - Valitud profiili alusel arvutatakse uus teekond vaid järgmise segmendi osas. + Selle valitud profiili alusel arvutatakse uus teekond vaid järgmise segmendi osas. Põhitegevused Ostu kinnitusel võetakse sinu Google Play kontolt tasu. \n @@ -3737,7 +3737,7 @@ \nTellimuste haldamiseks ja tühistamiseks ava Google Play seadistused. Kiirtegevusi saad eksportida või importida koos rakenduse profiilidega. Kas sa oled kindel, et soovid pöördumatult kustutada %d kiirtegevust\? - Vali kas soovid ühendada punkte sirge joonega või arvutada nendevahelist teekonda vastavalt oma valitud profiilile. + Vali kas soovid ühendada punkte sirge joonega või arvutada nendevahelist teekonda selle alusel kuidas järgnevalt on määratud. • Uuendatud teekonnaplaneerija: võimaldab kasutada igal segmendil erinevat liikumisviisi ning radade kaasamist \n \n • Uus radade kujunduse seadistamise menüü: valida saad värve, joone paksust, suunanoolte kuvamist ning alguse ja lõpu ikoone From 18572799c407de22758cd7f71adbb46e593cd9a1 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 17 Sep 2020 13:50:04 +0300 Subject: [PATCH 13/20] Rename string value --- OsmAnd/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 3f8159283b..c497ffda36 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -3251,7 +3251,7 @@ The selected language is not supported by the Android TTS (text-to-speech) engine installed, its preset TTS language will be used instead. Look for another TTS engine in the market? Missing data Go to the market to download selected language? - Reverse GPX direction + Reverse track direction Use current destination Pass along entire track From 90292541ef92f067f3e143549321820f629e8b39 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 14:34:33 +0300 Subject: [PATCH 14/20] Show context menu with coordinates on long tap --- OsmAnd/src/net/osmand/plus/views/layers/ContextMenuLayer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/layers/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/ContextMenuLayer.java index 4567770e9c..7a8690fe2d 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/ContextMenuLayer.java @@ -323,7 +323,9 @@ public class ContextMenuLayer extends OsmandMapLayer { return false; } - showContextMenu(point, tileBox, true); + LatLon pointLatLon = tileBox.getLatLonFromPixel(point.x, point.y); + menu.show(pointLatLon, null, null); + view.refreshMap(); return true; } From 2f6ccfe6be048b5cbebe9138214238afde34fafb Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 17 Sep 2020 15:26:18 +0300 Subject: [PATCH 15/20] Fix #9555 --- .../net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java | 4 ++-- OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index e40a911027..da7a7882d3 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -149,10 +149,10 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { underlayLayer.setMap(null); } if(settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.UNDERLAY && - underlayLayer.getMap() != null) { + underlayLayer.getMap() != null || underlayLayer.getMapTileAdapter() != null) { layers.getMapControlsLayer().showTransparencyBar(settings.MAP_TRANSPARENCY, true); } else if(settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get() == LayerTransparencySeekbarMode.OVERLAY && - overlayLayer.getMap() != null) { + overlayLayer.getMap() != null || overlayLayer.getMapTileAdapter() != null) { layers.getMapControlsLayer().showTransparencyBar(settings.MAP_OVERLAY_TRANSPARENCY, true); } else { layers.getMapControlsLayer().hideTransparencyBar(); diff --git a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java index a58713c4cc..1118cfd514 100644 --- a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java +++ b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java @@ -25,6 +25,7 @@ public class YandexTrafficAdapter extends MapTileAdapter { private final static Log log = PlatformUtil.getLog(MapTileLayer.class); private final static String YANDEX_PREFFIX = ".YandexTraffic_"; + private final static String YANDEX_BASE_URL = "https://core-jams-rdr.maps.yandex.net"; private static final long DELTA = 10 * 60 * 1000; private long lastTimestampUpdated; @@ -59,11 +60,6 @@ public class YandexTrafficAdapter extends MapTileAdapter { } protected void updateTimeStampImpl() { - String YANDEX_BASE_URL; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) - YANDEX_BASE_URL = "https://core-jams-rdr.maps.yandex.net"; - else - YANDEX_BASE_URL = "http://core-jams-rdr.maps.yandex.net"; if (mTimestamp == null || (System.currentTimeMillis() - lastTimestampUpdated) > DELTA) { log.info("Updating timestamp"); //$NON-NLS-1$ try { From 6e41ea64b3a145257cf07058f5179a8b2e46c09e Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 17 Sep 2020 15:43:04 +0200 Subject: [PATCH 16/20] Fix gpx approximation --- OsmAnd/src/net/osmand/plus/routing/GpxApproximator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/GpxApproximator.java b/OsmAnd/src/net/osmand/plus/routing/GpxApproximator.java index 61d8408fe6..4650d527ae 100644 --- a/OsmAnd/src/net/osmand/plus/routing/GpxApproximator.java +++ b/OsmAnd/src/net/osmand/plus/routing/GpxApproximator.java @@ -91,8 +91,8 @@ public class GpxApproximator { this.env = routingHelper.getRoutingEnvironment(ctx, mode, start, end); } - private GpxRouteApproximation getNewGpxApproximationContext(@Nullable GpxRouteApproximation gctx) { - GpxRouteApproximation newContext = gctx != null ? new GpxRouteApproximation(gctx) : new GpxRouteApproximation(env.getCtx()); + private GpxRouteApproximation getNewGpxApproximationContext() { + GpxRouteApproximation newContext = new GpxRouteApproximation(env.getCtx()); newContext.ctx.calculationProgress = new RouteCalculationProgress(); newContext.MINIMUM_POINT_APPROXIMATION = pointApproximation; return newContext; @@ -100,7 +100,7 @@ public class GpxApproximator { private List getPoints() { if (points == null) { - points = routingHelper.generateGpxPoints(env, getNewGpxApproximationContext(null), locationsHolder); + points = routingHelper.generateGpxPoints(env, getNewGpxApproximationContext(), locationsHolder); } List points = new ArrayList<>(this.points.size()); for (GpxPoint p : this.points) { @@ -150,7 +150,7 @@ public class GpxApproximator { if (gctx != null) { gctx.ctx.calculationProgress.isCancelled = true; } - final GpxRouteApproximation gctx = getNewGpxApproximationContext(this.gctx); + final GpxRouteApproximation gctx = getNewGpxApproximationContext(); this.gctx = gctx; startProgress(); updateProgress(gctx); From ed0f5a4c48fa1985253890a80b07acf7690ef771 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 16:58:02 +0300 Subject: [PATCH 17/20] Add ability to sort tracks initial commit --- .../plus/myplaces/AvailableGPXFragment.java | 43 ++++++++++++++++++- .../plus/settings/backend/OsmandSettings.java | 3 ++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 6e862b5d4b..4e3da567af 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -37,6 +37,7 @@ import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; +import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; @@ -102,7 +103,11 @@ import java.util.regex.Pattern; import static net.osmand.plus.GpxSelectionHelper.CURRENT_TRACK; import static net.osmand.plus.myplaces.FavoritesActivity.GPX_TAB; import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID; -import static net.osmand.util.Algorithms.*; +import static net.osmand.util.Algorithms.capitalizeFirstLetter; +import static net.osmand.util.Algorithms.collectDirs; +import static net.osmand.util.Algorithms.formatDuration; +import static net.osmand.util.Algorithms.objectEquals; +import static net.osmand.util.Algorithms.removeAllFiles; public class AvailableGPXFragment extends OsmandExpandableListFragment implements FavoritesFragmentStateHolder { @@ -129,6 +134,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement private boolean importing = false; private View emptyView; private GpxSelectionHelper.SelectGpxTaskListener gpxTaskListener; + private boolean sortByName; @Override public void onCreate(@Nullable Bundle savedInstanceState) { @@ -157,6 +163,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement public void onAttach(Context activity) { super.onAttach(activity); this.app = (OsmandApplication) getActivity().getApplication(); + sortByName = app.getSettings().SORT_TRACKS_BY_NAME.get(); final Collator collator = Collator.getInstance(); collator.setStrength(Collator.SECONDARY); currentRecording = new GpxInfo(getMyApplication().getSavingTrackHelper().getCurrentGpx(), getString(R.string.shared_string_currently_recording_track)); @@ -495,6 +502,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement addTrack(); }else if (itemId == R.string.coordinate_input) { openCoordinatesInput(); + } else if (itemId == R.string.shared_string_sort) { + updateTracksSort(); } return true; } @@ -512,6 +521,8 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement .setIcon(R.drawable.ic_action_delete_dark).setListener(listener).createItem()); optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_refresh, getActivity()) .setIcon(R.drawable.ic_action_refresh_dark).setListener(listener).createItem()); + optionsMenuAdapter.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.shared_string_sort, getActivity()) + .setIcon(getSortIconId(!sortByName)).setListener(listener).createItem()); OsmandPlugin.onOptionsMenuActivity(getActivity(), this, optionsMenuAdapter); for (int j = 0; j < optionsMenuAdapter.length(); j++) { final MenuItem item; @@ -536,6 +547,11 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement } } + @DrawableRes + private int getSortIconId(boolean sortByName) { + return sortByName ? R.drawable.ic_action_sort_by_name : R.drawable.ic_action_list_sort; + } + public void doAction(int actionResId) { if (actionResId == R.string.shared_string_delete) { operationTask = new DeleteGpxTask(); @@ -554,6 +570,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement for (int i = 0; i < optionsMenuAdapter.length(); i++) { ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i); if (itemId == contextMenuItem.getTitleId()) { + if (itemId == R.string.shared_string_sort) { + item.setIcon(getSortIconId(!sortByName)); + } contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false, null); return true; } @@ -565,6 +584,12 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement ((FavoritesActivity) getActivity()).addTrack(); } + private void updateTracksSort() { + sortByName = !sortByName; + app.getSettings().SORT_TRACKS_BY_NAME.set(sortByName); + reloadTracks(); + } + private void openCoordinatesInput() { CoordinateInputDialogFragment fragment = new CoordinateInputDialogFragment(); fragment.setRetainInstance(true); @@ -929,6 +954,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement @Override protected void onPostExecute(List result) { this.result = result; + allGpxAdapter.sort(); allGpxAdapter.refreshSelected(); hideProgressBar(); listView.setEmptyView(emptyView); @@ -1112,8 +1138,21 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement data.get(category.get(found)).add(info); } - // disable sort public void sort() { + for (List items : data.values()) { + Collections.sort(items, new Comparator() { + @Override + public int compare(GpxInfo i1, GpxInfo i2) { + if (sortByName) { + return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase()); + } else { + long modified1 = i1.file.lastModified(); + long modified2 = i2.file.lastModified(); + return (modified1 < modified2) ? -1 : ((modified1 == modified2) ? 0 : 1); + } + } + }); + } Collections.sort(category, new Comparator() { @Override public int compare(String lhs, String rhs) { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 4baca18a19..a860d4c65c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -3936,6 +3936,9 @@ public class OsmandSettings { public final CommonPreference FAVORITES_TAB = new IntPreference("FAVORITES_TAB", 0).makeGlobal().cache(); + public final CommonPreference SORT_TRACKS_BY_NAME + = new BooleanPreference("sort_tracks_by_name", true).makeGlobal().cache(); + public final CommonPreference OSMAND_THEME = new IntPreference("osmand_theme", OSMAND_LIGHT_THEME) { @Override From 080d9f4794f21bf430a3e43451252e8c8a67785c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 17:46:02 +0300 Subject: [PATCH 18/20] Fix sorting selected tracks --- .../plus/myplaces/AvailableGPXFragment.java | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 4e3da567af..3856615d8e 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -570,10 +570,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement for (int i = 0; i < optionsMenuAdapter.length(); i++) { ContextMenuItem contextMenuItem = optionsMenuAdapter.getItem(i); if (itemId == contextMenuItem.getTitleId()) { + contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false, null); if (itemId == R.string.shared_string_sort) { item.setIcon(getSortIconId(!sortByName)); } - contextMenuItem.getItemClickListener().onContextMenuClick(null, itemId, i, false, null); return true; } } @@ -954,7 +954,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement @Override protected void onPostExecute(List result) { this.result = result; - allGpxAdapter.sort(); allGpxAdapter.refreshSelected(); hideProgressBar(); listView.setEmptyView(emptyView); @@ -974,11 +973,15 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement Arrays.sort(listFiles, new Comparator() { @Override public int compare(File f1, File f2) { - // here we could guess date from file name '2017-08-30 ...' - first part date - if (f1.lastModified() == f2.lastModified()) { + if (sortByName) { return -f1.getName().compareTo(f2.getName()); + } else { + // here we could guess date from file name '2017-08-30 ...' - first part date + if (f1.lastModified() == f2.lastModified()) { + return -f1.getName().compareTo(f2.getName()); + } + return -Long.compare(f1.lastModified(), f2.lastModified()); } - return -Long.compare(f1.lastModified(), f2.lastModified()); } }); return listFiles; @@ -995,8 +998,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement } private void loadGPXFolder(File mapPath, List result, LoadGpxTask loadTask, List progress, - String gpxSubfolder) { - for (File gpxFile : listFilesSorted(mapPath)) { + String gpxSubfolder) { + File[] listFiles = listFilesSorted(mapPath); + for (File gpxFile : listFiles) { if (gpxFile.isDirectory()) { String sub = gpxSubfolder.length() == 0 ? gpxFile.getName() : gpxSubfolder + "/" + gpxFile.getName(); @@ -1011,7 +1015,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement loadTask.loadFile(progress.toArray(new GpxInfo[progress.size()])); progress.clear(); } - } } } @@ -1019,7 +1022,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement public List getResult() { return result; } - } protected class GpxIndexesAdapter extends OsmandBaseExpandableListAdapter implements Filterable { @@ -1076,7 +1078,16 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement Collections.sort(selected, new Comparator() { @Override public int compare(GpxInfo i1, GpxInfo i2) { - return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase()); + if (sortByName) { + return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase()); + } else { + long time1 = i1.file.lastModified(); + long time2 = i2.file.lastModified(); + if (time1 == time2) { + return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase()); + } + return -Long.compare(time1, time2); + } } }); } From 068e2ef3b5d003bf8f167aef85ebf1bd6a937064 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 17 Sep 2020 17:47:58 +0300 Subject: [PATCH 19/20] remove unnecessary changes --- .../osmand/plus/myplaces/AvailableGPXFragment.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 3856615d8e..8432080bc8 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -1150,20 +1150,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment implement } public void sort() { - for (List items : data.values()) { - Collections.sort(items, new Comparator() { - @Override - public int compare(GpxInfo i1, GpxInfo i2) { - if (sortByName) { - return i1.getName().toLowerCase().compareTo(i2.getName().toLowerCase()); - } else { - long modified1 = i1.file.lastModified(); - long modified2 = i2.file.lastModified(); - return (modified1 < modified2) ? -1 : ((modified1 == modified2) ? 0 : 1); - } - } - }); - } Collections.sort(category, new Comparator() { @Override public int compare(String lhs, String rhs) { From 25ec3c2059f1735960a3c1576c080cfbee292bc9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 17 Sep 2020 18:05:45 +0300 Subject: [PATCH 20/20] Added icons for sorting menu --- .../ic_action_sort_by_name_ascending.xml | 31 +++++++++++++++++++ .../ic_action_sort_by_name_descending.xml | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 OsmAnd/res/drawable/ic_action_sort_by_name_ascending.xml create mode 100644 OsmAnd/res/drawable/ic_action_sort_by_name_descending.xml diff --git a/OsmAnd/res/drawable/ic_action_sort_by_name_ascending.xml b/OsmAnd/res/drawable/ic_action_sort_by_name_ascending.xml new file mode 100644 index 0000000000..07406ae2c7 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_sort_by_name_ascending.xml @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/OsmAnd/res/drawable/ic_action_sort_by_name_descending.xml b/OsmAnd/res/drawable/ic_action_sort_by_name_descending.xml new file mode 100644 index 0000000000..04cd095335 --- /dev/null +++ b/OsmAnd/res/drawable/ic_action_sort_by_name_descending.xml @@ -0,0 +1,31 @@ + + + + + + + +