diff --git a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java
index cb5db953c6..8d6ee064d4 100644
--- a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java
+++ b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java
@@ -97,19 +97,35 @@ public class OsmandRegions {
}
private String getLang(BinaryMapDataObject o) {
- return o.getNameByType(langType);
+ if (langType != null) {
+ return o.getNameByType(langType);
+ } else {
+ return null;
+ }
}
private String getMetric(BinaryMapDataObject o) {
- return o.getNameByType(metricType);
+ if (metricType != null) {
+ return o.getNameByType(metricType);
+ } else {
+ return null;
+ }
}
private String getLeftHandDriving(BinaryMapDataObject o) {
- return o.getNameByType(leftHandDrivingType);
+ if (leftHandDrivingType != null) {
+ return o.getNameByType(leftHandDrivingType);
+ } else {
+ return null;
+ }
}
private String getRoadSigns(BinaryMapDataObject o) {
- return o.getNameByType(roadSignsType);
+ if (roadSignsType != null) {
+ return o.getNameByType(roadSignsType);
+ } else {
+ return null;
+ }
}
public String getDownloadName(BinaryMapDataObject o) {
diff --git a/OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_right_light.9.png b/OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_right_light.9.png
new file mode 100644
index 0000000000..ced925cc93
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_right_light.9.png differ
diff --git a/OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_top_light.9.png b/OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_top_light.9.png
new file mode 100644
index 0000000000..8e5d32f5cd
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/bg_contextmenu_shadow_top_light.9.png differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_action_ruler.png b/OsmAnd/res/drawable-hdpi/ic_action_ruler.png
new file mode 100644
index 0000000000..947cbef786
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/ic_action_ruler.png differ
diff --git a/OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_right_light.9.png b/OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_right_light.9.png
new file mode 100644
index 0000000000..01e901982a
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_right_light.9.png differ
diff --git a/OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_top_light.9.png b/OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_top_light.9.png
new file mode 100644
index 0000000000..84d1884c71
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/bg_contextmenu_shadow_top_light.9.png differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_action_ruler.png b/OsmAnd/res/drawable-mdpi/ic_action_ruler.png
new file mode 100644
index 0000000000..54f82daeed
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/ic_action_ruler.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_right_light.9.png b/OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_right_light.9.png
new file mode 100644
index 0000000000..8ae4fc96fe
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_right_light.9.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_top_light.9.png b/OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_top_light.9.png
new file mode 100644
index 0000000000..2ce218b6e1
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/bg_contextmenu_shadow_top_light.9.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_ruler.png b/OsmAnd/res/drawable-xhdpi/ic_action_ruler.png
new file mode 100644
index 0000000000..d1a65048ba
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/ic_action_ruler.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/bg_contextmenu_shadow_right_light.9.png b/OsmAnd/res/drawable-xxhdpi/bg_contextmenu_shadow_right_light.9.png
new file mode 100644
index 0000000000..e5bb4a1123
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/bg_contextmenu_shadow_right_light.9.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/bg_contextmenu_shadow_top_light.9.png b/OsmAnd/res/drawable-xxhdpi/bg_contextmenu_shadow_top_light.9.png
new file mode 100644
index 0000000000..d88af5d8a5
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/bg_contextmenu_shadow_top_light.9.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_ruler.png b/OsmAnd/res/drawable-xxhdpi/ic_action_ruler.png
new file mode 100644
index 0000000000..9a51090661
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/ic_action_ruler.png differ
diff --git a/OsmAnd/res/drawable/bg_bottom_menu_dark.xml b/OsmAnd/res/drawable/bg_bottom_menu_dark.xml
new file mode 100644
index 0000000000..da3897aaf9
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_bottom_menu_dark.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/bg_bottom_menu_light.xml b/OsmAnd/res/drawable/bg_bottom_menu_light.xml
new file mode 100644
index 0000000000..14afe84331
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_bottom_menu_light.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/bg_left_menu_dark.xml b/OsmAnd/res/drawable/bg_left_menu_dark.xml
new file mode 100644
index 0000000000..6300bc82a3
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_left_menu_dark.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/bg_left_menu_light.xml b/OsmAnd/res/drawable/bg_left_menu_light.xml
new file mode 100644
index 0000000000..9edc174531
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_left_menu_light.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/point_editor_fragment.xml b/OsmAnd/res/layout-land/point_editor_fragment.xml
new file mode 100644
index 0000000000..82eaecb526
--- /dev/null
+++ b/OsmAnd/res/layout-land/point_editor_fragment.xml
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/share_menu_fragment.xml b/OsmAnd/res/layout-land/share_menu_fragment.xml
new file mode 100644
index 0000000000..a9189eae1f
--- /dev/null
+++ b/OsmAnd/res/layout-land/share_menu_fragment.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/point_editor_fragment.xml b/OsmAnd/res/layout/point_editor_fragment.xml
index 519fa141da..47b7bb7868 100644
--- a/OsmAnd/res/layout/point_editor_fragment.xml
+++ b/OsmAnd/res/layout/point_editor_fragment.xml
@@ -71,7 +71,7 @@
android:background="?android:selectableItemBackground"
android:textColor="?attr/contextMenuButtonColor"
android:text="@string/update_existing"
- android:visibility="visible"/>
+ android:visibility="gone"/>
diff --git a/OsmAnd/res/layout/point_editor_fragment_land.xml b/OsmAnd/res/layout/point_editor_fragment_land.xml
deleted file mode 100644
index a06be57cb0..0000000000
--- a/OsmAnd/res/layout/point_editor_fragment_land.xml
+++ /dev/null
@@ -1,246 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/OsmAnd/res/layout/share_list_item.xml b/OsmAnd/res/layout/share_list_item.xml
new file mode 100644
index 0000000000..6bb8835871
--- /dev/null
+++ b/OsmAnd/res/layout/share_list_item.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/share_menu_fragment.xml b/OsmAnd/res/layout/share_menu_fragment.xml
new file mode 100644
index 0000000000..d066d7413a
--- /dev/null
+++ b/OsmAnd/res/layout/share_menu_fragment.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml
index ee7f312f4c..b245166840 100644
--- a/OsmAnd/res/values-da/phrases.xml
+++ b/OsmAnd/res/values-da/phrases.xml
@@ -2163,9 +2163,9 @@
Campingvogne: nej
Improviseret: ja
Improviseret: nej
- Sanitære dump station: ja
- Sanitære dump station: nej
- Sanitær dump station: kun for kunder
+ Sanitær tømmestation: ja
+ Sanitær tømmestation: nej
+ Sanitær tømmestation: kun for kunder
Strømforsyning: ja
Strømforsyning: nej
Strømforsyning (stik): CEE 17 blå
@@ -2183,7 +2183,7 @@
Socialfacilitet: bosted
Socialfacilitet: plejehjem
- Socialfacilitet: opsøgende
+ Socialfacilitet: privat humanitær organisation
Socialfacilitet: madcentral
Socialfacilitet: herberg
Socialfacilitet: ambulant behandling
@@ -2198,7 +2198,7 @@
Socialmålgruppe: unge
Socialmålgruppe: hjemløse
Socialmålgruppe: indvandrere
- Socialmålgruppe: underprivilegerede
+ Socialmålgruppe: dårligt stillede
Socialmålgruppe: stofmisbrugere
Socialmålgruppe: arbejdsløse
Socialmålgruppe: syge
@@ -2247,7 +2247,7 @@
Antal trin
Trintilstand: jævn
Trintilstand: ujævn
- Trintilstand: ru
+ Trintilstand: dårlig
Varde
@@ -2260,7 +2260,7 @@
Type: udhugget i sten
Type: hypogeum
Type: hvælving
- Type: columbarium
+ Type: klumbarium
Type: mausoleum
Type: sarkofag
Type: krypt
diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml
index 045ae3d11b..67cdbef99b 100644
--- a/OsmAnd/res/values-da/strings.xml
+++ b/OsmAnd/res/values-da/strings.xml
@@ -2186,4 +2186,11 @@
Opdater alle (%1$s MB)
Indstil hvormange gratis filhentninger der er brugt
Gratis filhentninger brugt
+ Udklipsholder
+ geo:
+ QR-kode
+ Nulstiller flag, der angiver første opstart, beholder andre indstillinger i deres oprindelige tilstand
+ Simuler første opstart
+ Del placering
+ Send
diff --git a/OsmAnd/res/values-es-rAR/phrases.xml b/OsmAnd/res/values-es-rAR/phrases.xml
index 6c7931db67..3a7306c1ab 100644
--- a/OsmAnd/res/values-es-rAR/phrases.xml
+++ b/OsmAnd/res/values-es-rAR/phrases.xml
@@ -2226,4 +2226,21 @@
Estado de los escalones: mala
Estado de los escalones: pésima
+Cairn
+
+ Decoración de la fachada
+ Desfibrilador
+ Con desfibrilador
+
+ Tipo: guerra
+ Tipo: túmulo
+ Tipo: excavación en la roca
+ Tipo: hipogeo
+ Tipo: bóveda
+ Tipo: columbario
+ Tipo: panteón
+ Tipo: sarcófago
+ Tipo: cripta
+ Tipo: pirámide
+
diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml
index 4593d381c2..8e3971d319 100644
--- a/OsmAnd/res/values-es-rAR/strings.xml
+++ b/OsmAnd/res/values-es-rAR/strings.xml
@@ -2109,4 +2109,9 @@
Actualizar todo (%1$s MB)
Descargas gratis usadas
Puedes configurar cuántas descargas gratis ha usado
-
+Restablece la bandera que indica el primer arranque y mantiene los demás ajustes en su estado original
+ Simular arranque inicial
+ geo:
+ Compartir ubicación
+ Enviar
+
diff --git a/OsmAnd/res/values-es/phrases.xml b/OsmAnd/res/values-es/phrases.xml
index 4fc22257ec..909449cbc2 100644
--- a/OsmAnd/res/values-es/phrases.xml
+++ b/OsmAnd/res/values-es/phrases.xml
@@ -2230,4 +2230,21 @@
Estado de los escalones: mala
Estado de los escalones: pésima
+Cairn
+
+ Decoración de la fachada
+ Desfibrilador
+ Con desfibrilador
+
+ Tipo: guerra
+ Tipo: túmulo
+ Tipo: excavación en la roca
+ Tipo: hipogeo
+ Tipo: bóveda
+ Tipo: columbario
+ Tipo: panteón
+ Tipo: sarcófago
+ Tipo: cripta
+ Tipo: pirámide
+
diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml
index 43ebea60ca..2ae3d71009 100644
--- a/OsmAnd/res/values-es/strings.xml
+++ b/OsmAnd/res/values-es/strings.xml
@@ -58,10 +58,10 @@
Europa
Europa - Francia
Europa - Alemania
- Europa/Asia - Rusia
+ Rusia
África
Asia
- Oceanía
+ Australia y Oceanía
Mapas del mundo y temáticos
Wikipedia mundial
Mensajes de voz (grabado, funciones limitadas)
@@ -2245,4 +2245,9 @@
Actualizar todo (%1$s MB)
Descargas gratis usadas
Puedes configurar cuántas descargas gratis ha usado
-
+Restablece la bandera que indica el primer arranque y mantiene los demás ajustes en su estado original
+ Simular arranque inicial
+ geo:
+ Compartir ubicación
+ Enviar
+
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index 5fc234016e..1bbb2e89fd 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -2209,4 +2209,9 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
Tout mettre à jour (%1$s MB)
Téléchargements gratuits effectués
Visualiser le nombre de téléchargements gratuits déjà effectués
-
+Envoyer
+ Copier
+ geo :
+ QR-Code
+ Partager ce lieu
+
diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml
index 9748dc9088..216a77ac5c 100644
--- a/OsmAnd/res/values-it/strings.xml
+++ b/OsmAnd/res/values-it/strings.xml
@@ -1234,7 +1234,7 @@
Informazioni GPS
Livello ombreggiatura rilievi
OsmAnd Mappe & Navigazione
- " ↵ OsmAnd (OSM Automatico Navigazione Direzioni) è un\'applicazione di navigazione e visualizzazione mappe con accesso ai dati liberi, mondiali e di gran qualità di OpenStreetMap (OSM). Tutte le mappe possono essere memorizzate nella scheda di memoria del dispositivo per l\'utilizzo offline. Attraverso il GPS del dispositivo OsmAnd offre la navigazione, con eventualmente la guida vocale, per l\'auto, la bicicletta e a piedi. Tutte le funzionalità sono disponibili sia online che offline (non c\'è bisogno della connessione a internet).↵ ↵ Alcune delle principali caratteristiche:↵ ↵ Navigazione↵ - Funziona online (velocemente) oppure offline (nessun costo di roaming quando si è fuori rete)↵ - Guida vocale svolta per svolta(voci registrate e sintetizzate)↵ - Indicazione di corsia opzionale, indicazione del nome della strada, indicazione del tempo di arrivo stimato.↵ - Supporta punti intermedi dell\'itinerario↵ - Ricalcolo automatico del percorso se ci si va fuori rotta↵ - Ricerca dei luoghi per indirizzo, per tipo (es.: ristorante, hotel, stazione di rifornimento, museo) o tramite coordinate geografiche.↵ ↵ Visualizzazione della mappa↵ - Visualizza la vostra posizione e orientamento sulla mappa↵ - Opzionalmente allinea la mappa al compasso del dispositivo o alla direzione del movimento↵ - Salva i vostri luoghi più importanti come Favoriti↵ - Visualizza i PDI (punti d\'interesse) vicino a voi↵ - Può visualizzare specifiche mappe online a mattonelle↵ - Può Visualizzare la visualizzazione satellitare (da Bing)↵ - Può visualizzare diverse sovrapposizioni come tracce GPX rotte/navigazione e mappe addizionali con trasparenze personalizzabili↵ - Opzionalmente Visualizza i nomi dei luoghi in lingua Inglese, locale, o con la pronuncia fonetica↵ ↵ Uso dei dati OpenStreetMap e di Wikipedia:↵ - Informazioni di alta qualità dai migliori progetti collaborativi del mondo↵ - Mappe globali da OpenSteetMap, disponibili per nazione o regione↵ - PDI Wikipedia, grandi per visualizzazione (non disponibili nella versione gratuita)↵ - Download gratuiti illimitati, direttamente dall\'applicazione (limite di 16 download nella versione gratuita)↵ - Mappe sempre aggiornate (aggiornate almeno mensilmente)↵ - Mappe a vettori compatte↵ - Scelta fra mappe complete e solo strade (Esempio: tutto il Giappone è 700 MB oppure 200 MB per le sole strade)↵ - Supporto anche per le mappe a tasselli online o in cache↵ - Caratteristiche per la di sicurezza - Passaggio opzionale fra vista notte o giorno - Visualizzazione opzionale del limite di velocità con avviso se viene superato↵ - zoom opzionale correlato alla velocità↵ - Condividete la vostra posizione così i vostri amici possono trovarvi↵ ↵ - Funzionalità bici e a piedi↵ - Le mappe includono percorsi a piedi, per escursionismo e per bicicletta, ottimo per l\'attività all\'aria aperta↵ - Visualizzazione e rotte speciali per bicicletta e a piedi - Opzione fermate trasporto pubblico (autobus, treno, tram) inclusi i nomi delle vie↵ - Registrazione opzionale del viaggio in file GPX in locale, sul dispositivo, o attraverso un servizio online↵ - Visualizzazione opzionale dell\'altitudine e della velocità↵ - Visualizzazione delle curve di livello e dell\'ombreggiatura dei rilievi (attraverso plugin opzionali)↵ ↵ Contribuzione diretta a OpenStreetMap↵ - Segnala errori della mappa↵ - Carica le tracce GPX su OSM direttamente dall\'applicazione↵ - Aggiunge i PDI e li carica direttamente su OSM (oppure successivamente se offline)↵ - Registrazione opzionale del viaggio anche in modalità \"sullo sfondo\" (fintanto che il dispositivo è in modalità sleep)↵ ↵ OsmAnd è a sorgente aperto ed è attivamente sviluppato. Tutti possono contribuire all\'applicazione riportando errori, migliorando le traduzioni o programmando nuove caratteristiche. Il progetto è in un vitale stato di continuo sviluppo attraverso tutte queste forme di sviluppo e interazione degli utenti. Il progresso del progetto conta sui contributi finanziari costituire i fondi per lo sviluppo, la programmazione e il test di nuove funzionalità. Acquistando OsmAnd+ aiutate l\'applicazione ad essere ancora più fantastica! E\' anche possibile finanziare specifiche nuove funzionalità, o fare una donazione generica a osmand.net.↵ ↵ ↵ Qualità della mappa e copertura approssimativa: ↵ ↵ - Western Europe: ****↵ - Estern Europe: ***↵ - Russia: *** - North America: ***↵ - South America: **↵ - Asia: **↵ - Japan & Korea: ***↵ - Middle East: **↵ - Africa: **↵ - Antartica: *↵ ↵ Lista delle regioni supportate (sostanzialmente tutto il mondo!):↵ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bonaire, Bosnia and Herzegovina, Botswana, Brazil, British Virgin Islands, Brunei, Bulgaria, Burkina Faso, Burundi, Cambodia, Cameroon, Canada, Cape Verde, Central African Republic, Chad, Chile, China, Colombia, Comoros, Congo, Costa Rica, Ivory Coast, Croatia, Cuba, Curaçao, Cyprus, Czech Republic, Denmark, Djibouti, Dominica, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France, French Guiana, French Polynesia, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, Guinea-Bissau, Guyana, Haiti, Vatican, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Isle of Man, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, North Korea and South Korea, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mayotte, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, Netherlands Antilles, New Caledonia, New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palau, Palestinian Territory, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Puerto Rico, Qatar, Romania, Russia, Rwanda, Saint Barthelemy, Saint Helena, Saint Kitts and Nevis, Saint Lucia, Saint Martin, Saint Pierre and Miquelon, Saint Vincent and the Grenadines, Samoa, San Marino, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Somalia, South Africa, South Georgia, South Sudan, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Syria, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo, Tokelau, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Tuvalu, Uganda, Ukraine, United Arab Emirates, United Kingdom (UK), United States of America (USA), Uruguay, Uzbekistan, Vanuatu, Venezuela, Vietnam, Wallis and Futuna, Western Sahara, Yemen, Zambia, Zimbabwe.↵ → "
+ " ↵ OsmAnd (OSM Automatico Navigazione Direzioni) è un\'applicazione di navigazione e visualizzazione mappe con accesso ai dati liberi, mondiali e di gran qualità di OpenStreetMap (OSM). Tutte le mappe possono essere memorizzate nella scheda di memoria del dispositivo per l\'utilizzo offline. Attraverso il GPS del dispositivo OsmAnd offre la navigazione, con eventualmente la guida vocale, per l\'auto, la bicicletta e a piedi. Tutte le funzionalità sono disponibili sia online che offline (non c\'è bisogno della connessione a internet).↵ ↵ Alcune delle principali caratteristiche:↵ ↵ Navigazione↵ - Funziona online (velocemente) oppure offline (nessun costo di roaming quando si è fuori rete)↵ - Guida vocale svolta per svolta(voci registrate e sintetizzate)↵ - Indicazione di corsia opzionale, indicazione del nome della strada, indicazione del tempo di arrivo stimato.↵ - Supporta punti intermedi dell\'itinerario↵ - Ricalcolo automatico del percorso se ci si va fuori rotta↵ - Ricerca dei luoghi per indirizzo, per tipo (es.: ristorante, hotel, stazione di rifornimento, museo) o tramite coordinate geografiche.↵ ↵ Visualizzazione della mappa↵ - Visualizza la vostra posizione e orientamento sulla mappa↵ - Opzionalmente allinea la mappa al compasso del dispositivo o alla direzione del movimento↵ - Salva i vostri luoghi più importanti come Favoriti↵ - Visualizza i PDI (punti d\'interesse) vicino a voi↵ - Può visualizzare specifiche mappe online a mattonelle↵ - Può Visualizzare la visualizzazione satellitare (da Bing)↵ - Può visualizzare diverse sovrapposizioni come tracce GPX rotte/navigazione e mappe addizionali con trasparenze personalizzabili↵ - Opzionalmente Visualizza i nomi dei luoghi in lingua Inglese, locale, o con la pronuncia fonetica↵ ↵ Uso dei dati OpenStreetMap e di Wikipedia:↵ - Informazioni di alta qualità dai migliori progetti collaborativi del mondo↵ - Mappe globali da OpenSteetMap, disponibili per nazione o regione↵ - PDI Wikipedia, grandi per visualizzazione (non disponibili nella versione gratuita)↵ - Download gratuiti illimitati, direttamente dall\'applicazione (limite di 16 download nella versione gratuita)↵ - Mappe sempre aggiornate (aggiornate almeno mensilmente)↵ - Mappe a vettori compatte↵ - Scelta fra mappe complete e solo strade (Esempio: tutto il Giappone è 700 MB oppure 200 MB per le sole strade)↵ - Supporto anche per le mappe a tasselli online o in cache↵ - Caratteristiche per la di sicurezza - Passaggio opzionale fra vista notte o giorno - Visualizzazione opzionale del limite di velocità con avviso se viene superato↵ - zoom opzionale correlato alla velocità↵ - Condividete la vostra posizione così i vostri amici possono trovarvi↵ ↵ - Funzionalità bici e a piedi↵ - Le mappe includono percorsi a piedi, per escursionismo e per bicicletta, ottimo per l\'attività all\'aria aperta↵ - Visualizzazione e rotte speciali per bicicletta e a piedi - Opzione fermate trasporto pubblico (autobus, treno, tram) inclusi i nomi delle vie↵ - Registrazione opzionale del viaggio in file GPX in locale, sul dispositivo, o attraverso un servizio online↵ - Visualizzazione opzionale dell\'altitudine e della velocità↵ - Visualizzazione delle curve di livello e dell\'ombreggiatura dei rilievi (attraverso plugin opzionali)↵ ↵ Contribuzione diretta a OpenStreetMap↵ - Segnala errori della mappa↵ - Carica le tracce GPX su OSM direttamente dall\'applicazione↵ - Aggiunge i PDI e li carica direttamente su OSM (oppure successivamente se offline)↵ - Registrazione opzionale del viaggio anche in modalità \"sullo sfondo\" (fintanto che il dispositivo è in modalità sleep)↵ ↵ OsmAnd è a sorgente aperto ed è attivamente sviluppato. Tutti possono contribuire all\'applicazione riportando errori, migliorando le traduzioni o programmando nuove caratteristiche. Il progetto è in un vitale stato di continuo sviluppo attraverso tutte queste forme di sviluppo e interazione degli utenti. Il progresso del progetto conta sui contributi finanziari costituire i fondi per lo sviluppo, la programmazione e il test di nuove funzionalità. Acquistando OsmAnd+ aiutate l\'applicazione ad essere ancora più fantastica! E\' anche possibile finanziare specifiche nuove funzionalità, o fare una donazione generica a osmand.net.↵ ↵ ↵ Qualità della mappa e copertura approssimativa: ↵ ↵ - Western Europe: ****↵ - Estern Europe: ***↵ - Russia: *** - North America: ***↵ - South America: **↵ - Asia: **↵ - Japan & Korea: ***↵ - Middle East: **↵ - Africa: **↵ - Antartica: *↵ ↵ Lista delle regioni supportate (sostanzialmente tutto il mondo!):↵ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bonaire, Bosnia and Herzegovina, Botswana, Brazil, British Virgin Islands, Brunei, Bulgaria, Burkina Faso, Burundi, Cambodia, Cameroon, Canada, Cape Verde, Central African Republic, Chad, Cile, Cina, Colombia, Comoros, Congo, Costa Rica, Ivory Coast, Croatia, Cuba, Curaçao, Cyprus, Czech Republic, Danimarca, Djibouti, Dominica, Dominican Republic, Ecuador, Egypt, El Salvador, Emirati Arabi Uniti, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France, French Guiana, French Polynesia, Gabon, Gambia, Georgia, Germany, Ghana, Giamaica, Gibraltar, Grecia, Grenada, Groenlandia, Guadalupa, Guam, Guatemala, Guernsey, Guinea, Guinea-Bissau, Guyana, Haiti, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Isle of Man, Israel, Italia, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, North Korea and South Korea, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mayotte, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, Netherlands Antilles, New Caledonia, New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palau, Palestinian Territory, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Puerto Rico, Qatar, Romania, Russia, Rwanda, Saint Barthelemy, Saint Helena, Saint Kitts and Nevis, Saint Lucia, Saint Martin, Saint Pierre and Miquelon, Saint Vincent and the Grenadines, Samoa, San Marino, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Somalia, South Africa, South Georgia, South Sudan, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Syria, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo, Tokelau, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Tuvalu, Uganda, Ucraina, United Kingdom (UK), United States of America (USA), Uruguay, Uzbekistan, Vanuatu, Vaticano, Venezuela, Vietnam, Wallis and Futuna, Western Sahara, Yemen, Zambia, Zimbabwe.↵ → "
OsmAnd+ Mappe & Navigazione
" ↵ OsmAnd (OSM Automatico Navigazione Direzioni) è un\'applicazione di navigazione e visualizzazione mappe con accesso ai dati liberi, mondiali e di gran qualità di OpenStreetMap (OSM). Tutte le mappe possono essere memorizzate nella scheda di memoria del dispositivo per l\'utilizzo offline. Attraverso il GPS del dispositivo OsmAnd offre la navigazione, con eventualmente la guida vocale, per l\'auto, la bicicletta e a piedi. Tutte le principali funzionalità sono disponibili sia online che offline (non c\'è bisogno della connessione a internet).↵ ↵ OsmAnd+ è la versione a pagamento dell\'applicazione. Acquistandola voi sostenete il progetto, finanziate lo sviluppo di nuove caratteristiche e ricevete gli ultimi aggiornamenti. Potete provare l\'applicazione prima di acquistarla installando la versione gratuita chiamata OsmAnd.↵ ↵ Alcune delle principali caratteristiche:↵ ↵ Navigazione↵ - Funziona online (velocemente) oppure offline (nessun costo di roaming quando si è fuori rete)↵ - Guida vocale svolta per svolta(voci registrate e sintetizzate)↵ - Indicazione di corsia opzionale, indicazione del nome della strada, indicazione del tempo di arrivo stimato.↵ - Supporta punti intermedi dell\'itinerario↵ - Ricalcolo automatico del percorso se ci si va fuori rotta↵ - Ricerca dei luoghi per indirizzo, per tipo (es.: ristorante, hotel, stazione di rifornimento, museo) o tramite coordinate geografiche.↵ ↵ Visualizzazione della mappa↵ - Visualizza la vostra posizione e orientamento sulla mappa↵ - Opzionalmente allinea la mappa al compasso del dispositivo o alla direzione del movimento↵ - Salva i vostri luoghi più importanti come Favoriti↵ - Visualizza i PDI (punti d\'interesse) vicino a voi↵ - Può visualizzare specifiche mappe online a mattonelle↵ - Può Visualizzare la visualizzazione satellitare (da Bing)↵ - Può visualizzare diverse sovrapposizioni come tracce GPX rotte/navigazione e mappe addizionali con trasparenze personalizzabili↵ - Opzionalmente Visualizza i nomi dei luoghi in lingua Inglese, locale, o con la pronuncia fonetica↵ ↵ Uso dei dati OpenStreetMap e di Wikipedia: informazioni di alta qualità dai migliori progetti collaborativi del mondo↵ - Mappe globali da OpenSteetMap, disponibili per nazione o regione↵ - PDI Wikipedia, grandi per visualizzazione (non disponibili nella versione gratuita)↵ - Download gratuiti illimitati, direttamente dall\'applicazione (limite di 16 download nella versione gratuita)↵ - Mappe sempre aggiornate (aggiornate almeno mensilmente)↵ - Mappe a vettori compatte↵ - Scelta fra mappe complete e solo strade (Esempio: tutto il Giappone è 700 MB oppure 200 MB per le sole strade)↵ - Supporto anche per le mappe a tasselli online o in cache↵ ↵ Caratteristiche per la di sicurezza↵ - Passaggio opzionale fra vista notte o giorno - Visualizzazione opzionale del limite di velocità con avviso se viene superato↵ - zoom opzionale correlato alla velocità - Condividete la vostra posizione così i vostri amici possono trovarvi↵ ↵ - Funzionalità bici e a piedi↵ - Le mappe includono percorsi a piedi, per escursionismo e per bicicletta, ottimo per l\'attività all\'aria aperta↵ - Visualizzazione e rotte speciali per bicicletta e a piedi↵ - Opzione fermate trasporto pubblico (autobus, treno, tram) inclusi i nomi delle vie↵ - Registrazione opzionale del viaggio in file GPX in locale, sul dispositivo, o attraverso un servizio online↵ - Visualizzazione opzionale dell\'altitudine e della velocità↵ - Visualizzazione delle curve di livello e dell\'ombreggiatura dei rilievi (attraverso plugin opzionali) ↵ Contribuzione diretta a OpenStreetMap↵ - Segnala errori della mappa↵ - Carica le tracce GPX su OSM direttamente dall\'applicazione↵ - Aggiunge i PDI e li carica direttamente su OSM (oppure successivamente se offline)↵ - Registrazione opzionale del viaggio anche in modalità \"sullo sfondo\" (fintanto che il dispositivo è in modalità sleep)↵ ↵ - OsmAnd è a sorgente aperto ed è attivamente sviluppato. Tutti possono contribuire all\'applicazione riportando errori, migliorando le traduzioni o programmando nuove caratteristiche. Il progetto è in un vitale stato di continuo sviluppo attraverso tutte queste forme di sviluppo e interazione degli utenti. Il progresso del progetto conta sui contributi finanziari costituire i fondi per lo sviluppo, la programmazione e il test di nuove funzionalità. Acquistando OsmAnd+ aiutate l\'applicazione ad essere ancora più fantastica! E\' anche possibile finanziare specifiche nuove funzionalità, o fare una donazione generica a osmand.net.↵ ↵ Qualità della mappa e copertura approssimativa:↵ - Western Europe: ****↵ - Estern Europe: ***↵ - Russia: ***↵ - North America: ***↵ - South America: **↵ - Asia: **↵ - Japan & Korea: ***↵ - Middle East: **↵ - Africa: **↵ - Antartica: * ↵ ↵ Lista delle regioni supportate (fondamentalmente tutto il mondo!):↵ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bonaire, Bosnia and Herzegovina, Botswana, Brazil, British Virgin Islands, Brunei, Bulgaria, Burkina Faso, Burundi, Cambodia, Cameroon, Canada, Cape Verde, Central African Republic, Chad, Chile, China, Colombia, Comoros, Congo, Costa Rica, Ivory Coast, Croatia, Cuba, Curaçao, Cyprus, Czech Republic, Denmark, Djibouti, Dominica, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France, French Guiana, French Polynesia, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, Guinea-Bissau, Guyana, Haiti, Vatican, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Isle of Man, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, North Korea and South Korea, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macao, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Martinique, Mauritania, Mauritius, Mayotte, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands, Netherlands Antilles, New Caledonia, New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palau, Palestinian Territory, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Puerto Rico, Qatar, Romania, Russia, Rwanda, Saint Barthelemy, Saint Helena, Saint Kitts and Nevis, Saint Lucia, Saint Martin, Saint Pierre and Miquelon, Saint Vincent and the Grenadines, Samoa, San Marino, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Somalia, South Africa, South Georgia, South Sudan, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Syria, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo, Tokelau, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Tuvalu, Uganda, Ukraine, United Arab Emirates, United Kingdom (UK), United States of America (USA), Uruguay, Uzbekistan, Vanuatu, Venezuela, Vietnam, Wallis and Futuna, Western Sahara, Yemen, Zambia, Zimbabwe.↵ "
Novità nella versione 1.1.4:
@@ -1917,7 +1917,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
…
OK
Annulla
- Abbandona
+ Chiudi
Si
No
Acceso
@@ -2230,4 +2230,9 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
Aggiorna tutto (%1$s MB)
Download gratuiti utilizzati
Puoi impostare quanti download gratuiti hai utilizzato
-
+geo:
+ Invia
+ "Resetta l\'indicatore del primo avvio, non modificare tutte le altre impostazioni"
+ Simula il primo avvio
+ Condivisi la posizione
+
diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml
index 2ad673cc35..15b0e0fc59 100644
--- a/OsmAnd/res/values-ru/phrases.xml
+++ b/OsmAnd/res/values-ru/phrases.xml
@@ -913,7 +913,7 @@
Неразмеченный
Население
- Дата начала постройки
+ Дата окончания постройки
Доступно для инвалидных кресел
Недоступно для инвалидных кресел
Инвалидные кресла: ограничено
diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml
index 46a15f94a1..b01ba845af 100644
--- a/OsmAnd/res/values-ru/strings.xml
+++ b/OsmAnd/res/values-ru/strings.xml
@@ -212,7 +212,7 @@
Евразия - Россия
Африка
Азия
- Океания
+ Австралия и Океания
Карты мира
Всемирная Википедия
Голосовые данные (запись)
@@ -2148,4 +2148,7 @@
Обновить все (%1$s Мб)
Использовано бесплатных загрузок
Вы можете посмотреть сколько бесплатных загрузок вы использовали
-
+Буфер обмена
+ QR-код
+ гео:
+
diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml
index 564860197b..6ef07d90e3 100644
--- a/OsmAnd/res/values-sv/strings.xml
+++ b/OsmAnd/res/values-sv/strings.xml
@@ -332,7 +332,7 @@
Europa
Europa - Frankrike
Europa - Tyskland
-Europa/Asien - Ryssland
+Ryssland
Afrika
Asien
Oceanien
@@ -2049,4 +2049,7 @@
Gratis nedladdningar hämtade
Du kan ange hur många gratis nedladdningar som du har gjort
Hämtar - %1$d fil(er)
+ Urklipp
+ geo:
+ QR-kod
diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml
index aaab016988..fe2d48aa40 100644
--- a/OsmAnd/res/values-zh-rTW/phrases.xml
+++ b/OsmAnd/res/values-zh-rTW/phrases.xml
@@ -2014,4 +2014,30 @@
工藝不朽的遺迹
露營服務處
+ 模型機的機場
+ 導遊辦公室
+ 特殊法人
+ 諮詢辦公室
+ 合作辦公室
+ 林務辦公室
+ 後勤辦公室
+ 教區辦公室
+ 出版業辦公室
+
+ 91UL 燃料
+ 100LL 燃料
+ 液化石油氣
+ Jet A-1 燃料
+ AdBlue 燃料
+
+ 燃料:木材
+ 燃料:木炭
+ 燃料:煤
+
+ 路燈
+
+ 躲避道
+
+ 作物:水稻
+ 作物:牧草
diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml
index bf05a6d55c..8974904266 100644
--- a/OsmAnd/res/values-zh-rTW/strings.xml
+++ b/OsmAnd/res/values-zh-rTW/strings.xml
@@ -2165,4 +2165,9 @@
全部更新 (%1$s MB)
免費下載使用
您可以設置,您有使用多少免費下載
-
+重置標誌指示第一次啟動,保持著其它設定在原來的狀態
+ 模擬初始啟動
+ 地理:
+ 分享位置
+ 發送
+
diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml
index 3f47de8df5..f4b3be9fa3 100644
--- a/OsmAnd/res/values/attrs.xml
+++ b/OsmAnd/res/values/attrs.xml
@@ -14,6 +14,8 @@
+
+
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index c96d2db668..d7d89ff674 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,11 @@
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
-->
+ "Resets flag indicating first startup, keep other settings in the original state"
+ Simulate initial startup
+ geo:
+ Share location
+ Send
Specified category name already exists. Please define other name.
Category name
Add new category
diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml
index 7233aa84cd..17d2351ae4 100644
--- a/OsmAnd/res/values/styles.xml
+++ b/OsmAnd/res/values/styles.xml
@@ -67,6 +67,8 @@
- @color/bg_color_light
- @drawable/bg_card_light
- @drawable/bg_map_context_menu_light
+ - @drawable/bg_bottom_menu_light
+ - @drawable/bg_left_menu_light
- @drawable/bg_point_editor_view_light
- @color/dashboard_divider_light
- @color/divider_color
@@ -158,6 +160,8 @@
- @color/bg_color_dark
- @drawable/bg_card_dark
- @drawable/bg_map_context_menu_dark
+ - @drawable/bg_bottom_menu_dark
+ - @drawable/bg_left_menu_dark
- @drawable/bg_point_editor_view_dark
- @color/dashboard_divider_dark
- @color/dashboard_divider_dark
diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java
index 7f78785a65..b02b0e00af 100644
--- a/OsmAnd/src/net/osmand/plus/AppInitializer.java
+++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java
@@ -56,8 +56,11 @@ import btools.routingapp.BRouterServiceConnection;
public class AppInitializer implements IProgress {
public static final boolean TIPS_AND_TRICKS = false;
-
+ private static final String FIRST_TIME_APP_RUN = "FIRST_TIME_APP_RUN"; //$NON-NLS-1$
+ public static final String NUMBER_OF_STARTS = "NUMBER_OF_STARTS"; //$NON-NLS-1$
+ public static final String FIRST_INSTALLED = "FIRST_INSTALLED"; //$NON-NLS-1$
private static final String VECTOR_INDEXES_CHECK = "VECTOR_INDEXES_CHECK"; //$NON-NLS-1$
+ private static final String VERSION_INSTALLED = "VERSION_INSTALLED"; //$NON-NLS-1$
private static final String EXCEPTION_FILE_SIZE = "EXCEPTION_FS"; //$NON-NLS-1$
public static final String LATEST_CHANGES_URL = "changes-2.1.html";
@@ -76,6 +79,7 @@ public class AppInitializer implements IProgress {
private List warnings = new ArrayList();
private String taskName;
private List listeners = new ArrayList();
+ private SharedPreferences startPrefs;
public enum InitEvents {
FAVORITES_INITIALIZED, NATIVE_INITIALIZED,
@@ -110,22 +114,46 @@ public class AppInitializer implements IProgress {
if(initSettings) {
return;
}
- OsmandSettings settings = getSettings(activity);
- firstTime = settings.FIRST_TIME_APP_RUN.get();
- if (firstTime) {
- settings.FIRST_TIME_APP_RUN.set(false);
- settings.VERSION_INSTALLED.set(Version.getFullVersion(app));
- } else if (!Version.getFullVersion(app).equals(settings.VERSION_INSTALLED.get())) {
- settings.VERSION_INSTALLED.set(Version.getFullVersion(app));
+ startPrefs = activity.getPreferences(Context.MODE_WORLD_WRITEABLE);
+ if(!startPrefs.contains(NUMBER_OF_STARTS)) {
+ startPrefs.edit().putInt(NUMBER_OF_STARTS, 1).commit();
+ } else {
+ startPrefs.edit().putInt(NUMBER_OF_STARTS, startPrefs.getInt(NUMBER_OF_STARTS, 0) + 1).commit();
+ }
+ if (!startPrefs.contains(FIRST_INSTALLED)) {
+ startPrefs.edit().putLong(FIRST_INSTALLED, System.currentTimeMillis()).commit();
+ }
+ if (!startPrefs.contains(FIRST_TIME_APP_RUN)) {
+ firstTime = true;
+ startPrefs.edit().putBoolean(FIRST_TIME_APP_RUN, true).commit();
+ startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit();
+ } else if (!Version.getFullVersion(app).equals(startPrefs.getString(VERSION_INSTALLED, ""))) {
+ startPrefs.edit().putString(VERSION_INSTALLED, Version.getFullVersion(app)).commit();
appVersionChanged = true;
}
- settings.NUMBER_OF_APPLICATION_STARTS.set(settings.NUMBER_OF_APPLICATION_STARTS.get() + 1);
- if (settings.FIRST_INSTALLED_DATE.get() == -1) {
- settings.FIRST_INSTALLED_DATE.set(System.currentTimeMillis());
- }
initSettings = true;
}
+ public int getNumberOfStarts() {
+ if(startPrefs == null) {
+ return 0;
+ }
+ return startPrefs.getInt(NUMBER_OF_STARTS, 1);
+ }
+
+ public long getFirstInstalled() {
+ if(startPrefs == null) {
+ return 0;
+ }
+ return startPrefs.getLong(FIRST_INSTALLED, 0);
+ }
+
+ public void resetFirstTimeRun() {
+ if(startPrefs != null) {
+ startPrefs.edit().remove(FIRST_TIME_APP_RUN).commit();
+ }
+ }
+
public boolean isFirstTime(Activity activity) {
initUiVars(activity);
return firstTime;
@@ -134,17 +162,7 @@ public class AppInitializer implements IProgress {
public void setFirstTime(boolean firstTime) {
this.firstTime = firstTime;
}
-
- public void writeFirstTime(boolean firstTime, Activity activity) {
- setFirstTime(firstTime);
- OsmandSettings settings = getSettings(activity);
- settings.FIRST_TIME_APP_RUN.set(firstTime);
- }
-
- private OsmandSettings getSettings(Activity activity) {
- return ((OsmandApplication) activity.getApplication()).getSettings();
- }
-
+
public boolean checkAppVersionChanged(Activity activity) {
initUiVars(activity);
boolean showRecentChangesDialog = !firstTime && appVersionChanged;
@@ -157,8 +175,20 @@ public class AppInitializer implements IProgress {
activityChangesShowed = true;
return true;
}
+ checkMapUpdates();
+
return false;
}
+
+ private void checkMapUpdates() {
+ long diff = System.currentTimeMillis() - app.getSettings().LAST_CHECKED_UPDATES.get();
+ if(diff >= 2 * 24 * 60 * 60l && new Random().nextInt(5) == 0 &&
+ app.getSettings().isInternetConnectionAvailable()) {
+ app.getDownloadThread().runReloadIndexFiles();
+ } else if(Version.isDeveloperVersion(app)) {
+// app.getDownloadThread().runReloadIndexFiles();
+ }
+ }
public boolean checkPreviousRunsForExceptions(Activity activity, boolean writeFileSize) {
initUiVars(activity);
@@ -422,6 +452,9 @@ public class AppInitializer implements IProgress {
}
+
+
+
private void restoreBackupForFavoritesFiles() {
final File appDir = app.getAppPath(null);
File save = new File(appDir, FavouritesDbHelper.FILE_TO_SAVE);
@@ -622,4 +655,7 @@ public class AppInitializer implements IProgress {
public void removeListener(AppInitializeListener listener) {
this.listeners.remove(listener);
}
+
+
+
}
diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
index 3141cf028a..dd23b8c655 100644
--- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
@@ -173,6 +173,7 @@ public class ContextMenuAdapter {
i.name = name;
return i;
}
+
public Item item(int resId) {
Item i = new Item();
@@ -206,6 +207,7 @@ public class ContextMenuAdapter {
this.lightIcon = icon;
return this;
}
+
public Item position(int pos) {
this.pos = pos;
@@ -257,6 +259,12 @@ public class ContextMenuAdapter {
cat = b;
return this;
}
+
+ public Item name(String name) {
+ this.name = name;
+ return this;
+ }
+
}
public String[] getItemNames() {
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index 332aa851a5..ab4ae0917b 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -23,6 +23,7 @@ import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.api.SQLiteAPI;
import net.osmand.plus.api.SQLiteAPIImpl;
import net.osmand.plus.dashboard.DashRateUsFragment;
+import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.helpers.AvoidSpecificRoads;
import net.osmand.plus.helpers.WaypointHelper;
import net.osmand.plus.monitoring.LiveMonitoringHelper;
@@ -93,6 +94,7 @@ public class OsmandApplication extends Application {
LiveMonitoringHelper liveMonitoringHelper;
TargetPointsHelper targetPointsHelper;
WaypointHelper waypointHelper;
+ DownloadIndexesThread downloadIndexesThread;
AvoidSpecificRoads avoidSpecificRoads;
BRouterServiceConnection bRouterServiceConnection;
OsmandRegions regions;
@@ -250,6 +252,13 @@ public class OsmandApplication extends Application {
public DayNightHelper getDaynightHelper() {
return daynightHelper;
}
+
+ public synchronized DownloadIndexesThread getDownloadThread() {
+ if(downloadIndexesThread == null) {
+ downloadIndexesThread = new DownloadIndexesThread(this);
+ }
+ return downloadIndexesThread;
+ }
@Override
public void onLowMemory() {
diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
index 832696cc4f..958e903f60 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
@@ -1874,8 +1874,6 @@ public class OsmandSettings {
public final CommonPreference SHOW_RULER =
new BooleanPreference("show_ruler", true).makeProfile().cache();
- public final OsmandPreference FIRST_INSTALLED_DATE = new LongPreference("first_installed_date", -1).makeGlobal();
-
// public final OsmandPreference NUMBER_OF_FREE_DOWNLOADS_V2 = new IntPreference("free_downloads_v2", 0).makeGlobal();
public final OsmandPreference NUMBER_OF_FREE_DOWNLOADS = new IntPreference("free_downloads_v3", 0).makeGlobal();
@@ -1883,17 +1881,17 @@ public class OsmandSettings {
// For DashRateUsFragment
public final OsmandPreference LAST_DISPLAY_TIME =
new LongPreference("last_display_time", 0).makeGlobal().cache();
+
+ public final OsmandPreference LAST_CHECKED_UPDATES =
+ new LongPreference("last_checked_updates", 0).makeGlobal();
+
public final OsmandPreference NUMBER_OF_APPLICATION_STARTS =
- new IntPreference("number_of_application_starts", 0).makeGlobal().cache();
+ new IntPreference("number_of_app_starts", 0).makeGlobal().cache();
+
public final OsmandPreference RATE_US_STATE =
new EnumIntPreference<>("rate_us_state",
DashRateUsFragment.RateUsState.INITIAL_STATE, DashRateUsFragment.RateUsState.values())
- .makeGlobal()
- .cache();
- public final OsmandPreference FIRST_TIME_APP_RUN =
- new BooleanPreference("first_time_app_run", true).makeGlobal().cache();
- public final OsmandPreference VERSION_INSTALLED =
- new StringPreference("version_installed", null).makeGlobal().cache();
+ .makeGlobal();
public enum DayNightMode {
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 7f84f0e50b..a1d7357545 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -31,7 +31,6 @@ import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
-
import net.osmand.Location;
import net.osmand.StateChangedListener;
import net.osmand.access.AccessibilityPlugin;
@@ -89,6 +88,7 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -240,7 +240,6 @@ public class MapActivity extends AccessibleActivity {
}
-
private void checkAppInitialization() {
if (app.isApplicationInitializing()) {
findViewById(R.id.init_progress).setVisibility(View.VISIBLE);
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index 717477096f..0b7a3a3193 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -1,11 +1,25 @@
package net.osmand.plus.activities;
-import java.io.File;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.AlertDialog.Builder;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
import net.londatiga.android.ActionItem;
import net.londatiga.android.QuickAction;
import net.osmand.IndexConstants;
@@ -31,10 +45,10 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.actions.OsmAndDialogs;
-import net.osmand.plus.activities.actions.ShareLocation;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
import net.osmand.plus.dialogs.FavoriteDialogs;
+import net.osmand.plus.download.IndexItem;
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.views.BaseMapLayer;
@@ -44,26 +58,11 @@ import net.osmand.util.MapUtils;
import org.apache.commons.logging.Log;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.AlertDialog.Builder;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.graphics.drawable.Drawable;
-import android.os.AsyncTask;
-import android.os.Bundle;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.view.WindowManager;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.EditText;
-import android.widget.ListView;
-import android.widget.TextView;
-import android.widget.Toast;
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
public class MapActivityActions implements DialogProvider {
private static final Log LOG = PlatformUtil.getLog(MapActivityActions.class);
@@ -92,11 +91,6 @@ public class MapActivityActions implements DialogProvider {
routingHelper = mapActivity.getMyApplication().getRoutingHelper();
}
- public void shareLocation(double latitude, double longitude) {
- enhance(dialogBundle, latitude, longitude, mapActivity.getMapView().getZoom());
- new ShareLocation(mapActivity).run();
- }
-
public void showNavigationContextMenuPoint(final double latitude, final double longitude) {
final ContextMenuAdapter adapter = new ContextMenuAdapter(mapActivity);
@@ -704,8 +698,14 @@ public class MapActivityActions implements DialogProvider {
return false;
}
}).reg();
-
- optionsMenuHelper.item(R.string.index_settings).iconColor(R.drawable.ic_type_archive)
+ String d = getString(R.string.index_settings);
+ if(app.getDownloadThread().getIndexes().isDownloadedFromInternet) {
+ List updt = app.getDownloadThread().getIndexes().getItemsToUpdate();
+ if(updt != null && updt.size() > 0) {
+ d += " ("+updt.size()+")";
+ }
+ }
+ optionsMenuHelper.item(R.string.index_settings).name(d).iconColor(R.drawable.ic_type_archive)
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter> adapter, int itemId, int pos, boolean isChecked) {
diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/ShareLocation.java b/OsmAnd/src/net/osmand/plus/activities/actions/ShareLocation.java
deleted file mode 100644
index 3208180c30..0000000000
--- a/OsmAnd/src/net/osmand/plus/activities/actions/ShareLocation.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package net.osmand.plus.activities.actions;
-
-import net.osmand.plus.R;
-import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.activities.MapActivityActions;
-import net.osmand.util.MapUtils;
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.AlertDialog.Builder;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.widget.Toast;
-
-public class ShareLocation extends OsmAndAction {
-
- public ShareLocation(MapActivity mapActivity) {
- super(mapActivity);
- }
-
- @Override
- public int getDialogID() {
- return OsmAndDialogs.DIALOG_SHARE_LOCATION;
- }
-
- @Override
- public void run() {
- super.showDialog();
- }
-
- public Dialog createDialog(Activity activity, final Bundle args) {
- mapActivity = (MapActivity) activity;
- AlertDialog.Builder builder = new Builder(mapActivity);
- builder.setTitle(R.string.send_location_way_choose_title);
-// "Email", "SMS",
- builder.setItems(new String[]{
- activity.getString(R.string.shared_string_message), "Clipboard", "geo:", "QR-Code"
- }, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- final double latitude = args.getDouble(MapActivityActions.KEY_LATITUDE);
- final double longitude = args.getDouble(MapActivityActions.KEY_LONGITUDE);
- final int zoom = args.getInt(MapActivityActions.KEY_ZOOM);
- try {
- final String geoUrl = MapUtils.buildGeoUrl(latitude, longitude, zoom);
- // TODO change this to HTTPS once it is setup!
- final String httpUrl = "http://osmand.net/go?lat=" + ((float) latitude) + "&lon=" + ((float) longitude) + "&z=" + zoom;
- String sms = mapActivity.getString(R.string.send_location_sms_pattern, geoUrl, httpUrl);
- if (which == 0) {
- sendMessage(sms);
-// } else if (which == 1) {
-// sendEmail(httpUrl, geoUrl);
-// } else if (which == 2) {
-// sendSms(sms);
- } else if (which == 1) {
- sendToClipboard(sms);
- } else if (which == 2) {
- sendGeoActivity(geoUrl);
- } else if (which == 3) {
- sendQRCode(latitude, longitude);
- }
- } catch (RuntimeException e) {
- Toast.makeText(mapActivity, R.string.shared_string_io_error, Toast.LENGTH_SHORT).show();
- }
- }
- });
- return builder.create();
- }
-
- private void sendMessage(String sms) {
- ShareDialog.sendMessage(mapActivity, sms);
- }
-
-
- private void sendEmail(final String httpUrl, final String geoUrl) {
- String email = mapActivity.getString(R.string.send_location_email_pattern, httpUrl, geoUrl);
- ShareDialog.sendEmail(mapActivity, email, getString(R.string.send_location));
- }
-
- private void sendSms(String sms) {
- ShareDialog.sendSms(mapActivity, sms);
- }
-
- private void sendToClipboard(String sms) {
- ShareDialog.sendToClipboard(mapActivity, sms);
-
- }
-
- private void sendGeoActivity(final String geoUrl) {
- Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(geoUrl));
- mapActivity.startActivity(mapIntent);
- }
-
- private void sendQRCode(final double latitude, final double longitude) {
- Bundle bundle = new Bundle();
- bundle.putFloat("LAT", (float) latitude);
- bundle.putFloat("LONG", (float) longitude);
- ShareDialog.sendQRCode(mapActivity, "LOCATION_TYPE", bundle, null);
- }
-
-
-}
diff --git a/OsmAnd/src/net/osmand/plus/base/BasicProgressAsyncTask.java b/OsmAnd/src/net/osmand/plus/base/BasicProgressAsyncTask.java
index c0d0008361..6eac51c0e6 100644
--- a/OsmAnd/src/net/osmand/plus/base/BasicProgressAsyncTask.java
+++ b/OsmAnd/src/net/osmand/plus/base/BasicProgressAsyncTask.java
@@ -2,8 +2,8 @@ package net.osmand.plus.base;
import net.osmand.IProgress;
import net.osmand.plus.OsmAndConstants;
+import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
-import android.content.Context;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;
@@ -14,13 +14,13 @@ public abstract class BasicProgressAsyncTask exte
protected int deltaProgress;
protected int work;
protected String message = ""; //$NON-NLS-1$
- protected Context ctx;
+ protected OsmandApplication ctx;
protected boolean interrupted = false;
protected Tag tag;
private Handler uiHandler;
- public BasicProgressAsyncTask(Context ctx) {
- this.ctx = ctx;
+ public BasicProgressAsyncTask(OsmandApplication app) {
+ this.ctx = app;
this.work = -1;
}
diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java
index 9662fb80df..27ffe3d2a1 100644
--- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java
+++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java
@@ -10,6 +10,7 @@ import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndLocationSimulation;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
+import net.osmand.plus.Version;
import net.osmand.plus.activities.SettingsBaseActivity;
import net.osmand.plus.activities.actions.AppModeDialog;
import net.osmand.util.SunriseSunset;
@@ -58,8 +59,24 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
cat.addPreference(openGlRender);
- cat.addPreference(createCheckBoxPreference(settings.BETA_TESTING_LIVE_UPDATES,
+ final Preference firstRunPreference = new Preference(this);
+ firstRunPreference.setTitle(R.string.simulate_initial_startup);
+ firstRunPreference.setSummary(R.string.simulate_initial_startup_descr);
+ firstRunPreference.setSelectable(true);
+ firstRunPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ getMyApplication().getAppInitializer().resetFirstTimeRun();
+ getMyApplication().showToastMessage(R.string.shared_string_ok);
+ return true;
+ }
+ });
+ cat.addPreference(firstRunPreference);
+
+ if(Version.isDeveloperVersion(getMyApplication())) {
+ cat.addPreference(createCheckBoxPreference(settings.BETA_TESTING_LIVE_UPDATES,
"Live updates", "Beta testing for live updates"));
+ }
Preference pref = new Preference(this);
final Preference simulate = pref;
final OsmAndLocationSimulation sim = getMyApplication().getLocationProvider().getLocationSimulation();
@@ -182,21 +199,6 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
cat.addPreference(createCheckBoxPreference(settings.SHOULD_SHOW_FREE_VERSION_BANNER,
R.string.show_free_version_banner,
R.string.show_free_version_banner_description));
- final Preference firstRunPreference = new Preference(this);
- firstRunPreference.setTitle("Reset first run");
- firstRunPreference.setSummary("After reset app wold act like it is it's firs run");
- firstRunPreference.setSelectable(true);
- firstRunPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
- @Override
- public boolean onPreferenceClick(Preference preference) {
- final SettingsDevelopmentActivity activity = SettingsDevelopmentActivity.this;
- activity.getMyApplication().getAppInitializer()
- .writeFirstTime(true, activity);
- firstRunPreference.setSummary("First run flag has been reset");
- return true;
- }
- });
- cat.addPreference(firstRunPreference);
}
protected void availableProfileDialog() {
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
index fdc9cd318c..947d4c9411 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
@@ -4,8 +4,10 @@ import java.io.File;
import java.lang.ref.WeakReference;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Set;
import net.osmand.IProgress;
import net.osmand.access.AccessibleToast;
@@ -13,6 +15,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.Version;
+import net.osmand.plus.activities.ActionBarProgressActivity;
import net.osmand.plus.activities.LocalIndexInfo;
import net.osmand.plus.activities.TabActivity;
import net.osmand.plus.base.BasicProgressAsyncTask;
@@ -23,6 +26,7 @@ import net.osmand.plus.download.ui.DownloadResourceGroupFragment;
import net.osmand.plus.download.ui.LocalIndexesFragment;
import net.osmand.plus.download.ui.UpdatesIndexFragment;
import net.osmand.plus.views.controls.PagerSlidingTabStrip;
+import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
@@ -41,7 +45,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
-public class DownloadActivity extends BaseDownloadActivity {
+public class DownloadActivity extends ActionBarProgressActivity implements DownloadEvents {
public static final int UPDATES_TAB_NUMBER = 2;
public static final int LOCAL_TAB_NUMBER = 1;
public static final int DOWNLOAD_TAB_NUMBER = 0;
@@ -62,11 +66,16 @@ public class DownloadActivity extends BaseDownloadActivity {
private ViewPager viewPager;
private String filter;
private String filterCat;
+ protected Set> fragSet = new HashSet<>();
+ private DownloadIndexesThread downloadThread;
+ private DownloadValidationManager downloadValidationManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
getMyApplication().applyTheme(this);
super.onCreate(savedInstanceState);
+ downloadValidationManager = new DownloadValidationManager(getMyApplication());
+ downloadThread = getMyApplication().getDownloadThread();
DownloadResources indexes = getDownloadThread().getIndexes();
if (!indexes.isDownloadedFromInternet) {
getDownloadThread().runReloadIndexFiles();
@@ -128,11 +137,29 @@ public class DownloadActivity extends BaseDownloadActivity {
}
new DataStoragePlaceDialogFragment().show(getFragmentManager(), null);
}
+
+ public DownloadIndexesThread getDownloadThread() {
+ return downloadThread;
+ }
+
+ public void startDownload(IndexItem... indexItem) {
+ downloadValidationManager.startDownload(this, indexItem);
+ }
+
+ public void makeSureUserCancelDownload(IndexItem item) {
+ downloadValidationManager.makeSureUserCancelDownload(this, item);
+ }
+
+ @Override
+ public void onAttachFragment(Fragment fragment) {
+ fragSet.add(new WeakReference(fragment));
+ }
@Override
protected void onResume() {
super.onResume();
getMyApplication().getAppCustomization().resumeActivity(DownloadActivity.class, this);
+ downloadThread.setUiActivity(this);
downloadInProgress();
}
@@ -156,11 +183,16 @@ public class DownloadActivity extends BaseDownloadActivity {
public List getLocalIndexInfos() {
return localIndexInfos;
}
+
+ public OsmandApplication getMyApplication() {
+ return (OsmandApplication) getApplication();
+ }
@Override
public void onPause() {
super.onPause();
getMyApplication().getAppCustomization().pauseActivity(DownloadActivity.class);
+ downloadThread.setUiActivity(null);
}
@Override
@@ -246,7 +278,7 @@ public class DownloadActivity extends BaseDownloadActivity {
public static boolean isDownlodingPermitted(OsmandSettings settings) {
final Integer mapsDownloaded = settings.NUMBER_OF_FREE_DOWNLOADS.get();
- int downloadsLeft = BaseDownloadActivity.MAXIMUM_AVAILABLE_FREE_DOWNLOADS - mapsDownloaded;
+ int downloadsLeft = DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS - mapsDownloaded;
return Math.max(downloadsLeft, 0) > 0;
}
@@ -346,15 +378,15 @@ public class DownloadActivity extends BaseDownloadActivity {
return;
}
freeVersionBanner.setVisibility(View.VISIBLE);
- downloadsLeftProgressBar.setMax(BaseDownloadActivity.MAXIMUM_AVAILABLE_FREE_DOWNLOADS);
+ downloadsLeftProgressBar.setMax(DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS);
freeVersionDescriptionTextView.setText(ctx.getString(R.string.free_version_message,
- BaseDownloadActivity.MAXIMUM_AVAILABLE_FREE_DOWNLOADS));
+ DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS));
freeVersionBanner.findViewById(R.id.getFullVersionButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- BaseDownloadActivity context = (BaseDownloadActivity) v.getContext();
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix(context
- .getMyApplication()) + "net.osmand.plus"));
+ Activity context = (Activity) v.getContext();
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix((OsmandApplication) context
+ .getApplication()) + "net.osmand.plus"));
try {
context.startActivity(intent);
} catch (ActivityNotFoundException e) {
@@ -374,7 +406,7 @@ public class DownloadActivity extends BaseDownloadActivity {
OsmandSettings settings = application.getSettings();
final Integer mapsDownloaded = settings.NUMBER_OF_FREE_DOWNLOADS.get();
downloadsLeftProgressBar.setProgress(mapsDownloaded);
- int downloadsLeft = BaseDownloadActivity.MAXIMUM_AVAILABLE_FREE_DOWNLOADS - mapsDownloaded;
+ int downloadsLeft = DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS - mapsDownloaded;
downloadsLeft = Math.max(downloadsLeft, 0);
if (downloadsLeft <= 0) {
laterButton.setVisibility(View.GONE);
@@ -477,4 +509,8 @@ public class DownloadActivity extends BaseDownloadActivity {
messageTextView.setText(R.string.device_memory);
}
+
+
+
+
}
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
index dde6f583a4..f60b6a8252 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
@@ -25,6 +25,7 @@ import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
import android.annotation.SuppressLint;
+import android.app.Activity;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.NotificationManager;
@@ -48,10 +49,9 @@ import android.widget.Toast;
public class DownloadIndexesThread {
private final static Log LOG = PlatformUtil.getLog(DownloadIndexesThread.class);
private static final int NOTIFICATION_ID = 45;
- private final Context ctx;
private OsmandApplication app;
- private BaseDownloadActivity uiActivity = null;
+ private DownloadEvents uiActivity = null;
private DatabaseHelper dbHelper;
private DownloadFileHelper downloadFileHelper;
private List> currentRunningTask = Collections.synchronizedList(new ArrayList>());
@@ -72,9 +72,8 @@ public class DownloadIndexesThread {
}
- public DownloadIndexesThread(Context ctx) {
- this.ctx = ctx;
- app = (OsmandApplication) ctx.getApplicationContext();
+ public DownloadIndexesThread(OsmandApplication app) {
+ this.app = app;
indexes = new DownloadResources(app);
updateLoadedFiles();
downloadFileHelper = new DownloadFileHelper(app);
@@ -86,7 +85,7 @@ public class DownloadIndexesThread {
}
/// UI notifications methods
- public void setUiActivity(BaseDownloadActivity uiActivity) {
+ public void setUiActivity(DownloadEvents uiActivity) {
this.uiActivity = uiActivity;
}
@@ -200,7 +199,7 @@ public class DownloadIndexesThread {
if (checkRunning()) {
return;
}
- execute(new ReloadIndexesTask(ctx));
+ execute(new ReloadIndexesTask());
}
public void runDownloadFiles(IndexItem... items) {
@@ -213,7 +212,7 @@ public class DownloadIndexesThread {
indexItemDownloading.add(i);
}
if (currentDownloadingItem == null) {
- execute(new DownloadIndexesAsyncTask(ctx));
+ execute(new DownloadIndexesAsyncTask());
}
}
@@ -282,8 +281,8 @@ public class DownloadIndexesThread {
private class ReloadIndexesTask extends BasicProgressAsyncTask {
- public ReloadIndexesTask(Context ctx) {
- super(ctx);
+ public ReloadIndexesTask() {
+ super(app);
}
@Override
@@ -304,6 +303,7 @@ public class DownloadIndexesThread {
}
result.isDownloadedFromInternet = indexFileList.isDownloadedFromInternet();
result.mapVersionIsIncreased = indexFileList.isIncreasedMapVersion();
+ app.getSettings().LAST_CHECKED_UPDATES.set(System.currentTimeMillis());
result.prepareData(indexFileList.getIndexFiles());
} catch (Exception e) {
}
@@ -357,8 +357,8 @@ public class DownloadIndexesThread {
private OsmandPreference downloads;
- public DownloadIndexesAsyncTask(Context ctx) {
- super(ctx);
+ public DownloadIndexesAsyncTask() {
+ super(app);
downloads = app.getSettings().NUMBER_OF_FREE_DOWNLOADS;
}
@@ -389,8 +389,8 @@ public class DownloadIndexesThread {
// ctx.getString(R.string.shared_string_io_error) +": Interrupted";
if (!message.toLowerCase().contains("interrupted")) {
if (uiActivity == null ||
- !message.equals(uiActivity.getString(R.string.shared_string_download_successful))) {
- AccessibleToast.makeText(ctx, message, Toast.LENGTH_LONG).show();
+ !message.equals(app.getString(R.string.shared_string_download_successful))) {
+ app.showToastMessage(message);
}
}
}
@@ -403,14 +403,14 @@ public class DownloadIndexesThread {
protected void onPreExecute() {
currentRunningTask.add(this);
super.onPreExecute();
- if (uiActivity != null) {
- downloadFileHelper.setInterruptDownloading(false);
- View mainView = uiActivity.findViewById(R.id.MainLayout);
+ downloadFileHelper.setInterruptDownloading(false);
+ if (uiActivity instanceof Activity) {
+ View mainView = ((Activity) uiActivity).findViewById(R.id.MainLayout);
if (mainView != null) {
mainView.setKeepScreenOn(true);
}
- startTask(ctx.getString(R.string.shared_string_downloading) + ctx.getString(R.string.shared_string_ellipsis), -1);
}
+ startTask(ctx.getString(R.string.shared_string_downloading) + ctx.getString(R.string.shared_string_ellipsis), -1);
}
@Override
@@ -418,8 +418,8 @@ public class DownloadIndexesThread {
if (result != null && result.length() > 0) {
AccessibleToast.makeText(ctx, result, Toast.LENGTH_LONG).show();
}
- if (uiActivity != null) {
- View mainView = uiActivity.findViewById(R.id.MainLayout);
+ if (uiActivity instanceof Activity) {
+ View mainView = ((Activity) uiActivity).findViewById(R.id.MainLayout);
if (mainView != null) {
mainView.setKeepScreenOn(false);
}
@@ -508,10 +508,10 @@ public class DownloadIndexesThread {
private boolean validateNotExceedsFreeLimit(IndexItem item) {
boolean exceed = Version.isFreeVersion(app) &&
- DownloadActivityType.isCountedInDownloads(item) && downloads.get() >= DownloadActivity.MAXIMUM_AVAILABLE_FREE_DOWNLOADS;
+ DownloadActivityType.isCountedInDownloads(item) && downloads.get() >= DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS;
if(exceed) {
String breakDownloadMessage = app.getString(R.string.free_version_message,
- DownloadActivity.MAXIMUM_AVAILABLE_FREE_DOWNLOADS + "");
+ DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS + "");
publishProgress(breakDownloadMessage);
}
return !exceed;
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java
index 04aadf6abb..77c862de86 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java
@@ -110,17 +110,17 @@ public class DownloadOsmandIndexesHelper {
}
- public static IndexFileList getIndexesList(Context ctx) {
- PackageManager pm = ctx.getPackageManager();
- AssetManager amanager = ctx.getAssets();
- IndexFileList result = downloadIndexesListFromInternet((OsmandApplication) ctx.getApplicationContext());
+ public static IndexFileList getIndexesList(OsmandApplication app) {
+ PackageManager pm = app.getPackageManager();
+ AssetManager amanager = app.getAssets();
+ IndexFileList result = downloadIndexesListFromInternet(app);
if (result == null) {
result = new IndexFileList();
} else {
result.setDownloadedFromInternet(true);
}
// add all tts files from assets
- listVoiceAssets(result, amanager, pm, ((OsmandApplication) ctx.getApplicationContext()).getSettings());
+ listVoiceAssets(result, amanager, pm, app.getSettings());
return result;
}
@@ -183,11 +183,12 @@ public class DownloadOsmandIndexesHelper {
try {
String strUrl = ctx.getAppCustomization().getIndexesUrl();
OsmandSettings settings = ctx.getSettings();
- Long nd = settings.FIRST_INSTALLED_DATE.get();
+
+ long nd = ctx.getAppInitializer().getFirstInstalled();
if(nd > 0) {
strUrl += "&nd=" + ((System.currentTimeMillis() - nd) / (1000l * 24l * 60l * 60l));
}
- strUrl += "&ns=" + settings.NUMBER_OF_APPLICATION_STARTS.get();
+ strUrl += "&ns=" + ctx.getAppInitializer().getNumberOfStarts();
try {
strUrl += "&aid=" + Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID);
} catch (Exception e) {
diff --git a/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java
similarity index 59%
rename from OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java
rename to OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java
index 245afee49f..d08f45b066 100644
--- a/OsmAnd/src/net/osmand/plus/download/BaseDownloadActivity.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java
@@ -12,9 +12,11 @@ import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.activities.ActionBarProgressActivity;
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
+import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
@@ -23,66 +25,38 @@ import android.support.annotation.NonNull;
import android.support.annotation.UiThread;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
import android.widget.Toast;
-public class BaseDownloadActivity extends ActionBarProgressActivity implements DownloadEvents {
- protected OsmandSettings settings;
- private static DownloadIndexesThread downloadListIndexThread;
- protected Set> fragSet = new HashSet<>();
+public class DownloadValidationManager {
public static final int MAXIMUM_AVAILABLE_FREE_DOWNLOADS = 5;
+ protected OsmandSettings settings;
+ private OsmandApplication app;
+ private DownloadIndexesThread downloadThread;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- settings = ((OsmandApplication) getApplication()).getSettings();
- if (downloadListIndexThread == null) {
- downloadListIndexThread = new DownloadIndexesThread(this);
- }
- super.onCreate(savedInstanceState);
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- downloadListIndexThread.setUiActivity(this);
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- downloadListIndexThread.setUiActivity(null);
+ public DownloadValidationManager(OsmandApplication app) {
+ this.app = app;
+ settings = app.getSettings();
+ downloadThread = app.getDownloadThread();
}
public DownloadIndexesThread getDownloadThread() {
- return downloadListIndexThread;
+ return downloadThread;
}
- public void startDownload(IndexItem... items) {
- downloadFilesWithAllChecks(items);
+ public void startDownload(FragmentActivity activity, IndexItem... items) {
+ downloadFilesWithAllChecks(activity, items);
}
-
- @UiThread
- public void downloadInProgress() {
- }
-
- @UiThread
- public void downloadHasFinished() {
- }
-
- @UiThread
- public void newDownloadIndexes() {
- }
-
-
public OsmandApplication getMyApplication() {
- return (OsmandApplication) getApplication();
+ return app;
}
- public void downloadFilesCheck_3_ValidateSpace(final IndexItem... items) {
+ public void downloadFilesCheck_3_ValidateSpace(final FragmentActivity activity, final IndexItem... items) {
long szLong = 0;
int i = 0;
- for (IndexItem es : downloadListIndexThread.getCurrentDownloadingItems()) {
+ for (IndexItem es : downloadThread.getCurrentDownloadingItems()) {
szLong += es.contentSize;
i++;
}
@@ -92,77 +66,76 @@ public class BaseDownloadActivity extends ActionBarProgressActivity implements D
}
double sz = ((double) szLong) / (1 << 20);
// get availabile space
- double asz = downloadListIndexThread.getAvailableSpace();
+ double asz = downloadThread.getAvailableSpace();
if (asz != -1 && asz > 0 && sz / asz > 0.4) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(MessageFormat.format(getString(R.string.download_files_question_space), i, sz, asz));
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+ builder.setMessage(MessageFormat.format(activity.getString(R.string.download_files_question_space), i, sz, asz));
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- downloadFileCheck_Final_Run(items);
+ downloadFileCheck_Final_Run(activity, items);
}
});
builder.setNegativeButton(R.string.shared_string_no, null);
builder.show();
} else {
- downloadFileCheck_Final_Run(items);
+ downloadFileCheck_Final_Run(activity, items);
}
}
- private void downloadFileCheck_Final_Run(IndexItem[] items) {
- downloadListIndexThread.runDownloadFiles(items);
- downloadInProgress();
+ private void downloadFileCheck_Final_Run(FragmentActivity activity, IndexItem[] items) {
+ downloadThread.runDownloadFiles(items);
+ if(activity instanceof DownloadEvents) {
+ ((DownloadEvents) activity).downloadInProgress();
+ }
}
- protected void downloadFilesWithAllChecks(IndexItem[] items) {
- downloadFilesCheck_1_FreeVersion(items);
+ protected void downloadFilesWithAllChecks(FragmentActivity activity, IndexItem[] items) {
+ downloadFilesCheck_1_FreeVersion(activity, items);
}
- protected void downloadFilesCheck_1_FreeVersion(IndexItem[] items) {
+ protected void downloadFilesCheck_1_FreeVersion(FragmentActivity activity, IndexItem[] items) {
if (Version.isFreeVersion(getMyApplication())) {
int total = settings.NUMBER_OF_FREE_DOWNLOADS.get();
if (total > MAXIMUM_AVAILABLE_FREE_DOWNLOADS) {
new InstallPaidVersionDialogFragment()
- .show(getSupportFragmentManager(), InstallPaidVersionDialogFragment.TAG);
+ .show(activity.getSupportFragmentManager(), InstallPaidVersionDialogFragment.TAG);
} else {
- downloadFilesCheck_2_Internet(items);
+ downloadFilesCheck_2_Internet(activity, items);
}
} else {
- downloadFilesCheck_2_Internet(items);
+ downloadFilesCheck_2_Internet(activity, items);
}
}
- protected void downloadFilesCheck_2_Internet(final IndexItem[] items) {
+ protected void downloadFilesCheck_2_Internet(final FragmentActivity activity, final IndexItem[] items) {
if (!getMyApplication().getSettings().isWifiConnected()) {
if (getMyApplication().getSettings().isInternetConnectionAvailable()) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(getString(R.string.download_using_mobile_internet));
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+ builder.setMessage(activity.getString(R.string.download_using_mobile_internet));
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- downloadFilesCheck_3_ValidateSpace(items);
+ downloadFilesCheck_3_ValidateSpace(activity, items);
}
});
builder.setNegativeButton(R.string.shared_string_no, null);
builder.show();
} else {
- AccessibleToast.makeText(this, R.string.no_index_file_to_download, Toast.LENGTH_LONG).show();
+ AccessibleToast.makeText(activity, R.string.no_index_file_to_download, Toast.LENGTH_LONG).show();
}
} else {
- downloadFilesCheck_3_ValidateSpace(items);
+ downloadFilesCheck_3_ValidateSpace(activity, items);
}
}
- @Override
- public void onAttachFragment(Fragment fragment) {
- fragSet.add(new WeakReference(fragment));
- }
+
- public void makeSureUserCancelDownload(final IndexItem item) {
- AlertDialog.Builder bld = new AlertDialog.Builder(this);
- bld.setTitle(getString(R.string.shared_string_cancel));
+ public void makeSureUserCancelDownload(Context ctx, final IndexItem item) {
+ AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
+ bld.setTitle(ctx.getString(R.string.shared_string_cancel));
bld.setMessage(R.string.confirm_interrupt_download);
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index 33fd07201d..5e5b4a7a24 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -23,6 +23,7 @@ import net.osmand.plus.mapcontextmenu.details.FavouritePointMenuController;
import net.osmand.plus.mapcontextmenu.details.HistoryMenuController;
import net.osmand.plus.mapcontextmenu.details.MenuController;
import net.osmand.plus.mapcontextmenu.details.PointDescriptionMenuController;
+import net.osmand.plus.mapcontextmenu.other.ShareMenu;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.views.ContextMenuLayer;
import net.osmand.plus.views.OsmandMapLayer;
@@ -397,7 +398,7 @@ public class MapContextMenu {
}
public void buttonSharePressed() {
- mapActivity.getMapActions().shareLocation(latLon.getLatitude(), latLon.getLongitude());
+ ShareMenu.show(latLon, nameStr, mapActivity);
}
public void buttonMorePressed() {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
index 0d4f06bda1..487cb6a36b 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
@@ -27,7 +27,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
-import net.osmand.PlatformUtil;
import net.osmand.data.LatLon;
import net.osmand.data.QuadPoint;
import net.osmand.data.RotatedTileBox;
@@ -40,8 +39,6 @@ import net.osmand.plus.mapcontextmenu.details.MenuController;
import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.OsmandMapTileView;
-import org.apache.commons.logging.Log;
-
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
import static net.osmand.plus.mapcontextmenu.details.MenuBuilder.SHADOW_HEIGHT_BOTTOM_DP;
import static net.osmand.plus.mapcontextmenu.details.MenuBuilder.SHADOW_HEIGHT_TOP_DP;
@@ -50,7 +47,6 @@ import static net.osmand.plus.mapcontextmenu.details.MenuBuilder.SHADOW_HEIGHT_T
public class MapContextMenuFragment extends Fragment {
public static final String TAG = "MapContextMenuFragment";
- private static final Log LOG = PlatformUtil.getLog(MapContextMenuFragment.class);
public static final float FAB_PADDING_TOP_DP = 4f;
public static final float MARKER_PADDING_DP = 20f;
@@ -62,6 +58,7 @@ public class MapContextMenuFragment extends Fragment {
MapContextMenu menu;
+ private int menuTopViewHeight;
private int menuTopShadowHeight;
private int menuTopShadowAllHeight;
private int menuTitleHeight;
@@ -319,7 +316,6 @@ public class MapContextMenuFragment extends Fragment {
// FAB
fabView = (ImageView)view.findViewById(R.id.context_menu_fab_view);
- fabView.setImageDrawable(iconsCache.getIcon(menu.getFabIconId()));
fabView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -438,11 +434,17 @@ public class MapContextMenuFragment extends Fragment {
@Override
public void onGlobalLayout() {
+ int newMenuTopViewHeight = view.findViewById(R.id.context_menu_top_view).getHeight();
menuTopShadowHeight = view.findViewById(R.id.context_menu_top_shadow).getHeight();
menuTopShadowAllHeight = view.findViewById(R.id.context_menu_top_shadow_all).getHeight();
menuFullHeight = view.findViewById(R.id.context_menu_main).getHeight();
- menuTitleHeight = menuTopShadowHeight + menuTopShadowAllHeight;
+ int dy = 0;
+ if (!menu.isLandscapeLayout() && menuTopViewHeight != 0) {
+ dy = Math.max(0, newMenuTopViewHeight - menuTopViewHeight);
+ }
+ menuTopViewHeight = newMenuTopViewHeight;
+ menuTitleHeight = menuTopShadowHeight + menuTopShadowAllHeight + dy;
menuBottomViewHeight = view.findViewById(R.id.context_menu_bottom_view).getHeight();
recalculateFullHeightMax();
@@ -605,6 +607,11 @@ public class MapContextMenuFragment extends Fragment {
}
}
}
+
+ if (map.getLatitude() == latlon.getLatitude() && map.getLongitude() == latlon.getLongitude()) {
+ return;
+ }
+
if (animated) {
showOnMap(latlon, false, true);
} else {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MenuController.java
index 22303be18a..adeb0025c9 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/details/MenuController.java
@@ -12,6 +12,8 @@ import net.osmand.plus.helpers.AndroidUiHelper;
public abstract class MenuController {
+ public final static float LANDSCAPE_WIDTH_DP = 350f;
+
public class MenuState {
public static final int HEADER_ONLY = 1;
public static final int HALF_SCREEN = 2;
@@ -60,7 +62,7 @@ public abstract class MenuController {
}
public float getLandscapeWidthDp() {
- return 350f;
+ return LANDSCAPE_WIDTH_DP;
}
public int getSupportedMenuStates() {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java
index ffb60c1d28..f756b9c0ad 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/PointEditorFragment.java
@@ -66,11 +66,8 @@ public abstract class PointEditorFragment extends Fragment {
getActivity().findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.INVISIBLE);
- if (getEditor().isLandscapeLayout()) {
- view = inflater.inflate(R.layout.point_editor_fragment_land, container, false);
- } else {
- view = inflater.inflate(R.layout.point_editor_fragment, container, false);
- }
+ view = inflater.inflate(R.layout.point_editor_fragment, container, false);
+
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setTitle(getToolbarTitle());
toolbar.setNavigationIcon(getMyApplication().getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java
new file mode 100644
index 0000000000..e1f6046788
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenu.java
@@ -0,0 +1,160 @@
+package net.osmand.plus.mapcontextmenu.other;
+
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+
+import net.osmand.data.LatLon;
+import net.osmand.plus.R;
+import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.activities.actions.ShareDialog;
+import net.osmand.plus.helpers.AndroidUiHelper;
+import net.osmand.util.Algorithms;
+import net.osmand.util.MapUtils;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class ShareMenu {
+
+ private final MapActivity mapActivity;
+
+ private LatLon latLon;
+ private String title;
+ private boolean portraitMode;
+ private boolean largeDevice;
+
+ private static final String KEY_SHARE_MENU_LATLON = "key_share_menu_latlon";
+ private static final String KEY_SHARE_MENU_POINT_TITLE = "key_share_menu_point_title";
+
+ public enum ShareItem {
+ MESSAGE(R.drawable.ic_action_export, R.string.shared_string_send),
+ CLIPBOARD(R.drawable.ic_action_export, R.string.shared_string_copy),
+ GEO(R.drawable.ic_action_export, R.string.share_geo),
+ QR_CODE(R.drawable.ic_action_export, R.string.share_qr_code);
+
+ final int iconResourceId;
+ final int titleResourceId;
+
+ ShareItem(int iconResourceId, int titleResourceId) {
+ this.iconResourceId = iconResourceId;
+ this.titleResourceId = titleResourceId;
+ }
+
+ public int getIconResourceId() {
+ return iconResourceId;
+ }
+
+ public int getTitleResourceId() {
+ return titleResourceId;
+ }
+ }
+
+ private ShareMenu(MapActivity mapActivity) {
+ this.mapActivity = mapActivity;
+ portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity);
+ largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity);
+ }
+
+ public List getItems() {
+ List list = new LinkedList<>();
+ list.add(ShareItem.MESSAGE);
+ list.add(ShareItem.CLIPBOARD);
+ list.add(ShareItem.GEO);
+ list.add(ShareItem.QR_CODE);
+ return list;
+ }
+
+ public boolean isLandscapeLayout() {
+ return !portraitMode && !largeDevice;
+ }
+
+ public int getSlideInAnimation() {
+ if (isLandscapeLayout()) {
+ return R.anim.slide_in_left;
+ } else {
+ return R.anim.slide_in_bottom;
+ }
+ }
+
+ public int getSlideOutAnimation() {
+ if (isLandscapeLayout()) {
+ return R.anim.slide_out_left;
+ } else {
+ return R.anim.slide_out_bottom;
+ }
+ }
+
+ public MapActivity getMapActivity() {
+ return mapActivity;
+ }
+
+ public LatLon getLatLon() {
+ return latLon;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public static void show(LatLon latLon, String title, MapActivity mapActivity) {
+
+ ShareMenu menu = new ShareMenu(mapActivity);
+
+ menu.latLon = latLon;
+ menu.title = title;
+
+ ShareMenuFragment.showInstance(menu);
+ }
+
+ public void share(ShareItem item) {
+ final int zoom = mapActivity.getMapView().getZoom();
+ final String geoUrl = MapUtils.buildGeoUrl(latLon.getLatitude(), latLon.getLongitude(), zoom);
+ final String httpUrl = "http://osmand.net/go?lat=" + ((float) latLon.getLatitude())
+ + "&lon=" + ((float) latLon.getLongitude()) + "&z=" + zoom;
+ StringBuilder sb = new StringBuilder();
+ if (!Algorithms.isEmpty(title)) {
+ sb.append(title).append("\n");
+ }
+ sb.append(mapActivity.getString(R.string.search_tabs_location)).append(": ");
+ sb.append(geoUrl).append("\n").append(httpUrl);
+ String sms = sb.toString();
+ switch (item) {
+ case MESSAGE:
+ ShareDialog.sendMessage(mapActivity, sms);
+ break;
+ case CLIPBOARD:
+ ShareDialog.sendToClipboard(mapActivity, sms);
+ break;
+ case GEO:
+ Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(geoUrl));
+ mapActivity.startActivity(mapIntent);
+ break;
+ case QR_CODE:
+ Bundle bundle = new Bundle();
+ bundle.putFloat("LAT", (float) latLon.getLatitude());
+ bundle.putFloat("LONG", (float) latLon.getLongitude());
+ ShareDialog.sendQRCode(mapActivity, "LOCATION_TYPE", bundle, null);
+ break;
+ }
+ }
+
+ public void saveMenu(Bundle bundle) {
+ bundle.putSerializable(KEY_SHARE_MENU_LATLON, latLon);
+ bundle.putString(KEY_SHARE_MENU_POINT_TITLE, title);
+ }
+
+ public static ShareMenu restoreMenu(Bundle bundle, MapActivity mapActivity) {
+
+ ShareMenu menu = new ShareMenu(mapActivity);
+
+ menu.title = bundle.getString(KEY_SHARE_MENU_POINT_TITLE);
+ Object latLonObj = bundle.getSerializable(KEY_SHARE_MENU_LATLON);
+ if (latLonObj != null) {
+ menu.latLon = (LatLon) latLonObj;
+ }
+
+ return menu;
+ }
+
+}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenuFragment.java
new file mode 100644
index 0000000000..992c5f145f
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/ShareMenuFragment.java
@@ -0,0 +1,132 @@
+package net.osmand.plus.mapcontextmenu.other;
+
+import android.annotation.SuppressLint;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import net.osmand.plus.R;
+import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.mapcontextmenu.other.ShareMenu.ShareItem;
+
+import java.util.List;
+
+import static android.util.TypedValue.COMPLEX_UNIT_DIP;
+
+
+public class ShareMenuFragment extends Fragment implements OnItemClickListener {
+ public static final String TAG = "ShareMenuFragment";
+
+ private ArrayAdapter listAdapter;
+ private ShareMenu menu;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (savedInstanceState != null && getActivity() instanceof MapActivity) {
+ menu = ShareMenu.restoreMenu(savedInstanceState, (MapActivity) getActivity());
+ }
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.share_menu_fragment, container, false);
+
+ ListView listView = (ListView) view.findViewById(R.id.list);
+ listAdapter = createAdapter();
+ listView.setAdapter(listAdapter);
+ listView.setOnItemClickListener(this);
+
+ return view;
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(false);
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ menu.getMapActivity().getContextMenu().setBaseFragmentVisibility(true);
+ }
+
+ @Override
+ public void onSaveInstanceState(Bundle outState) {
+ menu.saveMenu(outState);
+ }
+
+ public static void showInstance(ShareMenu menu) {
+ int slideInAnim = menu.getSlideInAnimation();
+ int slideOutAnim = menu.getSlideOutAnimation();
+
+ ShareMenuFragment fragment = new ShareMenuFragment();
+ fragment.menu = menu;
+ menu.getMapActivity().getSupportFragmentManager().beginTransaction()
+ .setCustomAnimations(slideInAnim, slideOutAnim, slideInAnim, slideOutAnim)
+ .add(R.id.fragmentContainer, fragment, TAG)
+ .addToBackStack(TAG).commit();
+ }
+
+ private ArrayAdapter createAdapter() {
+ final List items = menu.getItems();
+ return new ArrayAdapter(menu.getMapActivity(), R.layout.share_list_item, items) {
+
+ @SuppressLint("InflateParams")
+ @Override
+ public View getView(final int position, View convertView, ViewGroup parent) {
+ View v = convertView;
+ if (v == null) {
+ v = menu.getMapActivity().getLayoutInflater().inflate(R.layout.share_list_item, null);
+ }
+ final ShareItem item = getItem(position);
+ ImageView icon = (ImageView) v.findViewById(R.id.icon);
+ icon.setImageDrawable(menu.getMapActivity().getMyApplication()
+ .getIconsCache().getContentIcon(item.getIconResourceId()));
+ TextView name = (TextView) v.findViewById(R.id.name);
+ name.setText(getContext().getText(item.getTitleResourceId()));
+ return v;
+ }
+ };
+ }
+
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ menu.share(listAdapter.getItem(position));
+ dismissMenu();
+ }
+
+ public void dismissMenu() {
+ if (menu.getMapActivity().getContextMenu().isVisible()) {
+ menu.getMapActivity().getContextMenu().hide();
+ } else {
+ menu.getMapActivity().getSupportFragmentManager().popBackStack();
+ }
+ }
+
+ private int dpToPx(float dp) {
+ Resources r = getActivity().getResources();
+ return (int) TypedValue.applyDimension(
+ COMPLEX_UNIT_DIP,
+ dp,
+ r.getDisplayMetrics()
+ );
+ }
+
+}