From 81ff45360bd8f37688ac707e548a74da508ac73e Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Mon, 30 Nov 2020 18:52:32 +0200 Subject: [PATCH 01/18] Fix next button in favorite name --- OsmAnd/res/layout/point_editor_fragment_new.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml index 9be9841750..679ca022fe 100644 --- a/OsmAnd/res/layout/point_editor_fragment_new.xml +++ b/OsmAnd/res/layout/point_editor_fragment_new.xml @@ -93,6 +93,7 @@ android:paddingRight="@dimen/content_padding_small" android:scrollHorizontally="false" android:textSize="@dimen/default_list_text_size" + android:imeOptions="actionDone" tools:text="@string/lorem_ipsum" /> @@ -143,6 +144,7 @@ android:paddingEnd="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding_small" android:textSize="@dimen/default_list_text_size" + android:imeOptions="actionDone" tools:text="@string/lorem_ipsum" /> @@ -253,6 +255,7 @@ android:text="@string/add_description" android:textSize="@dimen/default_desc_text_size" osmand:typeface="@string/font_roboto_medium" + android:imeOptions="actionDone" tools:text="@string/add_description" /> Date: Tue, 1 Dec 2020 23:06:58 +0200 Subject: [PATCH 02/18] Fix issue #10275 --- .../plus/activities/DownloadTilesDialog.java | 65 ++++++++++--------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java b/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java index 6749b1e118..677a094f62 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java @@ -36,19 +36,17 @@ import java.util.List; public class DownloadTilesDialog { - - private final static Log log = PlatformUtil.getLog(DownloadTilesDialog.class); + private final static Log log = PlatformUtil.getLog(DownloadTilesDialog.class); private final Context ctx; private final OsmandApplication app; private final OsmandMapTileView mapView; - public DownloadTilesDialog(Context ctx, OsmandApplication app, OsmandMapTileView mapView){ + public DownloadTilesDialog(Context ctx, OsmandApplication app, OsmandMapTileView mapView) { this.ctx = ctx; this.app = app; this.mapView = mapView; } - public void openDialog(){ BaseMapLayer mainLayer = mapView.getMainLayer(); if (!(mainLayer instanceof MapTileLayer) || !((MapTileLayer) mainLayer).isVisible()) { @@ -77,7 +75,8 @@ public class DownloadTilesDialog { final TextView downloadText = ((TextView) view.findViewById(R.id.DownloadDescription)); final String template = ctx.getString(R.string.tiles_to_download_estimated_size); - updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) slider.getValue()); + final boolean ellipticYTile = mapSource.isEllipticYTile(); + updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) slider.getValue(), ellipticYTile); if (max > zoom) { slider.setValueTo(max - zoom); int progress = (max - zoom) / 2; @@ -85,7 +84,7 @@ public class DownloadTilesDialog { slider.addOnChangeListener(new Slider.OnChangeListener() { @Override public void onValueChange(@NonNull Slider slider, float value, boolean fromUser) { - updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) value); + updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) value, ellipticYTile); } }); } @@ -105,22 +104,16 @@ public class DownloadTilesDialog { private volatile boolean cancel = false; private IMapDownloaderCallback callback; - public void run(final int zoom, final int progress, final QuadRect latlonRect, final ITileSource map){ + public void run(final int zoom, final int progress, final QuadRect latlonRect, final ITileSource map) { cancel = false; - int numberTiles = 0; - for (int z = zoom; z <= progress + zoom; z++) { - int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left); - int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right); - int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); - int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); - numberTiles += (x2 - x1 + 1) * (y2 - y1 + 1); - } + final boolean ellipticYTile = map.isEllipticYTile(); + int numberTiles = getNumberTiles(zoom, progress, latlonRect, ellipticYTile); final ProgressDialog progressDlg = new ProgressDialog(ctx); progressDlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDlg.setMessage(ctx.getString(R.string.shared_string_downloading)); progressDlg.setCancelable(true); progressDlg.setMax(numberTiles); - progressDlg.setOnCancelListener(new DialogInterface.OnCancelListener(){ + progressDlg.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { @@ -152,8 +145,15 @@ public class DownloadTilesDialog { for (int z = zoom; z <= zoom + progress && !cancel; z++) { int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left); int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right); - int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); - int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); + int y1; + int y2; + if (ellipticYTile) { + y1 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.top); + y2 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.bottom); + } else { + y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); + y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); + } for (int x = x1; x <= x2 && !cancel; x++) { for (int y = y1; y <= y2 && !cancel; y++) { String tileId = rm.calculateTileId(map, x, y, z); @@ -178,7 +178,6 @@ public class DownloadTilesDialog { } } } - } if(cancel){ instance.refuseAllPreviousRequests(); @@ -205,26 +204,34 @@ public class DownloadTilesDialog { } progressDlg.dismiss(); } - }; - - - new Thread(r, "Downloading tiles").start(); //$NON-NLS-1$ progressDlg.show(); } + private void updateLabel(final int zoom, final QuadRect latlonRect, final TextView downloadText, + final String template, int progress, boolean ellipticYTile) { + int numberTiles = getNumberTiles(zoom, progress, latlonRect, ellipticYTile); + downloadText.setText(MessageFormat.format(template, (progress + zoom) + "", + numberTiles, (double) numberTiles * 12 / 1000)); + } - private void updateLabel(final int zoom, final QuadRect latlonRect, final TextView downloadText, final String template, int progress) { + private int getNumberTiles(int zoom, int progress, QuadRect latlonRect, boolean ellipticYTile) { int numberTiles = 0; for (int z = zoom; z <= progress + zoom; z++) { int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left); int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right); - int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); - int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); + int y1; + int y2; + if (ellipticYTile) { + y1 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.top); + y2 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.bottom); + } else { + y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); + y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); + } numberTiles += (x2 - x1 + 1) * (y2 - y1 + 1); } - downloadText.setText(MessageFormat.format(template, (progress + zoom)+"", //$NON-NLS-1$ - numberTiles, (double)numberTiles*12/1000)); + return numberTiles; } -} +} \ No newline at end of file From 09d5891f2431028d7d15588b16b4d6d2bbafaa6d Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Tue, 1 Dec 2020 16:16:26 +0000 Subject: [PATCH 03/18] Translated using Weblate (Italian) Currently translated at 89.2% (3191 of 3574 strings) --- OsmAnd/res/values-it/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 0a6aae70fe..ee6c2900a4 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3999,4 +3999,6 @@ Scegli la foto %1$s * %2$s German (casual) + Puoi utililizzare i dati dell\'altitudine per valutare la salita e la discesa del tuo percorso + Ultraleggeri \ No newline at end of file From 1c11cb92539577d9d27f000c49393bec8471e0db Mon Sep 17 00:00:00 2001 From: Ldm Public Date: Tue, 1 Dec 2020 02:30:32 +0000 Subject: [PATCH 04/18] Translated using Weblate (French) Currently translated at 99.8% (3570 of 3574 strings) --- OsmAnd/res/values-fr/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 7973ff27cd..771d0674f6 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -3977,4 +3977,5 @@ Sélectionnez une image %1$s * %2$s Allemand (courant) + Aviation légère \ No newline at end of file From bd27dfa3d4e1558a4286dc4b3b24e3b3332bcbb8 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Tue, 1 Dec 2020 08:08:53 +0000 Subject: [PATCH 05/18] Translated using Weblate (Ukrainian) Currently translated at 100.0% (3574 of 3574 strings) --- OsmAnd/res/values-uk/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 2a9bae4b58..40c02a5830 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3997,4 +3997,6 @@ Вибрати зображення %1$s * %2$s Німецька (неформальна) + Ви можете використовувати дані про висоту для розгляду сходження / спуску для вашої подорожі + Легкий літак \ No newline at end of file From 6a9aee7e6b6d5aee083cd6b9219a5e5b67501b28 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Tue, 1 Dec 2020 06:16:33 +0000 Subject: [PATCH 06/18] Translated using Weblate (Hebrew) Currently translated at 99.8% (3570 of 3574 strings) --- OsmAnd/res/values-iw/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index f8d10bfa90..ef3ad7571e 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -4003,4 +4003,6 @@ בחירת תמונה גרמנית (עממית) ‏%1$s‏ * %2$s + אפשר להשתמש בנתוני רום לצורך התחשבות בעליה / ירידה במהלך הטיול + כלי טיס קל \ No newline at end of file From 5dffb6636add38ee674c9e8c4fc72ffdfcab7c42 Mon Sep 17 00:00:00 2001 From: Michal L Date: Tue, 1 Dec 2020 20:06:19 +0000 Subject: [PATCH 07/18] Translated using Weblate (Polish) Currently translated at 99.6% (3562 of 3574 strings) --- OsmAnd/res/values-pl/strings.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index e0572077bc..dc8809751f 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -3028,7 +3028,7 @@ Pobrane mapy Odwiedzane ekrany Zebrane Informacje - Narciarstwo alpejskie/zjazdowe + Narciarstwo alpejskie i zjazdowe Określ, które dane pozwalasz OsmAnd udostępniać. Pomóż nam poznać popularność map krajów i regionów. Pomóż nam poznać popularność funkcji OsmAnd. @@ -3962,9 +3962,9 @@ Zaloguj się do OpenStreetMap Zaloguj się do OpenStreetMap.org Zaloguj się za pomocą OpenStreetMap - Zaloguj się, aby przesłać nowe lub zmodyfikowane zmiany, + Musisz zalogować się, aby przesłać nowe lub zmodyfikowane zmiany, \n -\nza pomocą protokołu OAuth lub nazwy użytkownika i hasła. +\nMożesz zalogować się za pomocą protokołu OAuth lub loginu i hasła. Użyj loginu i hasła Konto Zamknij uwagę OSM @@ -4004,4 +4004,5 @@ Wybierz zdjęcie Nie można przesłać obrazu, spróbuj ponownie później %1$s * %2$s + Niemiecki (styl potoczny) \ No newline at end of file From 9558b374a16acbd0af6900975880aa7d185cd550 Mon Sep 17 00:00:00 2001 From: Ajeje Brazorf Date: Tue, 1 Dec 2020 15:09:31 +0000 Subject: [PATCH 08/18] Translated using Weblate (Sardinian) Currently translated at 99.7% (3564 of 3574 strings) --- OsmAnd/res/values-sc/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 9ea89f1e1d..82d6e3dbdd 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3998,4 +3998,6 @@ Ischerta un\'immàgine %1$s * %2$s Tedescu (informale) + Podes impreare sos datos de s\'artària pro pigare in cunsideru s\'Artziada / Achirrada pro su biàgiu tuo + Aèreu lèbiu \ No newline at end of file From 29fa46d7bd81623bc39655687d29557bd62f19ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1ns?= Date: Tue, 1 Dec 2020 19:56:33 +0000 Subject: [PATCH 09/18] Translated using Weblate (Galician) Currently translated at 100.0% (3574 of 3574 strings) --- OsmAnd/res/values-gl/strings.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml index 148c7fe98c..42fb8639e7 100644 --- a/OsmAnd/res/values-gl/strings.xml +++ b/OsmAnd/res/values-gl/strings.xml @@ -187,7 +187,7 @@ Chinés sinxelo Eslovaco Esloveno - Español ou castelán + Español Sueco Chinés tradicional Turco @@ -1420,7 +1420,7 @@ Bengalí Tagalo Serbo-croata - Azarí ou acerbaixano + Azarí Bretón Albanés Islandés @@ -4024,4 +4024,7 @@ Lon %2$s \nMapillary - maxes a nivel de rúa; \nWeb / Wikimedia - imaxes POI especificadas nos datos do OpenStreetMap. %1$s * %2$s + Alemán casual + Podes empregar os datos de elevación para considerar o ascenso ou descenso da túa viaxe + Avión lixeiro \ No newline at end of file From b2879a3476ea9731783b8baa9532fde33b9836f6 Mon Sep 17 00:00:00 2001 From: Michal L Date: Tue, 1 Dec 2020 20:51:08 +0000 Subject: [PATCH 10/18] Translated using Weblate (Polish) Currently translated at 99.5% (3843 of 3860 strings) --- OsmAnd/res/values-pl/phrases.xml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-pl/phrases.xml b/OsmAnd/res/values-pl/phrases.xml index c3a1752338..8774ca645c 100644 --- a/OsmAnd/res/values-pl/phrases.xml +++ b/OsmAnd/res/values-pl/phrases.xml @@ -2705,8 +2705,8 @@ Konsulat generalny Konsul honorowy Misja dyplomatyczna - Ambasada - Delegacja UE + Rezydencja ambasadora + Delegacja Wysoka komisja Inskrypcja: N (północ) Inskrypcja: NW (północny-zachód) @@ -3849,4 +3849,27 @@ Wiaty parkingowe Punkt GPX Ul + Nie + Tak + Nie + Tak + Nie + Tak + Biuro + Konsulat generalny + Agencja konsularna + Kierowany przez konsula + Rezydencja + Nuncjatura + Misja + Wysoka komisja + Delegacja + Dział + Na czele z ambasadorem + Ambasada + Usługi dla obywateli + Wizy imigracyjne + Wizy nieimigracyjne + Konsulat + Ambasada \ No newline at end of file From 1a5c1d8616da4802a2ee81b624700e8bca19f224 Mon Sep 17 00:00:00 2001 From: Franco Date: Tue, 1 Dec 2020 00:41:55 +0000 Subject: [PATCH 11/18] Translated using Weblate (Spanish (Argentina)) Currently translated at 99.9% (3573 of 3574 strings) --- OsmAnd/res/values-es-rAR/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index ad7cfd72c1..a23b608939 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -4006,4 +4006,6 @@ Elegir imagen Alemán (casual) %1$s * %2$s + Puedes usar los datos de elevación para considerar el ascenso o descenso de su viaje + Avión ligero \ No newline at end of file From ac91a6852906b8b7cdbd545a393cb2208d579534 Mon Sep 17 00:00:00 2001 From: Jeff Huang Date: Tue, 1 Dec 2020 01:48:40 +0000 Subject: [PATCH 12/18] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (3574 of 3574 strings) --- OsmAnd/res/values-zh-rTW/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index a5994b6225..bd6e77050f 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3996,4 +3996,6 @@ 選取圖片 德語(非正式) %1$s * %2$s + 您可以將海拔資料用於您旅程的上升與下降 + 輕型飛機 \ No newline at end of file From 90a4f2fbb71e9a9a8e2ea9cf61018a25a7a4aa81 Mon Sep 17 00:00:00 2001 From: x Date: Tue, 1 Dec 2020 21:28:48 +0000 Subject: [PATCH 13/18] Translated using Weblate (Italian) Currently translated at 89.4% (3197 of 3574 strings) --- OsmAnd/res/values-it/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index ee6c2900a4..d5785755cd 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3981,10 +3981,10 @@ \"Tracciabile\" significa che la traccia non è visualizzabile in alcuna lista pubblica, ma solo i suoi punti, processati, con le informazioni temporali (che non possono essere direttamente associati a te) attraverso le API GPS pubbliche. Aggiungi a Mapillary Aggiungi a OpenPlaceReviews - OsmAnd mostra foto da più sorgenti: -\nOpenPlaceReviews - foto PDI; + OsmAnd mostra foto da diverse fonti: +\nOpenPlaceReviews - foto POI; \nMapillary - immagini stradali; -\nWeb / Wikimedia - foto PDI OpenStreetMap. +\nWeb / Wikimedia - foto POI specificate nei dati di OpenStreetMap. Risorse Dimesione approssimativa del file Seleziona i dati da esportare nel file. @@ -3998,7 +3998,7 @@ Impossibile caricare l\'immagine, riprovare in seguito Scegli la foto %1$s * %2$s - German (casual) - Puoi utililizzare i dati dell\'altitudine per valutare la salita e la discesa del tuo percorso + Tedesco (informale) + Puoi utililizzare i dati dell\'altitudine per valutare la Salita/Discesa del tuo percorso Ultraleggeri \ No newline at end of file From eadfc1ab40702c4f39f18c718c34226aae7e615d Mon Sep 17 00:00:00 2001 From: x Date: Tue, 1 Dec 2020 21:30:00 +0000 Subject: [PATCH 14/18] Translated using Weblate (Italian) Currently translated at 100.0% (271 of 271 strings) Translation: OsmAnd/Telegram Translate-URL: https://hosted.weblate.org/projects/osmand/telegram/it/ --- OsmAnd-telegram/res/values-it/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd-telegram/res/values-it/strings.xml b/OsmAnd-telegram/res/values-it/strings.xml index 6d1e62edc7..44afa34bce 100644 --- a/OsmAnd-telegram/res/values-it/strings.xml +++ b/OsmAnd-telegram/res/values-it/strings.xml @@ -269,4 +269,8 @@ Logcat buffer Invia rapporto Esporta + Specifica l\'unità di misura della velocità. + Seleziona il fuso orario da mostrare nei messaggi sulla posizione. + Tempo di scadenza del buffer + Tempo massimo per memorizzare i punti nel buffer \ No newline at end of file From 3d38374a21258030f19a79614e023139afb377f4 Mon Sep 17 00:00:00 2001 From: xmd5a Date: Wed, 2 Dec 2020 12:51:48 +0300 Subject: [PATCH 15/18] Add phrases --- OsmAnd/res/values-ru/phrases.xml | 2 ++ OsmAnd/res/values/phrases.xml | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 8f3eba7cf1..c3980aa38b 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -3868,4 +3868,6 @@ Консульское агентство Раздел интересов Консульство + Сирена + \ No newline at end of file diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index 360f1d8718..f59133bca5 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4300,4 +4300,11 @@ Yes No + Mobile money agent + + Car pooling + Nurse + + Siren + From 10e8ffdfa2e583d832c812d473fb302c1db7839f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 2 Dec 2020 12:28:51 +0200 Subject: [PATCH 16/18] Remove duplicate phrase --- OsmAnd/res/values/phrases.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index f59133bca5..c38d838285 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -4302,7 +4302,6 @@ Mobile money agent - Car pooling Nurse Siren From ba569bb809ec70724273ff21e0778b510c383587 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 2 Dec 2020 13:04:17 +0200 Subject: [PATCH 17/18] Fix tracker compilation --- .../net/osmand/telegram/TelegramSettings.kt | 22 ++++---- .../telegram/helpers/ShowLocationHelper.kt | 2 +- .../osmand/telegram/ui/SetTimeBottomSheet.kt | 52 ++++++++++--------- .../osmand/telegram/ui/TimelineTabFragment.kt | 34 ++++++------ .../telegram/ui/views/BottomSheetDialog.kt | 4 +- .../osmand/telegram/ui/views/TextViewEx.kt | 2 +- 6 files changed, 62 insertions(+), 54 deletions(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt index a6a2377118..efdb35edf1 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt @@ -699,18 +699,20 @@ class TelegramSettings(private val app: TelegramApplication) { val hiddenChats = mutableSetOf() val hiddenChatsSet = prefs.getStringSet(HIDDEN_ON_MAP_CHATS_KEY, mutableSetOf()) - for (chatId in hiddenChatsSet) { - hiddenChats.add(chatId.toLong()) + hiddenChatsSet?.let { + for (chatId in it) { + hiddenChats.add(chatId.toLong()) + } } hiddenOnMapChats = hiddenChats metricsConstants = MetricsConstants.valueOf( - prefs.getString(METRICS_CONSTANTS_KEY, MetricsConstants.KILOMETERS_AND_METERS.name) + prefs.getString(METRICS_CONSTANTS_KEY, MetricsConstants.KILOMETERS_AND_METERS.name)!! ) speedConstants = SpeedConstants.valueOf( - prefs.getString(SPEED_CONSTANTS_KEY, SpeedConstants.KILOMETERS_PER_HOUR.name) + prefs.getString(SPEED_CONSTANTS_KEY, SpeedConstants.KILOMETERS_PER_HOUR.name)!! ) - utcOffset = prefs.getString(UTC_OFFSET_CONSTANTS_KEY, DataConstants.UTC_FORMAT) + utcOffset = prefs.getString(UTC_OFFSET_CONSTANTS_KEY, DataConstants.UTC_FORMAT)!! try { parseShareChatsInfo(JSONArray(prefs.getString(SHARE_CHATS_INFO_KEY, ""))) @@ -724,7 +726,7 @@ class TelegramSettings(private val app: TelegramApplication) { log.error(e) } - parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, "")) + parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, "")!!) val sendMyLocDef = SEND_MY_LOC_VALUES_SEC[SEND_MY_LOC_DEFAULT_INDEX] sendMyLocInterval = prefs.getLong(SEND_MY_LOC_INTERVAL_KEY, sendMyLocDef) @@ -733,7 +735,7 @@ class TelegramSettings(private val app: TelegramApplication) { val locHistoryDef = LOC_HISTORY_VALUES_SEC[LOC_HISTORY_DEFAULT_INDEX] locHistoryTime = prefs.getLong(LOC_HISTORY_TIME_KEY, locHistoryDef) val shareTypeDef = SHARE_TYPE_VALUES[SHARE_TYPE_DEFAULT_INDEX] - shareTypeValue = prefs.getString(SHARE_TYPE_KEY, shareTypeDef) + shareTypeValue = prefs.getString(SHARE_TYPE_KEY, shareTypeDef)!! val minLocationDistanceDef = MIN_LOCATION_DISTANCE[MIN_LOCATION_DISTANCE_INDEX] minLocationDistance = prefs.getFloat(MIN_LOCATION_DISTANCE_KEY, minLocationDistanceDef) @@ -743,13 +745,13 @@ class TelegramSettings(private val app: TelegramApplication) { minLocationSpeed = prefs.getFloat(MIN_LOCATION_SPEED_KEY, minLocationSpeedDef) val currentUserId = app.telegramHelper.getCurrentUserId() - currentSharingMode = prefs.getString(SHARING_MODE_KEY, if (currentUserId != -1) currentUserId.toString() else "") + currentSharingMode = prefs.getString(SHARING_MODE_KEY, if (currentUserId != -1) currentUserId.toString() else "")!! val defPackage = if (AppConnect.getInstalledApps(app).size == 1) AppConnect.getInstalledApps(app).first().appPackage else "" - appToConnectPackage = prefs.getString(APP_TO_CONNECT_PACKAGE_KEY, defPackage) + appToConnectPackage = prefs.getString(APP_TO_CONNECT_PACKAGE_KEY, defPackage)!! liveNowSortType = LiveNowSortType.valueOf( - prefs.getString(LIVE_NOW_SORT_TYPE_KEY, LiveNowSortType.SORT_BY_DISTANCE.name) + prefs.getString(LIVE_NOW_SORT_TYPE_KEY, LiveNowSortType.SORT_BY_DISTANCE.name)!! ) batteryOptimisationAsked = prefs.getBoolean(BATTERY_OPTIMISATION_ASKED,false) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt index 16469f069c..4c04bb82c1 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt @@ -295,7 +295,7 @@ class ShowLocationHelper(private val app: TelegramApplication) { private fun getStatusWidgetIntent(): Intent { val startIntent = app.packageManager.getLaunchIntentForPackage(app.packageName) - startIntent.addCategory(Intent.CATEGORY_LAUNCHER) + startIntent!!.addCategory(Intent.CATEGORY_LAUNCHER) startIntent.putExtra(OPEN_MY_LOCATION_TAB_KEY,true) return startIntent } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt index 48a5608bb2..08cb4808c7 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt @@ -106,18 +106,20 @@ class SetTimeBottomSheet : DialogFragment() { } private fun selectStartDate() { - val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> - startCalendar.set(Calendar.YEAR, year) - startCalendar.set(Calendar.MONTH, monthOfYear) - startCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth) - updateDateAndTimeButtons() - } - DatePickerDialog( - context, dateFromDialog, - startCalendar.get(Calendar.YEAR), - startCalendar.get(Calendar.MONTH), - startCalendar.get(Calendar.DAY_OF_MONTH) - ).show() + context?.let { + val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> + startCalendar.set(Calendar.YEAR, year) + startCalendar.set(Calendar.MONTH, monthOfYear) + startCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth) + updateDateAndTimeButtons() + } + DatePickerDialog( + it, dateFromDialog, + startCalendar.get(Calendar.YEAR), + startCalendar.get(Calendar.MONTH), + startCalendar.get(Calendar.DAY_OF_MONTH) + ).show() + } } private fun selectStartTime() { @@ -132,18 +134,20 @@ class SetTimeBottomSheet : DialogFragment() { } private fun selectEndDate() { - val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> - endCalendar.set(Calendar.YEAR, year) - endCalendar.set(Calendar.MONTH, monthOfYear) - endCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth) - updateDateAndTimeButtons() - } - DatePickerDialog( - context, dateFromDialog, - endCalendar.get(Calendar.YEAR), - endCalendar.get(Calendar.MONTH), - endCalendar.get(Calendar.DAY_OF_MONTH) - ).show() + context?.let { + val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> + endCalendar.set(Calendar.YEAR, year) + endCalendar.set(Calendar.MONTH, monthOfYear) + endCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth) + updateDateAndTimeButtons() + } + DatePickerDialog( + it, dateFromDialog, + endCalendar.get(Calendar.YEAR), + endCalendar.get(Calendar.MONTH), + endCalendar.get(Calendar.DAY_OF_MONTH) + ).show() + } } private fun selectEndTime() { diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt index 71fb5ba47b..25e9ffbf96 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt @@ -53,7 +53,7 @@ class TimelineTabFragment : Fragment() { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? - ): View? { + ): View { mainView = inflater.inflate(R.layout.fragment_timeline_tab, container, false) val appBarLayout = mainView.findViewById(R.id.app_bar_layout) @@ -139,22 +139,24 @@ class TimelineTabFragment : Fragment() { fun tabClosed() {} private fun selectDate() { - val dateSetListener = - DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> - calendar = Calendar.getInstance() - calendar.set(Calendar.YEAR, year) - calendar.set(Calendar.MONTH, monthOfYear) - calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth) + context?.let { + val dateSetListener = + DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> + calendar = Calendar.getInstance() + calendar.set(Calendar.YEAR, year) + calendar.set(Calendar.MONTH, monthOfYear) + calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth) - updateList() - updateDateButton() - } - DatePickerDialog( - context, dateSetListener, - calendar.get(Calendar.YEAR), - calendar.get(Calendar.MONTH), - calendar.get(Calendar.DAY_OF_MONTH) - ).show() + updateList() + updateDateButton() + } + DatePickerDialog( + it, dateSetListener, + calendar.get(Calendar.YEAR), + calendar.get(Calendar.MONTH), + calendar.get(Calendar.DAY_OF_MONTH) + ).show() + } } private fun getStartOfDay(calendar: Calendar): Long { diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt index 80669017f5..f339478bc3 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt @@ -32,11 +32,11 @@ class BottomSheetDialog(ctx: Context) : Dialog(ctx, R.style.AppTheme_BottomSheet super.setContentView(wrapInContainer(layoutResID, null, null)) } - override fun setContentView(view: View?) { + override fun setContentView(view: View) { super.setContentView(wrapInContainer(0, view, null)) } - override fun setContentView(view: View?, params: ViewGroup.LayoutParams?) { + override fun setContentView(view: View, params: ViewGroup.LayoutParams?) { super.setContentView(wrapInContainer(0, view, params)) } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt index 52a87e81ee..9fd25a507c 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt @@ -40,7 +40,7 @@ class TextViewEx : AppCompatTextView { } val typefaceName = resolvedAttrs.getString(R.styleable.TextViewEx_typeface) - val typeface = FontCache.getFont(context, typefaceName) + val typeface = FontCache.getFont(context, typefaceName!!) if (typeface != null) { val style = getTypeface()?.style ?: 0 setTypeface(typeface, style) From eb7c83a6142e8c211db1a5bfd420530ab260d283 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 2 Dec 2020 18:20:00 +0300 Subject: [PATCH 18/18] Fix #9869 --- .../osmand/plus/routepreparationmenu/cards/TracksCard.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java index 3312371a56..5becff9bad 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java @@ -62,10 +62,12 @@ public class TracksCard extends BaseCard { @SuppressLint("DefaultLocale") @Override protected void updateContent() { + String gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath(); final List list = new ArrayList<>(); for (GPXFile gpx : gpxFiles) { File f = new File(gpx.path); - list.add(new GpxItem(GpxUiHelper.getGpxTitle(f.getName()), gpx, new GPXInfo(f.getName(), f.lastModified(), f.length()))); + String fileName = gpx.path.startsWith(gpxDir) ? gpx.path.substring(gpxDir.length() + 1) : f.getName(); + list.add(new GpxItem(GpxUiHelper.getGpxTitle(f.getName()), gpx, new GPXInfo(fileName, f.lastModified(), f.length()))); } Collections.sort(list, new Comparator() { @Override