From bc6773c5d040651c7741de2132e9d7b169fc6f54 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 7 Nov 2015 18:14:54 +0100 Subject: [PATCH] Update help --- OsmAnd/res/values-be/strings.xml | 11 +- OsmAnd/res/values-ca/strings.xml | 11 +- OsmAnd/res/values-cs/strings.xml | 13 +- OsmAnd/res/values-da/strings.xml | 15 +- OsmAnd/res/values-es-rAR/strings.xml | 15 +- OsmAnd/res/values-es/strings.xml | 15 +- OsmAnd/res/values-fr/strings.xml | 13 +- OsmAnd/res/values-hu/strings.xml | 4 +- OsmAnd/res/values-it/strings.xml | 15 +- OsmAnd/res/values-ja/strings.xml | 2 +- OsmAnd/res/values-ko/strings.xml | 2 +- OsmAnd/res/values-lt/strings.xml | 13 +- OsmAnd/res/values-nb/strings.xml | 2 +- OsmAnd/res/values-nl/strings.xml | 11 +- OsmAnd/res/values-pl/strings.xml | 2 +- OsmAnd/res/values-pt-rBR/strings.xml | 11 +- OsmAnd/res/values-ru/strings.xml | 5 +- OsmAnd/res/values-sc/strings.xml | 13 +- OsmAnd/res/values-sk/strings.xml | 15 +- OsmAnd/res/values-sl/strings.xml | 15 +- OsmAnd/res/values-sv/strings.xml | 15 +- OsmAnd/res/values-zh-rTW/strings.xml | 15 +- OsmAnd/res/values/strings.xml | 5 +- .../src/net/osmand/plus/AppInitializer.java | 3 +- .../osmand/plus/activities/HelpActivity.java | 406 +++++++++++++++++- .../plus/activities/MapActivityActions.java | 11 - .../audionotes/AudioVideoNotesPlugin.java | 6 +- .../plus/dialogs/WhatsNewDialogFragment.java | 25 +- .../helpscreen/HelpArticleDialogFragment.java | 7 +- .../helpscreen/HelpScreenDialogFragment.java | 1 - 30 files changed, 535 insertions(+), 162 deletions(-) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index a09dfd046a..391ddc6b62 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -1,5 +1,4 @@ - -Без аўтаматычнага маштабаваньня +Без аўтаматычнага маштабаваньня Буйней Для сярэдняга маштаба Драбней @@ -1971,13 +1970,13 @@ QR-код Мапа сьцягнутая галасаваньне - Фота %1$s + Адаслаць Створана OSM POI Створана OSM памылка Перайсьці да мапы - Аўдыё %1$s - Відэа %1$s + + Новая вэрсія Адметнасьці Іншае @@ -2002,4 +2001,4 @@ Пошук мапы Усталёўка і вырашэньне праблемаў Тэхнічныя артыкулы - + \ No newline at end of file diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index 049f382704..2c5590678b 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -1,5 +1,4 @@ - -Mostra els missatges d\'avís… +Mostra els missatges d\'avís… Rutes amb fluorescència Mostra el regle Aparença amb transparència @@ -1988,9 +1987,9 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu El mapa base mundial (que abasta el món sencer però amb poca ampliació) no es troba o està malmès. Considereu baixar-lo per una operació completa. Si es desactiva s\'engega amb la pantalla del mapa Indiqueu el nom del país -Fotografia %1$s - Àudio %1$s - Vídeo %1$s + + + Pujada S\'ha creat un PDI a OSM S\'ha obert un nou error a OSM @@ -2015,4 +2014,4 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu Contacteu-nos Llegenda del mapa Actualitza - + \ No newline at end of file diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 89cad0223a..cce50e437e 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1,5 +1,4 @@ - - + Vektorové mapy toto místo neobsahují. Mapová data můžete stáhnout v Nastaveních (Spravovat mapové soubory), nebo se přepněte na online mapy. Nahrát GPX soubory do OSM? @@ -1974,7 +1973,7 @@ Hledání na mapě Plánování cesty - OsmAnd lyžařské mapy + Instalace a řešení problémů Technické články @@ -1985,8 +1984,8 @@ Vytvořena OSM chyba Legenda mapy Aktualizovat - Foto %1$s - Zvuk %1$s - Video %1$s + + + Odeslat - + \ No newline at end of file diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 051265dded..349c464e0d 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1,5 +1,4 @@ - - + Overvej at købe Højdekurve udvidelsen (\'Contour lines\') på Google Play for at støtte den videre udvikling. Optag video Optag audio @@ -1891,7 +1890,7 @@ Placeringer Grundlæggende - facilitet + Kontaktoplysninger Beskrivelse Tilføj åbningstider @@ -1993,7 +1992,7 @@ Søgning på kortet Turplanlægning - Skikort + Installation og fejlfinding Tekniske artikler @@ -2004,9 +2003,9 @@ Oprettede OSM fejlregistrering Signaturforklaring Overfør -Foto %1$s - Audio %1$s - Video %1$s + + + Opdatering Skjul foreslåede objekter - + \ No newline at end of file diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 41b65dc873..9e04b2fe45 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -1,5 +1,4 @@ - -Ocultar números de casa +Ocultar números de casa Falló al copiar archivos Almacenamiento externo Almacenamiento multiusuario @@ -1907,7 +1906,7 @@ Archivo GPX con notas de ubicaciones Ubicaciones - servicio + Información de contacto Descripción Añadir horario de atención @@ -2007,7 +2006,7 @@ Busqueda en el mapa Planificación de viaje - Mapas de esquí de OsmAnd + Instalación y solución de problemas Artículos técnicos @@ -2018,8 +2017,8 @@ Nota OSM creada Leyenda del mapa Actualizar - Foto %1$s - Audio %1$s - Video %1$s + + + Subir - + \ No newline at end of file diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index c4a3eabffb..1b40bc5000 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -1,5 +1,4 @@ - - + Configurar pantalla Mostrar carriles Evitar carreteras no pavimentadas @@ -2026,7 +2025,7 @@ Archivo GPX con ubicaciones de nota Ubicaciones - servicio + Información de contacto Descripción Añadir horario de atención @@ -2125,7 +2124,7 @@ Búsqueda en el mapa Planeando un viaje - Mapas de esquí de OsmAnd + Instalación y solución de problemas Artículos técnicos @@ -2136,8 +2135,8 @@ Nota OSM creada Leyenda del mapa Actualizar - Foto %1$s - Audio %1$s - Video %1$s + + + Subir - + \ No newline at end of file diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 5d6f74e787..65c0954ef7 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1,5 +1,4 @@ - - + Modifications hors-ligne Toujours utiliser l\'édition hors-ligne @@ -2066,7 +2065,7 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et Rechercher de carte Préparer un trajet - Cartes de ski OsmAnd + Installation et débogage Articles techniques @@ -2078,8 +2077,8 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et Bugs déclarés sur OSM Légende Téléchargement - Photo %1$s - Audio %1$s - Vidéo %1$s + + + Mise à jour - + \ No newline at end of file diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 281ddebf11..547c1873b7 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -1876,7 +1876,7 @@ Nyitás Zárás - szolgáltatás + Elérhetőségek Leírás Nyitva tartás hozzáadása @@ -1976,7 +1976,7 @@ Keresés a térképen Utazás tervezése - OsmAnd sítérkép + Telepítés és hibaelhárítás Technikai cikkek diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 023ceeb80f..9c6bdf2bfe 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -1,5 +1,4 @@ - - + Sovrapposizioni fluorescenti Usa colori fluorescenti per visualizzare tracce e percorsi Modifiche offline @@ -1923,7 +1922,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz File GPX con note locali Località - amenità + Informazioni di contatto Descrizione Aggiungi orari di apertura @@ -2024,7 +2023,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Ricerca sulla mappa Pianifica un viaggio - Mappe sci OsmAnd + Installazione e soluzione dei problemi Articoli tecnici @@ -2036,7 +2035,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Carica Feedback Aggiorna - Foto %1$s - Audio %1$s - Video %1$s - + + + + \ No newline at end of file diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index 282c817a93..8f47daea96 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -1963,7 +1963,7 @@ POIの更新は利用できません ~で開く ~で閉じる - 施設 + 連絡先 説明 開店時間を追記 diff --git a/OsmAnd/res/values-ko/strings.xml b/OsmAnd/res/values-ko/strings.xml index a899f4bdf2..49e3304244 100644 --- a/OsmAnd/res/values-ko/strings.xml +++ b/OsmAnd/res/values-ko/strings.xml @@ -2150,7 +2150,7 @@ ~ 열기 에 닫기 - 시설 + 연락처 정보 설명 오프닝 시간 추가 diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 1ef9adf555..529efc6fe4 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -1,5 +1,4 @@ - - + Pradžios taškas yra per toli nuo artimiausio kelio. Bendrinta vieta Dėmesio @@ -1958,7 +1957,7 @@ Paieška žemėlapyje Kelionės planavimas - OSM redagavimas + Diegimas ir problemų sprendimas Versijos Susisiekti @@ -1979,9 +1978,9 @@ Sukurta OSM LV Sukurtas OSM riktas -Fotografijos %1$s - Garsas %1$s - Vaizdas %1$s + + + Išsiųsti Atnaujinti Nustato kad programa pasileistų kaip pirmą kartą, visi kiti nustatymai nepakitę @@ -2002,4 +2001,4 @@ Atsiliepimai Legenda Pirmasis paleidimas - + \ No newline at end of file diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml index ffaa14dc56..4f88ede72f 100644 --- a/OsmAnd/res/values-nb/strings.xml +++ b/OsmAnd/res/values-nb/strings.xml @@ -1430,7 +1430,7 @@ Kartvisning Kartsøking - Audio/video-notater + Versjoner Kontakt oss Planlegge en tur diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 0b409f8e98..95e1b0597f 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -1,5 +1,4 @@ - - + Configureer scherm Toon rijstroken @@ -2113,9 +2112,9 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A Ga naar de kaart De basis-wereldkaart ontbreekt of is verouderd. Download deze om OsmAnd goed te laten functioneren. Updaten - Foto %1$s - Audio %1$s - Video %1$s + + + Upload POI in OSM gemaakt Bug in OSM gemaakt @@ -2191,4 +2190,4 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A Commentaar Neem contact op Legenda - + \ No newline at end of file diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index b2dbd5df81..9107620436 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -2057,7 +2057,7 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant Otwarte od Zamknięte od - Udogodnienia + Informacje kontaktowe Dodaj godziny otwarcia Dni robocze diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 9911205639..65e834a288 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -1,5 +1,4 @@ - -Meus locais +Meus locais dias atrás Ver Pista de preparação @@ -1802,12 +1801,12 @@ Tem certeza? Quaisquer alterações não salvas serão perdidas. Continuar? Atualizar - Foto %1$s - Áudio %1$s - Vídeo %1$s + + + Enviar POI OSM criado Erro no OSM criado QR-code Mapa baixado - + \ No newline at end of file diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 0912dcc6fc..8a8de225de 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1,5 +1,4 @@ - - + Скрыть планируемые объекты Использовать безопасное подключение к серверу Использовать HTTPS @@ -1970,4 +1969,4 @@ Прочее Плагины Легенда - + \ No newline at end of file diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 40c249e81a..52483a3ed6 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1,5 +1,4 @@ - - + Ammustra sa positzione semper a su tzentru Boghe Mistura @@ -1966,7 +1965,7 @@ Chircare in sa mapa Pranificare unu biàgiu - Mapas pro iscì OsmAnd + Installatzione e solutziones a sos problemas Artìculos tècnicos @@ -1977,8 +1976,8 @@ Nota de errore de OSM creada Legenda de sa mapa Càrriga - Foto %1$s - Àudio %1$s - Vìdeu %1$s + + + Agiorna - + \ No newline at end of file diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index d914bd7d52..56b0d0f74d 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1,5 +1,4 @@ - - + Zobraziť Fotografia %1$s %2$s Zachytiť fotografiu @@ -2032,7 +2031,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Otvára o Zatvára o - občianska vybavenosť + Kontaktné údaje Popis Pridať otváracie hodiny @@ -2134,7 +2133,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Hľadanie na mape Plánovanie výletu - Lyžiarske mapy + Inštalácia a riešenie problémov Technické články @@ -2142,9 +2141,9 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Anketa Kontaktujte nás Vysvetlivky k mape -Foto %1$s - Zvuk %1$s - Video %1$s + + + Odoslať Aktualizovať - + \ No newline at end of file diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml index 3b034284b7..8f21057b71 100644 --- a/OsmAnd/res/values-sl/strings.xml +++ b/OsmAnd/res/values-sl/strings.xml @@ -1,5 +1,4 @@ - - + Poišči Iskanje podatkov @@ -1872,7 +1871,7 @@ Osnovno Napredno - prednost + Podatki stika Opis Dodaj odpiralni čas @@ -1966,7 +1965,7 @@ Iskanje po zemljevidu Planiranje potovanja - Zvočni in video zaznamki + Namestitev in odpravljanje napak Tehnični članki Različice @@ -1980,8 +1979,8 @@ Legenda zemljevida Posodobitev - Fotografija %1$s - Zvočni posnetek %1$s - Video posnetek %1$s + + + Pošlji - + \ No newline at end of file diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index eba0532674..a21094ba1a 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -1,5 +1,4 @@ - - + För att låsa upp skärmen tryck på låsikonen Välj land Välj stad @@ -1861,7 +1860,7 @@ Konfigurera panelen Skicka in POI - service + Antal rader i panelen: %1$s Ange typ av POI. Favoriter @@ -1953,7 +1952,7 @@ Söka på kartan Att planera en resa - Sjökort + Installation och problemlösning Tekniska artiklar @@ -1965,8 +1964,8 @@ Skicka Teckenförklaring Uppdatera - Foto %1$s - Ljud %1$s - Video %1$s + + + Återkoppling - + \ No newline at end of file diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 840bf245a1..f48bcb55a1 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1,5 +1,4 @@ - - + 選擇道路的色彩調配: 道路的色彩調配 顯示目的地方向 @@ -1851,7 +1850,7 @@ GPX 檔案加上地點注解 地點 - 便利設施 + 連絡資訊 記述 增加營業時間 @@ -1951,7 +1950,7 @@ 地圖查詢中 規劃一次旅程 - OsmAnd 滑雪地圖 + 安裝和疑難排除 技術文章 @@ -1962,8 +1961,8 @@ 建立 OSM 的錯誤 地圖圖例 上傳 -照片 %1$s - 音訊 %1$s - 視訊 %1$s + + + 更新 - + \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a17239517f..b193d2d12d 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,11 +9,10 @@ 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 --> + Read more + What's new in Hide proposed objects Update - Photo %1$s - Audio %1$s - Video %1$s Upload Created OSM POI Created OSM bug diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index ca278e52e8..397fbd9239 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -65,7 +65,8 @@ public class AppInitializer implements IProgress { 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 = "http://osmand.net/help/changes-2.1.html"; + // public static final String LATEST_CHANGES_URL = "http://osmand.net/help/changes-2.2.html"; + public static final String LATEST_CHANGES_URL = null; // not enough to read public static final int APP_EXIT_CODE = 4; public static final String APP_EXIT_KEY = "APP_EXIT_KEY"; private OsmandApplication app; diff --git a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java index 429b81f32c..ebf33d1283 100644 --- a/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/HelpActivity.java @@ -1,14 +1,45 @@ package net.osmand.plus.activities; -import android.os.Bundle; +import java.util.ArrayList; +import java.util.List; -import net.osmand.plus.dialogs.helpscreen.HelpScreenDialogFragment; +import net.osmand.PlatformUtil; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.OsmandPlugin; +import net.osmand.plus.OsmandSettings; +import net.osmand.plus.R; +import net.osmand.plus.Version; +import net.osmand.plus.dialogs.helpscreen.HelpArticleDialogFragment; +import net.osmand.plus.dialogs.helpscreen.HelpMenuItem; + +import org.apache.commons.logging.Log; + +import android.content.Intent; +import android.content.res.Resources; +import android.graphics.drawable.Drawable; +import android.net.Uri; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.StringRes; +import android.support.v4.app.DialogFragment; +import android.support.v4.app.FragmentActivity; +import android.support.v7.widget.Toolbar; +import android.util.TypedValue; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ExpandableListView; +import android.widget.ImageView; +import android.widget.TextView; public class HelpActivity extends OsmandActionBarActivity { public static final String DIALOG = "dialog"; - + final static HelpMenuCategory[] categories = HelpMenuCategory.values(); + public static final String OSMAND_POLL_HTML = "http://osmand.net/android-poll.html"; + public static final String OSMAND_MAP_LEGEND = "http://osmand.net/help/map-legend_default.png"; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -16,4 +47,373 @@ public class HelpActivity extends OsmandActionBarActivity { new HelpScreenDialogFragment().show(getSupportFragmentManager(), DIALOG); } } + + public static class HelpScreenDialogFragment extends DialogFragment implements ExpandableListView.OnChildClickListener { + private static final Log LOG = PlatformUtil.getLog(HelpScreenDialogFragment.class); + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + boolean isLightTheme = (getOsmandApplication()) + .getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME; + int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme; + setStyle(STYLE_NO_FRAME, themeId); + } + + @NonNull + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + final View view = inflater.inflate(R.layout.fragment_help_screen, container, false); + + Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar); + toolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + dismiss(); + } + }); + + HelpMenuCategory.BEGIN_WITH_OSMAND.initItems(createBeginWithOsmandItems()); + HelpMenuCategory.FEATURES.initItems(createFeaturesItems()); + HelpMenuCategory.PLUGINS.initItems(createPluginsItems()); + HelpMenuCategory.OTHER.initItems(createOtherItems()); + + ExpandableListView listView = (ExpandableListView) view.findViewById(android.R.id.list); + final HelpAdapter listAdapter = new HelpAdapter(getActivity()); + listView.setAdapter(listAdapter); + for (int i = 0; i < listAdapter.getGroupCount(); i++) { + listView.expandGroup(i); + } + listView.setOnChildClickListener(this); + return view; + } + + private OsmandApplication getOsmandApplication() { + return (OsmandApplication) getActivity().getApplication(); + } + + @Override + public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, + int childPosition, long id) { + if (categories[groupPosition] != HelpMenuCategory.HELP_US_TO_IMPROVE && + categories[groupPosition].getItem(childPosition).getOnClickListener() != null) { + LOG.debug("nice"); + categories[groupPosition].getItem(childPosition).getOnClickListener().onClick(v); + } + return false; + } + + + + private List createBeginWithOsmandItems() { + ArrayList arrayList = new ArrayList<>(); + ShowArticleOnTouchListener listener = new ShowArticleOnTouchListener( + "feature_articles/start.html", getActivity()); + HelpMenuItem.Builder builder = new HelpMenuItem.Builder() + .setTitle(R.string.first_usage_item, getActivity()) + .setDescription(R.string.first_usage_item_description, getActivity()) + .setListener(listener); + arrayList.add(builder.create()); + listener = new ShowArticleOnTouchListener( + "feature_articles/navigation.html", getActivity()); + builder = new HelpMenuItem.Builder() + .setTitle(R.string.shared_string_navigation, getActivity()) + .setDescription(R.string.navigation_item_description, getActivity()) + .setListener(listener); + arrayList.add(builder.create()); + listener = new ShowArticleOnTouchListener("feature_articles/faq.html", getActivity()); + builder = new HelpMenuItem.Builder() + .setTitle(R.string.faq_item, getActivity()) + .setDescription(R.string.faq_item_description, getActivity()) + .setListener(listener); + arrayList.add(builder.create()); + return arrayList; + } + + private List createFeaturesItems() { + ArrayList arrayList = new ArrayList<>(); + String name = getActivity().getString(R.string.map_viewing_item); + ShowArticleOnTouchListener listener = new ShowArticleOnTouchListener( + "feature_articles/map-viewing.html", getActivity()); + arrayList.add(new HelpMenuItem(name, listener)); + name = getActivity().getString(R.string.search_on_the_map_item); + listener = new ShowArticleOnTouchListener( + "feature_articles/find-something-on-map.html", getActivity()); + arrayList.add(new HelpMenuItem(name, listener)); + name = getActivity().getString(R.string.planning_trip_item); + listener = new ShowArticleOnTouchListener( + "feature_articles/trip-planning.html", getActivity()); + arrayList.add(new HelpMenuItem(name, listener)); + name = getActivity().getString(R.string.map_legend); + View.OnClickListener onClickListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + HelpArticleDialogFragment.instantiateWithUrl(OSMAND_MAP_LEGEND) + .show(getFragmentManager(), null); + } + }; + arrayList.add(new HelpMenuItem(name, onClickListener)); + return arrayList; + } + + private List createPluginsItems() { + ArrayList arrayList = new ArrayList<>(); + HelpMenuItem.Builder builder = new HelpMenuItem.Builder(); + for (final OsmandPlugin osmandPlugin : OsmandPlugin.getAvailablePlugins()) { + builder.reset(); + builder.setTitle(osmandPlugin.getName()) + .setIcon(osmandPlugin.getLogoResourceId()); + final String helpFileName = osmandPlugin.getHelpFileName(); + if (helpFileName != null) { + builder.setListener(new ShowArticleOnTouchListener(helpFileName, getActivity())); + } + arrayList.add(builder.create()); + } + return arrayList; + } + + private List createOtherItems() { + ArrayList arrayList = new ArrayList<>(); + String name = getActivity().getString(R.string.instalation_troubleshooting_item); + ShowArticleOnTouchListener listener = new ShowArticleOnTouchListener( + "feature_articles/installation-and-troubleshooting.html", getActivity()); + arrayList.add(new HelpMenuItem(name, listener)); + + name = getActivity().getString(R.string.techical_articles_item); + listener = new ShowArticleOnTouchListener( + "feature_articles/TechnicalArticles.html", getActivity()); + arrayList.add(new HelpMenuItem(name, listener)); + name = getActivity().getString(R.string.versions_item); + listener = new ShowArticleOnTouchListener( + "feature_articles/changes.html", getActivity()); + arrayList.add(new HelpMenuItem(name, listener)); + + String releasedate = ""; + if (!this.getString(R.string.app_edition).equals("")) { + releasedate = this.getString(R.string.shared_string_release) + ": \t" + this.getString(R.string.app_edition); + } + String version = Version.getFullVersion(getOsmandApplication()) + " " + releasedate; + listener = new ShowArticleOnTouchListener( + "feature_articles/about.html", getActivity()); + HelpMenuItem.Builder builder = new HelpMenuItem.Builder() + .setTitle(R.string.shared_string_about, getActivity()) + .setDescription(version) + .setListener(listener); + + arrayList.add(builder.create()); + return arrayList; + } + + + } + + public static class HelpAdapter extends OsmandBaseExpandableListAdapter { + private final OsmandApplication ctx; + private final FragmentActivity activity; + + public HelpAdapter(FragmentActivity activity) { + this.ctx = (OsmandApplication) activity.getApplication(); + this.activity = activity; + } + + @Override + public HelpMenuItem getChild(int groupPosition, int childPosition) { + if (categories[groupPosition] != HelpMenuCategory.HELP_US_TO_IMPROVE) { + return categories[groupPosition].getItem(childPosition); + } else { + return null; + } + } + + @Override + public long getChildId(int groupPosition, int childPosition) { + return groupPosition * 10000 + childPosition; + } + + @Override + public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, + View convertView, ViewGroup parent) { + if (categories[groupPosition] == HelpMenuCategory.HELP_US_TO_IMPROVE) { + convertView = LayoutInflater.from(parent.getContext()).inflate( + R.layout.help_to_improve_item, parent, false); + TextView feedbackButton = (TextView) convertView.findViewById(R.id.feedbackButton); + Drawable pollIcon = ctx.getIconsCache().getContentIcon(R.drawable.ic_action_message); + feedbackButton.setCompoundDrawablesWithIntrinsicBounds(null, pollIcon, null, null); + feedbackButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + HelpArticleDialogFragment.instantiateWithUrl(OSMAND_POLL_HTML) + .show(activity.getSupportFragmentManager(), null); + } + }); + TextView contactUsButton = (TextView) convertView.findViewById(R.id.contactUsButton); + Drawable contactUsIcon = + ctx.getIconsCache().getContentIcon(R.drawable.ic_action_message); + contactUsButton.setCompoundDrawablesWithIntrinsicBounds(null, contactUsIcon, null, + null); + final String email = ctx.getString(R.string.support_email); + contactUsButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Intent.ACTION_SENDTO); + intent.setData(Uri.parse("mailto:")); // only email apps should handle this + intent.putExtra(Intent.EXTRA_EMAIL, new String[]{email}); + if (intent.resolveActivity(ctx.getPackageManager()) != null) { + activity.startActivity(intent); + } + } + }); + return convertView; + } else { + final HelpMenuItem child = getChild(groupPosition, childPosition); + MenuItemViewHolder viewHolder; + if (convertView == null || convertView.getTag() == null) { + convertView = LayoutInflater.from(parent.getContext()).inflate( + R.layout.two_line_with_images_list_item, parent, false); + viewHolder = new MenuItemViewHolder(convertView, ctx); + convertView.setTag(viewHolder); + } else { + viewHolder = (MenuItemViewHolder) convertView.getTag(); + } + viewHolder.bindMenuItem(child); + + return convertView; + } + } + + + @Override + public View getGroupView(int groupPosition, boolean isExpanded, final View convertView, final ViewGroup parent) { + View v = convertView; + int titleId = getGroup(groupPosition); + if (v == null) { + LayoutInflater inflater = LayoutInflater.from(ctx); + v = inflater.inflate(R.layout.download_item_list_section, parent, false); + } + TextView nameView = ((TextView) v.findViewById(R.id.section_name)); + nameView.setText(titleId); + v.setOnClickListener(null); + TypedValue typedValue = new TypedValue(); + Resources.Theme theme = ctx.getTheme(); + theme.resolveAttribute(R.attr.ctx_menu_info_view_bg, typedValue, true); + v.setBackgroundColor(typedValue.data); + + return v; + } + + @Override + public int getChildrenCount(int groupPosition) { + if (categories[groupPosition] != HelpMenuCategory.HELP_US_TO_IMPROVE) { + return categories[groupPosition].getChildrenCount(); + } else { + return 1; + } + } + + @Override + public Integer getGroup(int groupPosition) { + return categories[groupPosition].getTitle(); + } + + @Override + public int getGroupCount() { + return HelpMenuCategory.values().length; + } + + @Override + public long getGroupId(int groupPosition) { + return groupPosition; + } + + @Override + public boolean hasStableIds() { + return false; + } + + @Override + public boolean isChildSelectable(int groupPosition, int childPosition) { + return true; + } + + } + + private static class ShowArticleOnTouchListener implements View.OnClickListener { + private final String filename; + private final FragmentActivity ctx; + + private ShowArticleOnTouchListener(String filename, FragmentActivity ctx) { + this.filename = filename; + this.ctx = ctx; + } + + @Override + public void onClick(View v) { + HelpArticleDialogFragment.instantiateWithAsset(filename) + .show(ctx.getSupportFragmentManager(), null); + } + } + + private enum HelpMenuCategory { + BEGIN_WITH_OSMAND(R.string.begin_with_osmand_menu_group), + FEATURES(R.string.features_menu_group), + PLUGINS(R.string.plugins_menu_group), + HELP_US_TO_IMPROVE(R.string.help_us_to_improve_menu_group), + OTHER(R.string.other_menu_group); + + private List items; + @StringRes + private final int title; + + HelpMenuCategory(int title) { + this.title = title; + } + + public int getTitle() { + return title; + } + + public int getChildrenCount() { + return items.size(); + } + + public HelpMenuItem getItem(int position) { + return items.get(position); + } + + public void initItems(List items) { + this.items = items; + } + } + + private static class MenuItemViewHolder { + private final TextView nameTextView; + private final TextView descrTextView; + private final ImageView leftImageView; + private final OsmandApplication context; + + public MenuItemViewHolder(View view, OsmandApplication context) { + this.context = context; + leftImageView = (ImageView) view.findViewById(R.id.leftImageView); + descrTextView = (TextView) view.findViewById(R.id.description); + nameTextView = (TextView) view.findViewById(R.id.name); + } + + public void bindMenuItem(HelpMenuItem menuItem) { + nameTextView.setText(menuItem.getTitle()); + if (menuItem.getDesription() != null) { + descrTextView.setVisibility(View.VISIBLE); + descrTextView.setText(menuItem.getDesription()); + } else { + descrTextView.setVisibility(View.GONE); + } + if (menuItem.getIcon() != -1) { + leftImageView.setVisibility(View.VISIBLE); + leftImageView.setImageDrawable(context.getIconsCache() + .getContentIcon(menuItem.getIcon())); + } else { + leftImageView.setVisibility(View.GONE); + } + } + } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 0b7a3a3193..31d2d59694 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -746,17 +746,6 @@ public class MapActivityActions implements DialogProvider { @Override public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { mapActivity.startActivity(new Intent(mapActivity, HelpActivity.class)); - // FIXME show ABOUT! -// showAboutDialog(getMyApplication()); -// String version = Version.getFullVersion(app); -// String vt = this.getString(R.string.about_version) + "\t"; -// String edition = ""; -// if (!this.getString(R.string.app_edition).equals("")) { -// edition = this.getString(R.string.shared_string_release) + " : \t" + this.getString(R.string.app_edition); -// } -// tv.setText(vt + version + "\n" + -// edition + "\n\n" + -// this.getString(R.string.about_content)); return true; } }).reg(); diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 0047ca40cf..c24d64f699 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -233,11 +233,11 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { if (desc != null) { return desc; } else if (this.isAudio()) { - return ctx.getString(R.string.rec_audio_description, formatDateTime(ctx, file.lastModified())); + return ctx.getString(R.string.shared_string_audio) + " " + formatDateTime(ctx, file.lastModified()); } else if (this.isVideo()) { - return ctx.getString(R.string.rec_video_description, formatDateTime(ctx, file.lastModified())); + return ctx.getString(R.string.shared_string_video) + " " + formatDateTime(ctx, file.lastModified()); } else if (this.isPhoto()) { - return ctx.getString(R.string.rec_photo_description, formatDateTime(ctx, file.lastModified())); + return ctx.getString(R.string.shared_string_photo) + " " + formatDateTime(ctx, file.lastModified()); } return ""; } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java index eb5c366e0e..cc6a209a6f 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/WhatsNewDialogFragment.java @@ -26,19 +26,20 @@ public class WhatsNewDialogFragment extends DialogFragment { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final OsmandApplication osmandApplication = (OsmandApplication) getActivity().getApplication(); final String appVersion = Version.getAppVersion(osmandApplication); - builder.setTitle("What's new in " + appVersion) - .setMessage(getString(R.string.last_release)) + builder.setTitle(getString(R.string.whats_new) + " " + appVersion) + .setMessage(getString(R.string.release_2_2)) .setNegativeButton(R.string.shared_string_close, null); - // TODO: 10/28/15 Implement - builder.setPositiveButton("Read more", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(AppInitializer.LATEST_CHANGES_URL)); - startActivity(i); - dismiss(); - } - }); + if (AppInitializer.LATEST_CHANGES_URL != null) { + builder.setPositiveButton(R.string.read_more, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(AppInitializer.LATEST_CHANGES_URL)); + startActivity(i); + dismiss(); + } + }); + } return builder.create(); } } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java index 23b11db24e..341059c8b5 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java @@ -1,5 +1,6 @@ package net.osmand.plus.dialogs.helpscreen; +import android.annotation.SuppressLint; import android.content.Context; import android.os.Bundle; import android.support.annotation.NonNull; @@ -10,14 +11,11 @@ import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; import android.webkit.WebViewClient; - import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; - import org.apache.commons.logging.Log; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -46,6 +44,7 @@ public class HelpArticleDialogFragment extends DialogFragment { setStyle(STYLE_NO_FRAME, themeId); } + @SuppressLint("SetJavaScriptEnabled") @NonNull @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, @@ -63,6 +62,7 @@ public class HelpArticleDialogFragment extends DialogFragment { String assetName = getArguments().getString(ASSET_NAME); String url = getArguments().getString(URL); webView = (WebView) view.findViewById(R.id.webView); + webView.getSettings().setJavaScriptEnabled(true); if (assetName != null) { if (savedInstanceState != null) { webView.restoreState(savedInstanceState); @@ -77,6 +77,7 @@ public class HelpArticleDialogFragment extends DialogFragment { webView.loadDataWithBaseURL("http://osmand.net", sb.toString(), null, "utf-8", null); } } else if (url != null) { + webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setUseWideViewPort(true); if (savedInstanceState != null) { diff --git a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java index cc98232c27..c89aa95c98 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java @@ -176,7 +176,6 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab nameView.setText(titleId); v.setOnClickListener(null); TypedValue typedValue = new TypedValue(); - // TODO optimize Resources.Theme theme = ctx.getTheme(); theme.resolveAttribute(R.attr.ctx_menu_info_view_bg, typedValue, true); v.setBackgroundColor(typedValue.data);