From a63fc77695c63eec8ad72a94906114d3e924658c Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 21:41:06 +0100 Subject: [PATCH 01/17] add missing reset of switch --- .../plus/activities/search/SearchCityByNameActivity.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index c15d1a87c4..762a46d5cd 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -58,7 +58,13 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity final StringMatcherMode startsWith = CollatorStringMatcher.StringMatcherMode.CHECK_ONLY_STARTS_WITH; return new CityComparator(startsWith, en); } - + + @Override + protected void reset() { + searchVillagesMode = -1; + super.reset(); + } + @Override public AsyncTask getInitializeTask() { return new AsyncTask>(){ From fc9e243a28480f529e23e35035a96fdee693bae2 Mon Sep 17 00:00:00 2001 From: Jaroslav Lichtblau Date: Wed, 14 Jan 2015 18:29:19 +0100 Subject: [PATCH 02/17] Translated using Weblate (Czech) Currently translated at 100.0% (1595 of 1595 strings) --- OsmAnd/res/values-cs/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index a6dabda268..d6cb3017d7 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1131,7 +1131,7 @@ \n\t* Modul měření vzdálenosti\n\t* Modul zvykové poznámky\n\t* Modul vrstevnice\n\t* Opravení chyb\n\t* Nový styl mapy \'Touring view\' s více mapovými detaily, novými styly vykreslování silnic, větším kontrastem a možností horské turistiky (značení SAC)\n\t* Korekce výpočtu výšky EGM96 " nedostupné Audio/video nahrávky - Nahrávka %1$s %2$s na %3$s + Nahrávka %1$s %3$s %2$s nahrávám OsmAnd modul pro offline zobrazování vrstevnic @@ -1148,7 +1148,7 @@ Opravdu chcete zastavit navigaci? Opravdu chcete smazat cíl? Zobrazit - Foto %1$s v %2$s + Foto %1$s %2$s Vyfotit Vyfotit Zvuková a video data From 899589d2bb2aeea60bbfadf6c940e3791338ba5b Mon Sep 17 00:00:00 2001 From: Lu Ca Date: Wed, 14 Jan 2015 16:56:30 +0100 Subject: [PATCH 03/17] Translated using Weblate (Sardinian) Currently translated at 100.0% (1595 of 1595 strings) --- OsmAnd/res/values-sc/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index f7870f43a5..e38bcd5987 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -341,7 +341,7 @@ Si cussigiat de annànghere unu o prus puntos intermedios pro megiorare sas pres Abìlita pro calculare àndalas pretzisas sena attoppos. Est lentu e limitadu in sa distantzia. Calculu pretzisu de s\'àndala (alfa) Ammustra - Foto %1$s a %2$s + Foto %1$s %2$s Iscata una foto Iscata una foto Imprea s\'aplicu de sistema pro sas fotos @@ -383,7 +383,7 @@ Si cussigiat de annànghere unu o prus puntos intermedios pro megiorare sas pres Sa registratzione non podet èssere reprodota Burra sa registratzione Reprodui - Registratzione %1$s %2$s de %3$s + Registratzione %1$s %3$s %2$s registratzione Stop Avia/Inghitza From b1f27d93ad2ad116a8ac68c86f76bcad52051076 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Wed, 14 Jan 2015 18:21:03 +0100 Subject: [PATCH 04/17] Translated using Weblate (Slovak) Currently translated at 100.0% (1595 of 1595 strings) --- OsmAnd/res/values-sk/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 42e3890d05..1a78581f06 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1,6 +1,6 @@ Zobraziť - Fotografia %1$s zachytená dňa %2$s + Fotografia %1$s %2$s Zachytiť fotografiu Zachytiť fotografiu Na použitie služieb pre záznam pozície zapnite monitorovacie zásuvné moduly (stopovanie, stopovanie naživo) @@ -1157,7 +1157,7 @@ Nahrávanie nemôže byť prehrané Odstrániť záznam Prehrať - Záznam %1$s %2$s v %3$s + Záznam %1$s %2$s %3$s nahrávka Zastaviť Nahrať From 1114a5e89583e705ccd9508577ab86502bb94c6b Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Wed, 14 Jan 2015 15:43:00 +0100 Subject: [PATCH 05/17] Translated using Weblate (Dutch) Currently translated at 73.3% (448 of 611 strings) --- OsmAnd/res/values-nl/phrases.xml | 38 +++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-nl/phrases.xml b/OsmAnd/res/values-nl/phrases.xml index 7207a293f7..16b5d7a4ba 100644 --- a/OsmAnd/res/values-nl/phrases.xml +++ b/OsmAnd/res/values-nl/phrases.xml @@ -173,7 +173,7 @@ Kleuterschool Universiteit - College + Hogeschool Gevangenis Ambassade Regering @@ -438,4 +438,40 @@ Onderstation Transformator + Kabelbaanstation + Recyclage + Stortplaats + Bewaking + Fabriek + Werken + Mijnschacht + Oliebron + Windmolen + Zoutwinning + Rijschool + Gerechtsgebouw + Alternatieve geneeskunde + Gezondheidscentrum + Vroedvrouw + Ergotherapeut + Revalidatie + Sportcentrum + Golfbaan + Schaatsbaan + Looppiste + Fietspiste + Boogschieten + Athletiek + Basketbal + Schaak + Klimmen + Cricket + Fietsen + Duiken + Hondenrennen + Golf + Turnen + Handbal + Paardenrennen + Ijsschaatsen From eb6983af22fb2116976d4508afb92a92cc3fa7be Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 21:58:14 +0100 Subject: [PATCH 06/17] re-init addFooter --- .../osmand/plus/activities/search/SearchCityByNameActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index 762a46d5cd..92aa1c28a4 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -62,6 +62,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity @Override protected void reset() { searchVillagesMode = -1; + addFooterViews() super.reset(); } From 2c2ef0a1e7de887c1985a99a12db8fe5317d536e Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 22:01:38 +0100 Subject: [PATCH 07/17] fix build --- .../osmand/plus/activities/search/SearchCityByNameActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index 92aa1c28a4..2680cd4090 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -62,7 +62,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity @Override protected void reset() { searchVillagesMode = -1; - addFooterViews() + addFooterViews(); super.reset(); } From b77d9109e7a4d08cc0b425995cb8a69dfbe4b8ee Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 22:17:57 +0100 Subject: [PATCH 08/17] remove code which did not fix issue --- .../plus/activities/search/SearchCityByNameActivity.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index 2680cd4090..5f23375850 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -59,13 +59,6 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity return new CityComparator(startsWith, en); } - @Override - protected void reset() { - searchVillagesMode = -1; - addFooterViews(); - super.reset(); - } - @Override public AsyncTask getInitializeTask() { return new AsyncTask>(){ From 3cda17468ba69add1351e29a05f89e252396d76f Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 22:24:58 +0100 Subject: [PATCH 09/17] fix NPE in RegionAddressRepositoryBinary --- .../plus/resources/RegionAddressRepositoryBinary.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java index ac24a06230..4a03fd5c0b 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java @@ -129,9 +129,11 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { @Override public synchronized void preloadStreets(City o, ResultMatcher resultMatcher) { - Collection streets = o.getStreets(); - if(!streets.isEmpty()){ - return; + if (o!=null) { + Collection streets = o.getStreets(); + if(!streets.isEmpty()){ + return; + } } try { file.preloadStreets(o, BinaryMapIndexReader.buildAddressRequest(resultMatcher)); From fef1c68ff1a042fddf5d5bbe6294c7e1f8c99ce2 Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 22:44:22 +0100 Subject: [PATCH 10/17] extend NPE fix --- .../resources/RegionAddressRepositoryBinary.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java index 4a03fd5c0b..313e8ab11d 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java @@ -129,18 +129,18 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { @Override public synchronized void preloadStreets(City o, ResultMatcher resultMatcher) { + //Looks like o can be null here, question is why if (o!=null) { Collection streets = o.getStreets(); if(!streets.isEmpty()){ return; } + try { + file.preloadStreets(o, BinaryMapIndexReader.buildAddressRequest(resultMatcher)); + } catch (IOException e) { + log.error("Disk operation failed" , e); //$NON-NLS-1$ + } } - try { - file.preloadStreets(o, BinaryMapIndexReader.buildAddressRequest(resultMatcher)); - } catch (IOException e) { - log.error("Disk operation failed" , e); //$NON-NLS-1$ - } - } // // not use ccontains It is really slow, takes about 10 times more than other steps From 8e4b3b5693639392ad484caedfa1192019efb921 Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 23:03:28 +0100 Subject: [PATCH 11/17] This NPE needs better fix --- .../RegionAddressRepositoryBinary.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java index 313e8ab11d..d0bd945a9d 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java @@ -129,17 +129,15 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { @Override public synchronized void preloadStreets(City o, ResultMatcher resultMatcher) { - //Looks like o can be null here, question is why - if (o!=null) { - Collection streets = o.getStreets(); - if(!streets.isEmpty()){ - return; - } - try { - file.preloadStreets(o, BinaryMapIndexReader.buildAddressRequest(resultMatcher)); - } catch (IOException e) { - log.error("Disk operation failed" , e); //$NON-NLS-1$ - } + //TODO: Check NPE, looks like o can be null here, question is why + Collection streets = o.getStreets(); + if(!streets.isEmpty()){ + return; + } + try { + file.preloadStreets(o, BinaryMapIndexReader.buildAddressRequest(resultMatcher)); + } catch (IOException e) { + log.error("Disk operation failed" , e); //$NON-NLS-1$ } } From 12c798891ebc6b6f8b09683dbfb1bddb54397ec5 Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 23:37:48 +0100 Subject: [PATCH 12/17] avoid duplicate entries --- .../osmand/plus/resources/RegionAddressRepositoryBinary.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java index d0bd945a9d..082af55049 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java @@ -119,7 +119,9 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { @Override public synchronized void addCityToPreloadedList(City city) { - cities.put(city.getId(), city); + if (!cities.containsValue(city)) { + cities.put(city.getId(), city); + } } @Override From 84ae8ba79784647a84a287ad73019b268927a1fa Mon Sep 17 00:00:00 2001 From: sonora Date: Wed, 14 Jan 2015 23:53:51 +0100 Subject: [PATCH 13/17] check if issue was caused by duplicate list entries --- .../plus/activities/search/SearchCityByNameActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index 5f23375850..34ae7372f5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -174,9 +174,9 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity public void itemSelected(City obj) { settings.setLastSearchedCity(obj.getId(), obj.getName(region.useEnglishNames()), obj.getLocation()); // Hardy: Looks like disabling this fixes the issue of the Search City dialogue becoming non-functional after the first tapping on a found village (not city) ... (while selected village is still remembered on the dialog for future reference!) - //if (region.getCityById(obj.getId(), obj.getName(region.useEnglishNames())) == null) { - // region.addCityToPreloadedList((City) obj); - //} + if (region.getCityById(obj.getId(), obj.getName(region.useEnglishNames())) == null) { + region.addCityToPreloadedList((City) obj); + } quitActivity(SearchStreetByNameActivity.class); } From 8c07796b18a841b4a6cd3d538e94d5f045315960 Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 15 Jan 2015 00:11:55 +0100 Subject: [PATCH 14/17] re-instate the old fix, duplicte list entry was not the issue it seems --- .../plus/activities/search/SearchCityByNameActivity.java | 8 ++++---- .../plus/resources/RegionAddressRepositoryBinary.java | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index 34ae7372f5..a17cfc2385 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -173,10 +173,10 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity @Override public void itemSelected(City obj) { settings.setLastSearchedCity(obj.getId(), obj.getName(region.useEnglishNames()), obj.getLocation()); - // Hardy: Looks like disabling this fixes the issue of the Search City dialogue becoming non-functional after the first tapping on a found village (not city) ... (while selected village is still remembered on the dialog for future reference!) - if (region.getCityById(obj.getId(), obj.getName(region.useEnglishNames())) == null) { - region.addCityToPreloadedList((City) obj); - } + // Hardy: Looks like disabling the next 3 lines fixes the issue of the Search City dialogue becoming non-functional after the first tapping on a found village (not city) ... (while selected village is still remembered on the dialog for future reference!) + //if (region.getCityById(obj.getId(), obj.getName(region.useEnglishNames())) == null) { + // region.addCityToPreloadedList((City) obj); + //} quitActivity(SearchStreetByNameActivity.class); } diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java index 082af55049..d0bd945a9d 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java @@ -119,9 +119,7 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { @Override public synchronized void addCityToPreloadedList(City city) { - if (!cities.containsValue(city)) { - cities.put(city.getId(), city); - } + cities.put(city.getId(), city); } @Override From 5c80b2bc4a681ecf4fd6bff99a84799f0937b4fb Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 15 Jan 2015 01:29:52 +0100 Subject: [PATCH 15/17] Temporarily do not hide button to check how it behaves --- .../osmand/plus/activities/search/SearchCityByNameActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index a17cfc2385..7150c0243a 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -45,7 +45,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity public void onClick(View v) { searchVillagesMode = 1; research(); - searchVillages.setVisibility(View.GONE); + //searchVillages.setVisibility(View.GONE); } }); getListView().addFooterView(ll); From 9dd4956590a3839747f381603ec636537f15c555 Mon Sep 17 00:00:00 2001 From: Krystian Biesaga Date: Thu, 15 Jan 2015 00:48:21 +0100 Subject: [PATCH 16/17] Translated using Weblate (Polish) Currently translated at 100.0% (1595 of 1595 strings) --- OsmAnd/res/values-pl/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index ea22304339..802d03b9c6 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -1136,7 +1136,7 @@ Nagranie nie może zostać odtworzone Usuń nagranie Odtwórz - Nagranie %1$s %2$s w %3$s + Nagranie %1$s %3$s %2$s nagranie Stop Start @@ -1155,7 +1155,7 @@ Nagraj notatkę wideo Ta wtyczka dostarcza poziomice, które mogą być wyświetlane na mapach offline w OsmAnd. Światowe dane (między 70 stopniem szerokości północnej a 70 stopniem szerokości południowej) opierają się na pomiarach SRTM (Shuttle Radar Topography Mission) i ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), przyrządu na pokładzie Terra, flagowego satelity Systemu Obserwacji Ziemi NASA. ASTER jest wspólnym przedsięwzięciem NASA, japońskiego Ministerstwa Gospodarki, Handlu i Przemysłu (METI) i Japońskich Systemów Kosmicznych (J-spacesystems). Pokaż - Zdjęcie %1$s w %2$s + Zdjęcie %1$s %2$s Zrób zdjęcie Zrób zdjęcie Czy na pewno chcesz zatrzymać nawigację? From ef9e841167fffccd7cd98f3eb884ca2d5f8608ee Mon Sep 17 00:00:00 2001 From: sonora Date: Thu, 15 Jan 2015 01:38:23 +0100 Subject: [PATCH 17/17] add missing region.useEnglishNames() --- .../plus/activities/search/SearchStreetByNameActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchStreetByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchStreetByNameActivity.java index 4c2a918570..5ca1bdff19 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchStreetByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchStreetByNameActivity.java @@ -214,7 +214,7 @@ public class SearchStreetByNameActivity extends SearchByNameAbstractActivity