diff --git a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java index 151d9e2913..d2f14e9f36 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java @@ -146,6 +146,9 @@ public class MapPoiTypes { public Map getAllTranslatedNames(boolean skipNonEditable) { Map translation = new HashMap(); for(PoiCategory pc : categories) { + if(skipNonEditable && pc.isNotEditableOsm()) { + continue; + } for(PoiType pt : pc.getPoiTypes()) { if(pt.isReference() ) { continue; diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml index 2fe5df02a2..4144e846bc 100644 --- a/OsmAnd/res/layout-land/map_hud_bottom.xml +++ b/OsmAnd/res/layout-land/map_hud_bottom.xml @@ -133,6 +133,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> @@ -142,6 +143,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index 7e49c3a013..940493919a 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -125,6 +125,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> @@ -134,6 +135,7 @@ android:layout_height="fill_parent" android:layout_gravity="bottom" android:gravity="center_horizontal" + android:lineSpacingMultiplier="0.9" android:text="100 m" android:textSize="@dimen/map_widget_text_size_small" /> diff --git a/OsmAnd/res/values-bg/strings.xml b/OsmAnd/res/values-bg/strings.xml index 1416a4dbd0..ab5dd90015 100644 --- a/OsmAnd/res/values-bg/strings.xml +++ b/OsmAnd/res/values-bg/strings.xml @@ -1,4 +1,5 @@ - + + Моля, въведете потребителско име и парола за сайта на OSM Изчистване на междинните точки Запази междинните точки @@ -2020,4 +2021,11 @@ OsmAnd е с отворен код и активно да се развива. Навигация Работи във фонов режим Предпочитана информация - \ No newline at end of file + Да се показва при стартиране + Копирано + " • Нов контекстно-ориентиран интерфейс\n\n • При стартиране на приложението се извежда картата, освен ако не е избрано \'Показване на таблото при стартиране\'\n\n • Настройване на контролите върху таблото за управление\n\n • Пропускане на таблото, ако предпочитате приложение с меню\n\n • To download maps, regions can be directly selected by tapping on the world map\n\n • POI Search now supports more specific queries\n\n • Improved POI and OSM editing functionality\n\n • Map data download structure and interface reworked\n\n и още... " + Запази офлайн + Модифицирани OSM POI + Изтрити OSM POI + Отвори OSM бележка + diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 5f9dbc35a6..46b0526faa 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -237,7 +237,7 @@ Afhent bilen: AM Parkeringssted - Parkeringsplads udvidelsen kan huske hvor bilen er parkeret, og hvor meget parkeringstid der er tilbage (hvis der er en tidsfrist).\nBåde placering og tid er synlige på oversigtspanelet samt i modul på kortskærmen. En alarm kan tilføjes til Android kalenderen, som en påmindelse. + Parkeringsplads udvidelsen kan huske hvor bilen er parkeret, og hvor meget parkeringstid der er tilbage (hvis der er en tidsfrist).\nBåde placering og tid er synlige på betjeningspanel samt i modul på kortskærmen. En alarm kan tilføjes til Android kalenderen, som en påmindelse. Parkering Marker som parkeringsplads Slet en parkeringsmarkør @@ -1484,7 +1484,7 @@ Swahili Hebræisk Frem - Oversigtspanel + Betjeningspanel Send sporing til en bestemt webtjeneste, hvis GPX logning er aktiveret. Online sporing (GPX nødvendig) Start online sporing @@ -1925,7 +1925,7 @@ Vi er meget interesseret i din mening, og det er vigtigt for os at høre fra dig. Fed kontur Fare - Konfigurer oversigtspanel + Konfigurer betjeningspanel Kortet blev skjult FORTRYD Spring over @@ -2095,7 +2095,7 @@ Note lukket Ændret OSM IP Slettet OSM IP - " • Ny kontekstafhængig brugergrænseflade når der vælges lokationer på kortet og på andre skærme\n\n • Kortskærmen vises direkte, medmindre \'Vis oversigtpanel ved start\' er valgt\n\n • Konfigurer hvordan og hvilket indhold der vises på oversigtspanelet\n\n • Hent kort, regioner ved at trykke direkte på verdenskortet\n\n • IP søgning understøtter nu mere specifikke forespørgsler\n\n • Forbedret IP og OSM redigeringsfunktionalitet\n\n • Administration af kortfiler struktur og grænseflade er omarbejdet\n\n og mere... " + " • Ny kontekstafhængig brugergrænseflade når der vælges lokationer på kortet og på andre skærme\n\n • Kortskærmen vises direkte, medmindre \'Vis betjeningspanel ved start\' er valgt\n\n • Konfigurer hvordan og hvilket indhold der vises på betjeningspanelet\n\n • Forbigå betjeningspanel hvis der ønskes menuen-baserede app-kontrol\n\n • Hent kort, regioner ved at trykke direkte på verdenskortet\n\n • IP søgning understøtter nu mere specifikke forespørgsler\n\n • Forbedret IP og OSM redigeringsfunktionalitet\n\n • Administration af kortfiler struktur og grænseflade er omarbejdet\n\n og mere... " Gem offline GPX-farve GPX-bredde @@ -2103,10 +2103,10 @@ Kopieret til udklipsholder - Nyt valg for opstart - Vælg om programmet starter med at vise korter eller oversigtspanel først. Kan ændres i indstillinger for oversigtspanel. - Start altid med oversigtspanel - Start altid med kortet - Placerer en knap til oversigtspanelet på kortskærmen + Betjeningspanel eller menu kontrol + Der er et nyt valg til at betjene app via det fleksibel betjeningspanel eller en statisk menu. Kan ændres i indstillinger for betjeningspanel . + Brug betjeningspanel + Brug menuen + Menuknappen viser betjeningspanel, ikke menuen Adgang fra kort diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 28b0a13f67..2cd5d62ecf 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -19,8 +19,8 @@ Verkehrsberuhigung Geschwindigkeitskontrolle Verkehrswarnung - Nahegelegene Favoriten ankündigen - Nahegelegene POI ankündigen + Nahegelegene Favoriten + Nahegelegene POI @@ -286,10 +286,10 @@ Europa Europa - Frankreich Europa - Deutschland - Europa/Asien - Russland + Russland Afrika Asien - Ozeanien + Australien und Ozeanien Weltweite und thematische Karten Weltweite Wikipedia POIs Sprachpakete (Aufnahmen - begrenzte Funktionalität) @@ -328,7 +328,7 @@ OSM-Kennwort Nötig für openstreetmap.org-Beiträge Hintergrunddienst - Für Verwendung von OsmAnd bei ausgeschalteter Anzeige + OsmAnd läuft bei ausgeschalteter Anzeige im Hintergrund @@ -687,7 +687,7 @@ Min. Art der Standortbestimmung beim Hintergrunddienst Standortbestimmung - Die Hintergrundnavigation erfordert aktiviertes GPS. + Die Hintergrundnavigation erfordert aktivierte Standortdienste. Filter verstecken Filter zeigen Filter @@ -1166,7 +1166,7 @@ Ankunftszeit GPS-Info - Straße + Straßenname Hausnummer @@ -1225,9 +1225,9 @@ Ton bei Auslösung abspielen Auswählen, ob beim Aufnehmen eines Fotos ein Ton abgespielt werden soll - Höchstgeschwindigkeit ansagen - Blitzer ansagen - Verkehrswarnungen ansagen + Tempolimit + Blitzer + Verkehrswarnungen Bitte OSM-Nutzername und Passwort in den Einstellungen eingeben Zwischenziele löschen Zwischenziele behalten @@ -1252,7 +1252,7 @@ Kanada Europa und Asien GB, Indien, Australien u.a. - GPX-Wegpunkte ansagen + GPX-Wegpunkte Fahrgebiet Version : Über @@ -1721,7 +1721,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Fehlende Karten herunterladen: %1$s (%2$d MB)? Mehr… Bitte ID eingeben - Übersicht + Dashboard Bus-, Oberleitungsbus-, Sammeltaxi-Linien Streckenaufzeichnung h @@ -1814,7 +1814,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Amerikanischer Straßenatlas Routing-Regeln v1.9 nicht verwenden Neuen Routenalgorithmus nicht verwenden - Fußgängerübergänge ankündigen + Fußgängerübergänge Parkplätze TAG ENTFERNEN @@ -2034,7 +2034,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Erfolgreich hochgeladen {0}/{1} Erneut versuchen Fehler: {0} - Übersicht konfigurieren + Dashboard konfigurieren Rückgängig machen Überspringen OsmAnd @@ -2047,7 +2047,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Pendelzug vermeiden Pendelzug vermeiden Plugins - Gebäude-Nummer + Hausnummer geöffnet ab geschlossen ab Nautische Meilen @@ -2138,14 +2138,14 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Feedback Kontakt Kartenlegende - Plaziert einen Dashboard-Knopf auf dem Bildschirm + Menü-Knopf zeigt Dashboard, nicht Menü \"Aus\" startet direkt die Kartenansicht. in die Zwischenablage kopiert - " • Neue Kontext-bezogene Benutzeroberfläche bei Auswahl von Orten auf der Karte und anderen Ansichten\n\n • Kartenansicht wird nun direkt gestartet, außer bei Auswahl von \'Zeige Dashboard bei App-Start\'\n\n • Auswahl der anzuzeigenden Elemente im Dashboard möglich\n\n • Zum Herunterladen von Kartendateien können nun Regionen direkt durch Tippen auf der Weltkarte ausgewählt werden\n\n • Die POI-Suche ermöglicht nun speziellere Abfragen\n\n • Verbesserungen beim Editieren von POI- und OSM-Objekten\n\n • Oberfläche und Struktur zum Herunterladen der Karten wurden überarbeitet\n\n und mehr ... " + " • Neue Kontext-bezogene Benutzeroberfläche bei Auswahl von Orten auf der Karte und anderen Ansichten\n\n • Kartenansicht wird nun direkt gestartet, außer bei Auswahl von \'Zeige Dashboard bei App-Start\'\n\n • Auswahl der anzuzeigenden Elemente im Dashboard möglich\n\n • Dashboard kann umgangen werden, falls menü-basierte App-Steuerung gewünscht ist\n\n • Zum Herunterladen von Kartendateien können nun Regionen direkt durch Tippen auf der Weltkarte ausgewählt werden\n\n • Die POI-Suche ermöglicht nun speziellere Abfragen\n\n • Verbesserungen beim Editieren von POI- und OSM-Objekten\n\n • Oberfläche und Struktur zum Herunterladen der Karten wurden überarbeitet\n\n und mehr ... " offline speichern geänderter OSM-POI OSM-POI löschen - Offene OSM-Notiz + OSM-Notiz erstellen Wiedereröffnete OSM-Notiz Kommentierte OSM-Notiz Gelöschte OSM-Notiz @@ -2182,8 +2182,12 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Name des Landes eingeben Soll der POI wirklich ohne Art des POI gespeichert werden? OSM-Änderung bearbeiten - Dashboard immer starten - Kartenansicht immer starten - Neue Auswahl des Startvorgangs - Es ist nun auswählbar, ob beim Start der App gleich die Kartenansicht oder das Dashboard angezeigt wird. (Jederzeit in den Dashboard-Einstellungen änderbar) - + Dashboard verwenden + Menü verwenden + Auswahl der App-Bedienung + Es ist nun auswählbar, ob die App primär über das flexible Dashboard oder über ein statisches Menü bedient werden soll. (Jederzeit in den Dashboard-Einstellungen änderbar) + Aufruf von der Karte aus + neu erstellen + Weiter + %.1f MB + diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 417d1cad9a..82eb9f556b 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -773,7 +773,7 @@ Здоровье Еда Проживание - Инфраструктура + Рукотворное Административные объекты Морские объекты Доступ в Интернет: беспроводной diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 300600293b..8daf7a3122 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1,5 +1,24 @@ + Заметка OSM открыта снова + К заметке OSM добавлен комментарий + Заметка OSM удалена + Заметка OSM создана + Заметка OSM + Создание заметки + Добавление комментария + Повторное открытие заметки + Закрытие заметки + Заметка успешно создана + Ошибка: заметка не была создана + Заметка было успешно закрыта + Ошибка: заметка не была закрыта + OSM POI удалена + OSM POI отредактирована + Сохранить локально + Добавить заметку OSM + Цвет трека GPX + Толщина трека GPX Скопировано в буфер обмена Стиль отображения дорог Нижненемецкий diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 48a3b839b2..1943b0b3eb 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -2020,8 +2020,8 @@ Istile pro sas istradas Issèbera noa de allumìngiu Como podes isseberare sa mègius manera de allumìngiu de s\'aplicatzione, deretamente dae sa mapa o cun su pannellu de controllu in antis. As a pòdere semper cambiare s’issèbera tua prus a tardu in sas impostatziones de su pannellu. - Ammustra semper su pannellu de controllu - Ammustra semper sa mapa + Allue cun su pannellu de controllu + Allue cun sa mapa Pone unu butone pro su pannellu de controllu in s’ischermu de sa mapa Intra dae sa mapa " • Interfache impitadore noa pro incarcare positziones in sa mapa e in àteros ischermos\n\n • S\'ischermu de sa mapa est como postu come prima cosa a s’allumìngiu de s’aplicatzione, semper chi \'Ammustra pannellu de controllu in s\'allumìngiu\' no siet ischertadu\n\n • Como podes cunfigurare sas impostatziones pro isseberare cales sunt sas ischedas chi diant dèper’èssere ammustradas in su pannellu e comente\n\n • Pro iscarrigare mapas, sas regiones podent èssere ischertadas deretamente incarcande in sa mapa generale de su mundu\n\n • Sa chirca de PDI como suportat chircas prus dislindadas\n\n • Megioradas sas funtzionalidades de modìficas de PDI e OSM\n\n • Istrutura e s\'interfache de iscarrigamentu datos mapas torrada a fàghere\n\n e àteru... " diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 5df0e45c28..cd4ae5548e 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1931,6 +1931,6 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Teraz si môžete zvoliť či aplikácia po štarte spustí obrazovku mapy alebo úvodný panel. Toto nastavenie môžete neskôr zmeniť v nastaveniach panela. Umiestni na obrazovku mapy tlačidlo úvodného panela Prístup z mapy - Vždy spustiť úvodný panel - Vždy spustiť mapu + Spustiť úvodný panel + Spustiť mapu diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index 0a1773c806..7863d3ca80 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -2002,8 +2002,8 @@ GPX-bredd " • Nytt kontextkänsligt gränssnitt för att peta på platser på kartan och på andra skärmar\n\n • Kartskärmen startar nu automatiskt om inte \'Visa panelen vid appstart\' är vald\n\n • Konfigurera vilka kort och hur de ska visas i panelen\n\n • För att hämta kartor kan regioner väljas direkt genom att peta på världskartan\n\n • Sökning efter intressepunkter (POI) understöder nu mer specifika frågor\n\n • Förbättrad funktion för POI- och OSM-redigering\n\n • Strukturen för hämtning av kartdata och gränssnittet har omarbetats\n\n och mer ... " Du kan nu välja om appen ska starta direkt med kartskärmen eller alltid visa panelen först. Detta val kan du alltid ändra på under inställningarna i panelen. -Starta alltid med panelen - Starta alltid med kartan +Öppna panelen + Visa kartan Nytt val för uppstarten Öppna igen Skicka in diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 40194f5ace..14581be21c 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -2003,14 +2003,14 @@ 道路樣式 重新開啟 離線儲存 - " •在地圖上和其它螢幕上,為點擊位置做了新的敏捷內容選單使用者界面\n\n•地圖螢幕上現在除了直接啟動外,還有\'在應用程式時啟動顯示儀表板\'可選\n\n •組態哪些以及何種卡可以在儀表板上顯示\n\n •要下載地圖,可以直接在全球地圖上點選區域\n\n •更好的重新計算路線(現在引擎經過反復的嘗試,建議一條不同的路線)\n\n •興趣點搜尋現在支援更具體的查詢\n\n •改善過的興趣點和 OSM 編輯功能\n\n •地圖資料下載結構和界面重新設計\n\n 還有更多... " + " •在地圖上和其它螢幕上,為點擊位置做了新的敏捷內容選單使用者界面\n\n•地圖螢幕上現在除了直接啟動外,還有\'在應用程式時啟動顯示儀表板\'可選\n\n •組態哪些以及何種卡可以在儀表板上顯示\n\n•如果您喜歡基本選單的應用程式控制,繞過儀表板方式\n\n •要下載地圖,可以直接在全球地圖上點選區域\n\n •更好的重新計算路線(現在引擎經過反復的嘗試,建議一條不同的路線)\n\n •興趣點搜尋現在支援更具體的查詢\n\n •改善過的興趣點和 OSM 編輯功能\n\n •地圖資料下載結構和界面重新設計\n\n 還有更多... " 複製到剪貼簿 - 新的起始選擇 - 您現在可以選擇,如果應用程式直接啟動在地圖螢幕或是永遠先顯示儀表板。您稍後也可以在設定中更改。 - 將儀表板按鈕放置在地圖螢幕上 + 儀表板或選單控制 + 還有一種新的選擇,透過具彈性的儀表板或固定的選單優先控制應用程式。在儀表板中也可以更改您的選擇。 + 選單按鈕啟動儀表板,無選單 從地圖進入 - 開始儀表板 - 開始地圖 + 使用儀表板 + 使用地圖 diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index aac2d4a289..e65e49afce 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -8,21 +8,22 @@ If you are making/correcting English translations make sure: 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy - --> - Places a dashboard button on the map screen + --> + Menu button launches dashboard, not menu Access from map \'Off\' directly launches the map screen Show on start Copied to clipboard - \u2022 New context-sensitive UI for tapping locations on the map and on other screens\n\n - \u2022 Map screen is now launched directly unless \'Show dashboard on app start\' is selected\n\n - \u2022 Configure which and how cards are displayed on the dashboard\n\n - \u2022 To download maps, regions can be directly selected by tapping on the world map\n\n - \u2022 POI Search now supports more specific queries\n\n + \u2022 New context-sensitive UI for tapping locations on the map and on other screens\n\n + \u2022 Map screen is now launched directly unless \'Show dashboard on app start\' is selected\n\n + \u2022 Configure which and how cards are displayed on the dashboard\n\n + \u2022 Bypass the dashboard if you like menu-based app control\n\n + \u2022 To download maps, regions can be directly selected by tapping on the world map\n\n + \u2022 POI Search now supports more specific queries\n\n \u2022 Improved POI and OSM editing functionality\n\n - \u2022 Map data download structure and interface reworked\n\n - and more... + \u2022 Map data download structure and interface reworked\n\n + and more... Save offline Modified OSM POI @@ -2091,8 +2092,8 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Map legend Do you really want to save poi without POI type? Modify OSM change - Launch dashboard - Launch map - New startup choice - You can now select if the app directly launches the map screen or always displays the dashboard first. Your choice can always be changed in the dashboard settings. + Use dashboard + Use menu + Dashboard or menu control + There is a new choice to primarily control the app via the flexible dashboard or a static menu. Your choice can always be changed in the dashboard settings. diff --git a/OsmAnd/src/net/osmand/data/PointDescription.java b/OsmAnd/src/net/osmand/data/PointDescription.java index 5e318bf0cc..c44aa9a6b6 100644 --- a/OsmAnd/src/net/osmand/data/PointDescription.java +++ b/OsmAnd/src/net/osmand/data/PointDescription.java @@ -41,6 +41,7 @@ public class PointDescription { public static final String POINT_TYPE_OSM_BUG = "bug"; public static final String POINT_TYPE_WORLD_REGION = "world_region"; public static final String POINT_TYPE_GPX_ITEM = "gpx_item"; + public static final String POINT_TYPE_WORLD_REGION_SHOW_ON_MAP = "world_region_show_on_map"; public static final PointDescription LOCATION_POINT = new PointDescription(POINT_TYPE_LOCATION, ""); @@ -149,6 +150,10 @@ public class PointDescription { } } + public boolean contextMenuDisabled() { + return POINT_TYPE_WORLD_REGION_SHOW_ON_MAP.equals(type); + } + public boolean isLocation() { return POINT_TYPE_LOCATION.equals(type); } diff --git a/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java b/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java index 628f1b1135..4caab396c7 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndAppCustomization.java @@ -96,8 +96,6 @@ public class OsmAndAppCustomization { public void prepareOptionsMenu(MapActivity mapActivity, ContextMenuAdapter optionsMenuHelper) { } - public void prepareLocationMenu(MapActivity mapActivity, ContextMenuAdapter adapter) { - } public String getIndexesUrl() { return "http://"+IndexConstants.INDEX_DOWNLOAD_DOMAIN+"/get_indexes?gzip&" + Version.getVersionAsURLParam(app); //$NON-NLS-1$; diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index d58a653779..042d5dffd3 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1449,7 +1449,6 @@ public class OsmandSettings { public final static String POINT_NAVIGATE_LAT = "point_navigate_lat"; //$NON-NLS-1$ public final static String POINT_NAVIGATE_LON = "point_navigate_lon"; //$NON-NLS-1$ public final static String POINT_NAVIGATE_ROUTE = "point_navigate_route_integer"; //$NON-NLS-1$ - public final static int NAVIGATE_CURRENT_GPX = 2; public final static int NAVIGATE = 1; public final static String POINT_NAVIGATE_DESCRIPTION = "point_navigate_description"; //$NON-NLS-1$ public final static String START_POINT_LAT = "start_point_lat"; //$NON-NLS-1$ @@ -1501,6 +1500,9 @@ public class OsmandSettings { return settingsAPI.edit(globalPreferences).remove(INTERMEDIATE_POINTS).remove(INTERMEDIATE_POINTS_DESCRIPTION).commit(); } + public final CommonPreference USE_INTERMEDIATE_POINTS_NAVIGATION = + new BooleanPreference("use_intermediate_points_navigation", false).makeGlobal().cache(); + public List getIntermediatePointDescriptions(int sz) { List list = new ArrayList(); String ip = settingsAPI.getString(globalPreferences,INTERMEDIATE_POINTS_DESCRIPTION, ""); @@ -1604,11 +1606,7 @@ public class OsmandSettings { } public boolean navigateDialog() { - return navigateDialog(false); - } - - public boolean navigateDialog(boolean gpx) { - return settingsAPI.edit(globalPreferences).putInt(POINT_NAVIGATE_ROUTE, gpx ? NAVIGATE_CURRENT_GPX : NAVIGATE).commit(); + return settingsAPI.edit(globalPreferences).putInt(POINT_NAVIGATE_ROUTE, NAVIGATE).commit(); } diff --git a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java index e748b2036e..08f8ba4a37 100644 --- a/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java +++ b/OsmAnd/src/net/osmand/plus/TargetPointsHelper.java @@ -123,13 +123,31 @@ public class TargetPointsHelper { return intermediatePoints; } + public List getIntermediatePointsNavigation() { + List intermediatePoints = new ArrayList<>(); + if (settings.USE_INTERMEDIATE_POINTS_NAVIGATION.get()) { + for (TargetPoint t : intermediatePoints) { + intermediatePoints.add(t); + } + } + return intermediatePoints; + } + public List getIntermediatePointsLatLon() { List intermediatePointsLatLon = new ArrayList(); - for (TargetPoint t : intermediatePoints) { intermediatePointsLatLon.add(t.point); } - + return intermediatePointsLatLon; + } + + public List getIntermediatePointsLatLonNavigation() { + List intermediatePointsLatLon = new ArrayList(); + if (settings.USE_INTERMEDIATE_POINTS_NAVIGATION.get()) { + for (TargetPoint t : intermediatePoints) { + intermediatePointsLatLon.add(t.point); + } + } return intermediatePointsLatLon; } @@ -209,13 +227,14 @@ public class TargetPointsHelper { private void updateRoutingHelper() { LatLon start = settings.getPointToStart(); Location lastKnownLocation = ctx.getLocationProvider().getLastKnownLocation(); + List is = getIntermediatePointsLatLonNavigation(); if((routingHelper.isFollowingMode() && lastKnownLocation != null) || start == null) { routingHelper.setFinalAndCurrentLocation(settings.getPointToNavigate(), - settings.getIntermediatePoints(), lastKnownLocation); + is, lastKnownLocation); } else { Location loc = wrap(start); routingHelper.setFinalAndCurrentLocation(settings.getPointToNavigate(), - settings.getIntermediatePoints(), loc); + is, loc); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 6fdf2af98f..b50e0c22a1 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -442,7 +442,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { RoutingHelper routingHelper = app.getRoutingHelper(); if (routingHelper.isFollowingMode() && (!Algorithms.objectEquals(targets.getPointToNavigate().point, routingHelper.getFinalLocation()) || !Algorithms - .objectEquals(targets.getIntermediatePointsLatLon(), routingHelper.getIntermediatePoints()))) { + .objectEquals(targets.getIntermediatePointsLatLonNavigation(), routingHelper.getIntermediatePoints()))) { targets.updateRouteAndReferesh(true); } app.getLocationProvider().resumeAllUpdates(); @@ -516,7 +516,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { getMyApplication().getTargetPointsHelper().navigateToPoint(new LatLon(lat, lon), false, -1); - getMapActions().enterRoutePlanningMode(null, null, false); + getMapActions().enterRoutePlanningModeGivenGpx(null, null, null, false); } catch (NumberFormatException e) { AccessibleToast.makeText(this, getString(R.string.navigation_intent_invalid, schemeSpecificPart), @@ -541,7 +541,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { Location loc = new Location("map"); loc.setLatitude(mapView.getLatitude()); loc.setLongitude(mapView.getLongitude()); - getMapActions().enterRoutePlanningMode(null, null, status == OsmandSettings.NAVIGATE_CURRENT_GPX); + getMapActions().enterRoutePlanningModeGivenGpx(null, null, null, true); if (dashboardOnMap.isVisible()) { dashboardOnMap.hideDashboard(); } @@ -550,7 +550,7 @@ public class MapActivity extends AccessibleActivity implements DownloadEvents { if (dashboardOnMap.isVisible()) { dashboardOnMap.hideDashboard(); } - if (mapLabelToShow != null) { + if (mapLabelToShow != null && !mapLabelToShow.contextMenuDisabled()) { mapContextMenu.setMapCenter(latLonToShow); mapContextMenu.setMapPosition(mapView.getMapPosition()); mapContextMenu.show(latLonToShow, mapLabelToShow, toShow); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 1ae573f7fc..d6bb4c270d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -87,64 +87,6 @@ public class MapActivityActions implements DialogProvider { routingHelper = mapActivity.getMyApplication().getRoutingHelper(); } - public void showNavigationContextMenuPoint(final double latitude, final double longitude) { - final ContextMenuAdapter adapter = new ContextMenuAdapter(mapActivity); - - if (!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) { - adapter.item(R.string.context_menu_item_directions_to).iconColor( - R.drawable.ic_action_gdirections_dark).reg(); - adapter.item(R.string.context_menu_item_directions_from).iconColor( - R.drawable.ic_action_gdirections_dark).reg(); - } - final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); - if (targets.getPointToNavigate() != null) { - adapter.item(R.string.context_menu_item_destination_point).iconColor(R.drawable.ic_action_flag_dark).reg(); - adapter.item(R.string.context_menu_item_intermediate_point).iconColor(R.drawable.ic_action_flage_dark).reg(); - // For button-less search UI - } else { - adapter.item(R.string.context_menu_item_destination_point).iconColor(R.drawable.ic_action_flag_dark).reg(); - } - - getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter); - - final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity); - builder.setTitle(R.string.get_directions); - final ArrayAdapter listAdapter = - adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent()); - builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - int standardId = adapter.getElementId(which); - OnContextMenuClick click = adapter.getClickAdapter(which); - if (click != null) { - click.onContextMenuClick(listAdapter, standardId, which, false); - } else if (standardId == R.string.context_menu_item_directions_to) { - targets.navigateToPoint(new LatLon(latitude, longitude), true, -1, null); - enterRoutePlanningMode(null, null, false); - } else if (standardId == R.string.context_menu_item_directions_from) { - enterRoutePlanningMode(new LatLon(latitude, longitude), - mapActivity.getContextMenu().getPointDescription(), false); - } else if (standardId == R.string.context_menu_item_intermediate_point || - standardId == R.string.context_menu_item_destination_point) { - boolean dest = standardId == R.string.context_menu_item_destination_point; - targets.navigateToPoint(new LatLon(latitude, longitude), true, - dest ? -1 : targets.getIntermediatePoints().size(), - mapActivity.getContextMenu().getPointDescription()); - if (targets.getIntermediatePoints().size() > 0) { - openIntermediatePointsDialog(); - } - } - } - }); - builder.create().show(); - } - - public void directionTo(double latitude, double longitude, PointDescription pd) { - final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); - targets.navigateToPoint(new LatLon(latitude, longitude), true, targets.getIntermediatePoints().size() + 1, pd); - enterRoutePlanningMode(null, null, false); - } public void addAsWaypoint(double latitude, double longitude, PointDescription pd) { TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); @@ -336,7 +278,6 @@ public class MapActivityActions implements DialogProvider { R.drawable.ic_action_gdirections_dark).reg(); } OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj); - getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter); final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity); final ArrayAdapter listAdapter = @@ -358,7 +299,7 @@ public class MapActivityActions implements DialogProvider { } else if (standardId == R.string.context_menu_item_directions_from) { mapActivity.getContextMenu().hide(); enterRoutePlanningMode(new LatLon(latitude, longitude), - mapActivity.getContextMenu().getPointDescription(), false); + mapActivity.getContextMenu().getPointDescription()); } } }); @@ -395,7 +336,8 @@ public class MapActivityActions implements DialogProvider { } } - public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName, boolean useCurrentGPX) { + public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName) { + final boolean useIntermediatePointsByDefault = true; List selectedGPXFiles = mapActivity.getMyApplication().getSelectedGpxHelper() .getSelectedGPXFiles(); final List gpxFiles = new ArrayList(); @@ -407,14 +349,14 @@ public class MapActivityActions implements DialogProvider { } } - if (gpxFiles.size() > 0 && !useCurrentGPX) { + if (gpxFiles.size() > 0) { AlertDialog.Builder bld = new AlertDialog.Builder(mapActivity); if (gpxFiles.size() == 1) { bld.setMessage(R.string.use_displayed_track_for_navigation); bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - enterRoutePlanningModeImpl(gpxFiles.get(0), from, fromName); + enterRoutePlanningModeGivenGpx(gpxFiles.get(0), from, fromName, useIntermediatePointsByDefault); } }); } else { @@ -436,7 +378,7 @@ public class MapActivityActions implements DialogProvider { bld.setAdapter(adapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - enterRoutePlanningModeImpl(gpxFiles.get(i), from, fromName); + enterRoutePlanningModeGivenGpx(gpxFiles.get(i), from, fromName, useIntermediatePointsByDefault); } }); } @@ -444,17 +386,17 @@ public class MapActivityActions implements DialogProvider { bld.setNegativeButton(R.string.shared_string_no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - enterRoutePlanningModeImpl(null, from, fromName); + enterRoutePlanningModeGivenGpx(null, from, fromName, useIntermediatePointsByDefault); } }); bld.show(); } else { - enterRoutePlanningModeImpl(useCurrentGPX ? gpxFiles.get(0) : null, from, fromName); + enterRoutePlanningModeGivenGpx(null, from, fromName, useIntermediatePointsByDefault); } } - private void enterRoutePlanningModeImpl(GPXFile gpxFile, LatLon from, PointDescription fromName) { - + public void enterRoutePlanningModeGivenGpx(GPXFile gpxFile, LatLon from, PointDescription fromName, boolean useIntermediatePointsByDefault) { + settings.USE_INTERMEDIATE_POINTS_NAVIGATION.set(useIntermediatePointsByDefault); OsmandApplication app = mapActivity.getMyApplication(); TargetPointsHelper targets = app.getTargetPointsHelper(); @@ -627,7 +569,7 @@ public class MapActivityActions implements DialogProvider { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - enterRoutePlanningMode(null, null, false); + enterRoutePlanningMode(null, null); } else { mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode(); mapActivity.refreshMap(); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index d5cbea1cf5..461b4d2dcf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -292,8 +292,8 @@ public class MapActivityLayers { private void addFilterToList(final ContextMenuAdapter adapter, final List list, PoiUIFilter f) { list.add(f); Item it = adapter.item(f.getName()).selected(-1); - if (RenderingIcons.containsBigIcon(f.getSimplifiedId())) { - it.icon(RenderingIcons.getBigIconResourceId(f.getSimplifiedId())); + if (RenderingIcons.containsBigIcon(f.getIconId())) { + it.icon(RenderingIcons.getBigIconResourceId(f.getIconId())); } else { it.icon(R.drawable.mx_user_defined); } diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java index 7680ec07e6..d50dad07e6 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsNavigationActivity.java @@ -199,17 +199,18 @@ public class SettingsNavigationActivity extends SettingsBaseActivity { if (!mode.isDerivedRoutingFrom(ApplicationMode.CAR)) { category.removePreference(speedLimitExceed); } - - Integer[] delayIntervals = new Integer[] { -1, 3, 5, 7, 10, 15, 20 }; - String[] delayIntervalNames = new String[delayIntervals.length]; - for (int i = 0; i < delayIntervals.length; i++) { - if (i == 0) { - delayIntervalNames[i] = getString(R.string.auto_follow_route_never); - } else { - delayIntervalNames[i] = delayIntervals[i] + " " + getString(R.string.int_seconds); - } - } - registerListPreference(settings.DELAY_TO_START_NAVIGATION, screen, delayIntervalNames, delayIntervals); + + // deprecated 2.2 +// Integer[] delayIntervals = new Integer[] { -1, 3, 5, 7, 10, 15, 20 }; +// String[] delayIntervalNames = new String[delayIntervals.length]; +// for (int i = 0; i < delayIntervals.length; i++) { +// if (i == 0) { +// delayIntervalNames[i] = getString(R.string.auto_follow_route_never); +// } else { +// delayIntervalNames[i] = delayIntervals[i] + " " + getString(R.string.int_seconds); +// } +// } + // registerListPreference(settings.DELAY_TO_START_NAVIGATION, screen, delayIntervalNames, delayIntervals); if(getIntent() != null && getIntent().hasExtra(INTENT_SKIP_DIALOG)) { diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java index 7ca54e1ca5..7c80a1ba7e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java @@ -268,8 +268,8 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc String name; if (item instanceof PoiUIFilter) { final PoiUIFilter model = (PoiUIFilter) item; - if (RenderingIcons.containsBigIcon(model.getSimplifiedId())) { - icon.setImageDrawable(RenderingIcons.getBigIcon(getActivity(), model.getSimplifiedId())); + if (RenderingIcons.containsBigIcon(model.getIconId())) { + icon.setImageDrawable(RenderingIcons.getBigIcon(getActivity(), model.getIconId())); } else if(PoiUIFilter.BY_NAME_FILTER_ID.equals(model.getFilterId()) || model instanceof NominatimPoiFilter){ icon.setImageResource(R.drawable.mx_name_finder); diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 493dbe8abf..060c06167a 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -334,9 +334,13 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc bottom = Math.min(bottom, l.getLatitude()); } RotatedTileBox tb = new RotatedTileBox(rt); - tb.setPixelDimensions(3 * tb.getPixWidth() / 4, 3 * tb.getPixHeight() / 4); - double clat = bottom / 2 + top / 2; + + tb.setPixelDimensions(5 * tb.getPixWidth() / 6, 5 * tb.getPixHeight() / 6); + double clat = 5 * bottom / 4 - top / 4; double clon = left / 2 + right / 2; + // TODO for landscape menu +// double clat = bottom / 2 + top / 2; +// double clon = 5 * left / 4 - right / 4; tb.setLatLonCenter(clat, clon); while(tb.getZoom() >= 7 && (!tb.containsLatLon(top, left) || !tb.containsLatLon(bottom, right))) { tb.setZoom(tb.getZoom() - 1); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java index ffbc3acc9b..ef11458bbe 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java @@ -603,7 +603,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks { public void navigationAction() { RoutingHelper routingHelper = mapActivity.getRoutingHelper(); if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); + mapActivity.getMapActions().enterRoutePlanningMode(null, null); } else { mapActivity.getRoutingHelper().setRoutePlanningMode(true); mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode(); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 0ed424bd63..0c57c72f8d 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -31,6 +31,7 @@ import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.LatLon; +import net.osmand.data.PointDescription; import net.osmand.map.WorldRegion; import net.osmand.map.WorldRegion.RegionParams; import net.osmand.plus.OsmandApplication; @@ -793,7 +794,12 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl @Override public void onClick(View v) { OsmandApplication app = (OsmandApplication) getActivity().getApplication(); - app.getSettings().setMapLocationToShow(regionCenter.getLatitude(), regionCenter.getLongitude(), 5, null); + app.getSettings().setMapLocationToShow( + regionCenter.getLatitude(), + regionCenter.getLongitude(), + 5, + new PointDescription(PointDescription.POINT_TYPE_WORLD_REGION_SHOW_ON_MAP, "")); + dismiss(); MapActivity.launchMapActivityMoveToTop(getActivity()); } diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index 8313b62955..a0a72aadf7 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -182,7 +182,9 @@ public class GpxUiHelper { } for (SelectedGpxFile selectedGpx : selectedGpxFiles) { - list.add(selectedGpx.getGpxFile().path.substring(gpxDirLength + 1)); + if (!selectedGpx.getGpxFile().showCurrentTrack) { + list.add(selectedGpx.getGpxFile().path.substring(gpxDirLength + 1)); + } } final ContextMenuAdapter adapter = createGpxContextMenuAdapter(activity, list, null, false, diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3502269c7a..aade631f5d 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -4,12 +4,12 @@ import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.view.View; import android.widget.LinearLayout; - import net.osmand.CallbackWithObject; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.ContextMenuAdapter; +import net.osmand.plus.TargetPointsHelper; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.WptPt; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; @@ -352,9 +352,11 @@ public class MapContextMenu extends MenuTitleController { } public void fabPressed() { - mapActivity.getMapActions().directionTo(latLon.getLatitude(), latLon.getLongitude(), getPointDescription()); hide(); - mapActivity.getMapLayers().getMapControlsLayer().showRouteInfoControlDialog(); + final TargetPointsHelper targets = mapActivity.getMyApplication().getTargetPointsHelper(); + targets.navigateToPoint(latLon, true, targets.getIntermediatePoints().size() + 1, getPointDescription()); + mapActivity.getMapActions().enterRoutePlanningModeGivenGpx(null, null, null, false); +// mapActivity.getMapLayers().getMapControlsLayer().showRouteInfoControlDialog(); } public void buttonWaypointPressed() { @@ -406,7 +408,7 @@ public class MapContextMenu extends MenuTitleController { final List list = mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles(); - if (list.isEmpty()) { + if (list.isEmpty() || (list.size() == 1 && list.get(0).getGpxFile().showCurrentTrack)) { GPXFile gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx(); getWptPtPointEditor().add(gpxFile, latLon, title); } else { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java index 4394724d06..7cddc6dddb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapMultiSelectionMenuFragment.java @@ -59,6 +59,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi @Override public void onStart() { super.onStart(); + menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false); menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(false); } @@ -69,6 +70,7 @@ public class MapMultiSelectionMenuFragment extends Fragment implements AdapterVi menu.onStop(); } menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(true); + menu.getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(true); } public static void showInstance(final MapActivity mapActivity) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java index 313089dda7..731cde3284 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java @@ -187,6 +187,7 @@ public class EditPoiData { if(pt != null) { tagValues.remove(pt.getOsmTag()); tagValues.remove(pt.getOsmTag2()); + category = pt.getCategory(); } notifyDatasetChanged(POI_TYPE_TAG); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index dd632e82e4..e7497756ad 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -44,7 +44,6 @@ import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; - import net.osmand.CallbackWithObject; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; @@ -253,17 +252,35 @@ public class EditPoiDialogFragment extends DialogFragment { @Override public void afterTextChanged(Editable s) { if (!getEditPoiData().isInEdit()) { - PoiType pt = getEditPoiData().getAllTranslatedSubTypes().get(s.toString().toLowerCase()); - if(pt != null) { - poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation()); - } getEditPoiData().updateTypeTag(s.toString()); + poiTypeTextInputLayout.setHint(editPoiData.getPoiCategory().getTranslation()); } } }); poiNameEditText.setOnEditorActionListener(mOnEditorActionListener); poiTypeEditText.setOnEditorActionListener(mOnEditorActionListener); poiTypeEditText.setText(editPoiData.getPoiTypeString()); + poiTypeEditText.setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(final View v, MotionEvent event) { + final EditText editText = (EditText) v; + final int DRAWABLE_RIGHT = 2; + if (event.getAction() == MotionEvent.ACTION_UP) { + if (event.getX() >= (editText.getRight() + - editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width() + - editText.getPaddingRight())) { + if (editPoiData.getPoiCategory() != null) { + DialogFragment dialogFragment = + PoiSubTypeDialogFragment.createInstance(editPoiData.getPoiCategory()); + dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment"); + } + + return true; + } + } + return false; + } + }); Button saveButton = (Button) view.findViewById(R.id.saveButton); saveButton.setText(mOpenstreetmapUtil instanceof OpenstreetmapRemoteUtil @@ -304,9 +321,11 @@ public class EditPoiDialogFragment extends DialogFragment { } else { new SaveWithAdvancedTagsDialogFragment().show(getChildFragmentManager(), "dialog"); } - return; + } else if(editPoiData.getPoiCategory() == getMyApplication().getPoiTypes().getOtherPoiCategory()) { + poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type)); + } else { + save(); } - save(); } private void save() { @@ -446,41 +465,26 @@ public class EditPoiDialogFragment extends DialogFragment { }.execute(); } - public void updateType(PoiCategory type) { + public void setPoiCategory(PoiCategory type) { editPoiData.updateType(type); poiTypeEditText.setText(editPoiData.getPoiTypeString()); - poiTypeTextInputLayout.setHint(editPoiData.getPoiCategory().getTranslation()); setAdapterForPoiTypeEditText(); - poiTypeEditText.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(final View v, MotionEvent event) { - final EditText editText = (EditText) v; - final int DRAWABLE_RIGHT = 2; - if (event.getAction() == MotionEvent.ACTION_UP) { - if (event.getX() >= (editText.getRight() - - editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width() - - editText.getPaddingRight())) { - if (editPoiData.getPoiCategory() != null) { - DialogFragment dialogFragment = - PoiSubTypeDialogFragment.createInstance(editPoiData.getPoiCategory()); - dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment"); - } - - return true; - } - } - return false; - } - }); } private void setAdapterForPoiTypeEditText() { final Map subCategories = new LinkedHashMap<>(); - for (Map.Entry s : editPoiData.getAllTranslatedSubTypes().entrySet()) { - if (!subCategories.containsKey(s.getKey())) { - subCategories.put(Algorithms.capitalizeFirstLetterAndLowercase(s.getKey()), s.getValue()); + PoiCategory ct = editPoiData.getPoiCategory(); + if(ct != null) { + for (PoiType s : ct.getPoiTypes()) { + if(!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { + addMapEntryAdapter(subCategories, s.getTranslation(), s); + addMapEntryAdapter(subCategories, s.getKeyName().replace('_', ' '), s); + } } } + for (Map.Entry s : editPoiData.getAllTranslatedSubTypes().entrySet()) { + addMapEntryAdapter(subCategories, s.getKey(), s.getValue()); + } final ArrayAdapter adapter; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { adapter = new ArrayAdapter<>(getActivity(), @@ -513,14 +517,8 @@ public class EditPoiDialogFragment extends DialogFragment { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { Object item = parent.getAdapter().getItem(position); - //noinspection SuspiciousMethodCalls - if (subCategories.containsKey(item.toString().toLowerCase())) { - //noinspection SuspiciousMethodCalls - PoiType pt = subCategories.get(item); - String keyName = pt.getKeyName(); - poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation()); - poiTypeEditText.setText(keyName); - } + poiTypeEditText.setText(item.toString()); + setAdapterForPoiTypeEditText(); } @Override @@ -530,6 +528,12 @@ public class EditPoiDialogFragment extends DialogFragment { } + private void addMapEntryAdapter(final Map subCategories, String key, PoiType v) { + if (!subCategories.containsKey(key.toLowerCase())) { + subCategories.put(Algorithms.capitalizeFirstLetterAndLowercase(key), v); + } + } + private OsmandApplication getMyApplication() { return (OsmandApplication) getActivity().getApplication(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java index 1b4cd7495d..f02248f683 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiSubTypeDialogFragment.java @@ -1,7 +1,7 @@ package net.osmand.plus.osmedit.dialogs; -import java.util.Map; import java.util.Set; +import java.util.TreeSet; import net.osmand.osm.MapPoiTypes; import net.osmand.osm.PoiCategory; @@ -24,8 +24,16 @@ public class PoiSubTypeDialogFragment extends DialogFragment { MapPoiTypes poiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes(); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final PoiCategory a = poiTypes.getPoiCategoryByName((String) getArguments().getSerializable(KEY_POI_CATEGORY)); - final Map allTranslatedNames = poiTypes.getAllTranslatedNames(a, true); - Set strings = allTranslatedNames.keySet(); + Set strings = new TreeSet<>(); + if(a == poiTypes.getOtherPoiCategory()) { + for (PoiCategory category : poiTypes.getCategories(false)) { + if (!category.isNotEditableOsm()) { + addCategory(category, strings); + } + } + } else { + addCategory(a, strings); + } final String[] subCats = strings.toArray(new String[strings.size()]); builder.setItems(subCats, new DialogInterface.OnClickListener() { @Override @@ -37,6 +45,14 @@ public class PoiSubTypeDialogFragment extends DialogFragment { return builder.create(); } + private void addCategory(final PoiCategory a, Set strings) { + for (PoiType s : a.getPoiTypes()) { + if (!s.isReference() && !s.isNotEditableOsm() && s.getBaseLangType() == null) { + strings.add(s.getTranslation()); + } + } + } + public static PoiSubTypeDialogFragment createInstance(PoiCategory cat) { PoiSubTypeDialogFragment fragment = new PoiSubTypeDialogFragment(); Bundle args = new Bundle(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java index 87503ca636..808ce6acf4 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/dialogs/PoiTypeDialogFragment.java @@ -21,22 +21,19 @@ public class PoiTypeDialogFragment extends DialogFragment { public Dialog onCreateDialog(Bundle savedInstanceState) { MapPoiTypes poiTypes = ((OsmandApplication) getActivity().getApplication()).getPoiTypes(); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); - final List categories = poiTypes.getCategories(false); - ArrayList vals = new ArrayList<>(categories.size()); - ArrayList toDelete = new ArrayList<>(); - for (PoiCategory category : categories) { - if (category.isNotEditableOsm()) { - toDelete.add(category); - } else { + final List categories = new ArrayList(); + ArrayList vals = new ArrayList<>(); + for (PoiCategory category : poiTypes.getCategories(false)) { + if (!category.isNotEditableOsm()) { vals.add(category.getTranslation()); + categories.add(category); } } - categories.removeAll(toDelete); builder.setItems(vals.toArray(new String[vals.size()]), new Dialog.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { PoiCategory aType = categories.get(which); - ((EditPoiDialogFragment) getParentFragment()).updateType(aType); + ((EditPoiDialogFragment) getParentFragment()).setPoiCategory(aType); dismiss(); } }); diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index 4aebe527d5..92ef6f5b99 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -23,6 +23,7 @@ import net.osmand.plus.R; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; import net.osmand.plus.api.SQLiteAPI.SQLiteStatement; +import net.osmand.util.Algorithms; public class PoiFiltersHelper { private final OsmandApplication application; @@ -33,7 +34,9 @@ public class PoiFiltersHelper { private PoiUIFilter searchByNamePOIFilter; private PoiUIFilter customPOIFilter; private PoiUIFilter showAllPOIFilter; + private PoiUIFilter localWikiPoiFilter; private List cacheTopStandardFilters; + private static final String UDF_CAR_AID = "car_aid"; private static final String UDF_FOR_TOURISTS = "for_tourists"; @@ -78,6 +81,8 @@ public class PoiFiltersHelper { return searchByNamePOIFilter; } + + public PoiUIFilter getCustomPOIFilter() { if(customPOIFilter == null){ PoiUIFilter filter = new PoiUIFilter(application.getString(R.string.poi_filter_custom_filter), @@ -88,9 +93,23 @@ public class PoiFiltersHelper { return customPOIFilter; } + public PoiUIFilter getLocalWikiPOIFilter() { + if(localWikiPoiFilter == null){ + PoiType place = application.getPoiTypes().getPoiTypeByKey("wiki_place"); + if (place != null && !Algorithms.isEmpty(application.getLanguage())) { + PoiUIFilter filter = new PoiUIFilter(place, application, " " + + application.getLangTranslation(application.getLanguage())); //$NON-NLS-1$ + filter.setSavedFilterByName("wiki:lang:"+application.getLanguage()); + filter.setStandardFilter(true); + localWikiPoiFilter = filter; + } + } + return localWikiPoiFilter; + } + public PoiUIFilter getShowAllPOIFilter() { if(showAllPOIFilter == null){ - PoiUIFilter filter = new PoiUIFilter(null, application); //$NON-NLS-1$ + PoiUIFilter filter = new PoiUIFilter(null, application, ""); //$NON-NLS-1$ filter.setStandardFilter(true); showAllPOIFilter = filter; } @@ -117,7 +136,7 @@ public class PoiFiltersHelper { } } PoiUIFilter ff = getFilterById(filterId, getCustomPOIFilter(), getSearchByNamePOIFilter(), - getShowAllPOIFilter(), getNominatimPOIFilter(), getNominatimAddressFilter()); + getLocalWikiPOIFilter(), getShowAllPOIFilter(), getNominatimPOIFilter(), getNominatimAddressFilter()); if (ff != null) { return ff; } @@ -125,7 +144,7 @@ public class PoiFiltersHelper { String typeId = filterId.substring(PoiUIFilter.STD_PREFIX.length()); AbstractPoiType tp = application.getPoiTypes().getAnyPoiTypeByKey(typeId); if(tp != null) { - PoiUIFilter lf = new PoiUIFilter(tp, application); + PoiUIFilter lf = new PoiUIFilter(tp, application, ""); ArrayList copy = new ArrayList(cacheTopStandardFilters); copy.add(lf); sortListOfFilters(copy); @@ -134,7 +153,7 @@ public class PoiFiltersHelper { } AbstractPoiType lt = application.getPoiTypes().getAnyPoiAdditionalTypeByKey(typeId); if(lt != null) { - PoiUIFilter lf = new PoiUIFilter(lt, application); + PoiUIFilter lf = new PoiUIFilter(lt, application, ""); ArrayList copy = new ArrayList(cacheTopStandardFilters); copy.add(lf); sortListOfFilters(copy); @@ -182,10 +201,13 @@ public class PoiFiltersHelper { List top = new ArrayList(); // user defined top.addAll(getUserDefinedPoiFilters()); + if(getLocalWikiPOIFilter() != null) { + top.add(getLocalWikiPOIFilter()); + } // default MapPoiTypes poiTypes = application.getPoiTypes(); for (PoiFilter t : poiTypes.getTopVisibleFilters()) { - top.add(new PoiUIFilter(t, application)); + top.add(new PoiUIFilter(t, application, "")); } sortListOfFilters(top); cacheTopStandardFilters = top; diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java index 38e97fb976..6589577497 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java @@ -46,6 +46,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter { private Map poiAdditionals = new HashMap(); protected String filterId; + protected String standardIconId = ""; protected String name; protected boolean isStandardFilter; @@ -62,12 +63,14 @@ public class PoiUIFilter implements SearchPoiTypeFilter { protected List currentSearchResult = null; // constructor for standard filters - public PoiUIFilter(AbstractPoiType type, OsmandApplication application) { + public PoiUIFilter(AbstractPoiType type, OsmandApplication application, String idSuffix) { this.app = application; isStandardFilter = true; - filterId = STD_PREFIX + (type == null ? null : type.getKeyName()); + standardIconId = (type == null ? null : type.getKeyName()); + filterId = STD_PREFIX + standardIconId + idSuffix; + poiTypes = application.getPoiTypes(); - name = type == null ? application.getString(R.string.poi_filter_closest_poi) : type.getTranslation(); //$NON-NLS-1$ + name = type == null ? application.getString(R.string.poi_filter_closest_poi) : (type.getTranslation() + idSuffix); //$NON-NLS-1$ if (type == null) { initSearchAll(); updatePoiAdditionals(); @@ -79,6 +82,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter { } } + // search by name standard protected PoiUIFilter(OsmandApplication application) { this.app = application; @@ -520,9 +524,9 @@ public class PoiUIFilter implements SearchPoiTypeFilter { return poiAdditionals; } - public String getSimplifiedId(){ + public String getIconId(){ if(filterId.startsWith(STD_PREFIX)) { - return filterId.substring(STD_PREFIX.length()).toLowerCase(); + return standardIconId; } else if(filterId.startsWith(USER_PREFIX)) { return filterId.substring(USER_PREFIX.length()).toLowerCase(); } diff --git a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java index 188810e295..de02b50bd6 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java +++ b/OsmAnd/src/net/osmand/plus/routing/RoutingHelper.java @@ -458,21 +458,27 @@ public class RoutingHelper { if(route.getIntermediatePointsToPass() > 0 && route.getDistanceToNextIntermediate(lastFixedLocation) < POSITION_TOLERANCE * 2) { showMessage(app.getString(R.string.arrived_at_intermediate_point)); route.passIntermediatePoint(); - TargetPointsHelper targets = app.getTargetPointsHelper(); - List ns = targets.getIntermediatePoints(); - int toDel = targets.getIntermediatePoints().size() - route.getIntermediatePointsToPass(); - int currentIndex = toDel - 1; - String name = currentIndex < 0 || currentIndex >= ns.size() || - ns.get(currentIndex ) == null ? "" : ns.get(currentIndex ).getOnlyName(); + String name = ""; + if(intermediatePoints != null ) { + LatLon rm = intermediatePoints.remove(0); + List ll = targets.getIntermediatePointsNavigation(); + int ind = -1; + for(int i = 0; i < ll.size(); i++) { + if(ll.get(i).point != null && MapUtils.getDistance(ll.get(i).point, rm) < 5) { + name = ll.get(i).getOnlyName(); + ind = i; + break; + } + } + if(ind >= 0) { + targets.removeWayPoint(false, ind); + } + } if(isFollowingMode) { voiceRouter.arrivedIntermediatePoint(name); } - while(toDel > 0) { - targets.removeWayPoint(false, 0); - toDel--; - } - + // double check while(intermediatePoints != null && route.getIntermediatePointsToPass() < intermediatePoints.size()) { intermediatePoints.remove(0); } diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index b90bccf9cf..38668c1175 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -95,6 +95,7 @@ public class MapControlsLayer extends OsmandMapLayer { private MapHudButton mapZoomIn; private MapHudButton layersHud; private MapHudButton mapDashControl; + private long lastZoom; public MapControlsLayer(MapActivity activity) { this.mapActivity = activity; @@ -374,12 +375,13 @@ public class MapControlsLayer extends OsmandMapLayer { notifyClicked(); mapRouteInfoControlDialog.hideDialog(); optionsRouteControlDialog.hideDialog(); - RoutingHelper routingHelper = mapActivity.getMyApplication().getRoutingHelper(); - if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); - } else { +// RoutingHelper routingHelper = mapActivity.getMyApplication().getRoutingHelper(); +// if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { + // never possible +// mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); +// } else { startNavigation(); - } +// } } public void showRouteInfoControlDialog() { @@ -446,13 +448,11 @@ public class MapControlsLayer extends OsmandMapLayer { notifyClicked(); RoutingHelper routingHelper = mapActivity.getRoutingHelper(); if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) { - mapActivity.getMapActions().enterRoutePlanningMode(null, null, false); + mapActivity.getMapActions().enterRoutePlanningMode(null, null); } else { switchToRoutePlanningLayout(); } } - - }); } @@ -537,9 +537,10 @@ public class MapControlsLayer extends OsmandMapLayer { } + @Deprecated public void startCounter() { OsmandSettings settings = mapActivity.getMyApplication().getSettings(); - int del = settings.DELAY_TO_START_NAVIGATION.get(); + int del = 0; // settings.DELAY_TO_START_NAVIGATION.get(); if (del <= 0) { return; } @@ -619,16 +620,20 @@ public class MapControlsLayer extends OsmandMapLayer { if(routeFollowingMode || routePlanningMode) { mapAppModeShadow.setVisibility(View.GONE); } else { + if (mapView.isZooming()) { + lastZoom = System.currentTimeMillis(); + } mapAppModeShadow.setVisibility(View.VISIBLE); - if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) { + //if (!mapView.isZooming() || !OsmandPlugin.isDevelopment()) { + if ((System.currentTimeMillis()-lastZoom > 1000) || !OsmandPlugin.isDevelopment()) { zoomText.setVisibility(View.GONE); appModeIcon.setVisibility(View.VISIBLE); appModeIcon.setImageDrawable( app.getIconsCache().getIcon( settings.getApplicationMode().getSmallIconDark(), !isNight)); } else { - zoomText.setVisibility(View.VISIBLE); appModeIcon.setVisibility(View.GONE); + zoomText.setVisibility(View.VISIBLE); zoomText.setText(getZoomLevel(tileBox)); } } diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java b/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java index 1c0c059f42..c469543cf9 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java @@ -92,9 +92,9 @@ public class MapRouteInfoControl implements IRouteInformationListener { public void setVisible(boolean visible) { if(visible) { if (showDialog){ - if (getTargets().getPointToNavigate() == null){ + //if (getTargets().getPointToNavigate() == null){ showDialog(); - } + //} showDialog = false; } controlVisible = true; @@ -441,7 +441,7 @@ public class MapRouteInfoControl implements IRouteInformationListener { public String generateViaDescription() { TargetPointsHelper targets = getTargets(); String via = ""; - List points = targets.getIntermediatePoints(); + List points = targets.getIntermediatePointsNavigation(); if (points.size() == 0) { return via; }