From 11a81965c8bdca4c89febf51365b12f8b4620a0e Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 29 Jan 2018 21:33:20 +0100 Subject: [PATCH] allow avoiding Whats New dialog on startup --- .../com/simplemobiletools/commons/extensions/Activity.kt | 3 ++- .../com/simplemobiletools/commons/helpers/BaseConfig.kt | 4 ++++ .../kotlin/com/simplemobiletools/commons/helpers/Constants.kt | 1 + commons/src/main/res/values-ca/strings.xml | 1 + commons/src/main/res/values-cs/strings.xml | 1 + commons/src/main/res/values-da/strings.xml | 1 + commons/src/main/res/values-de/strings.xml | 1 + commons/src/main/res/values-es/strings.xml | 1 + commons/src/main/res/values-fi/strings.xml | 1 + commons/src/main/res/values-fr/strings.xml | 1 + commons/src/main/res/values-hi-rIN/strings.xml | 1 + commons/src/main/res/values-hr/strings.xml | 1 + commons/src/main/res/values-hu/strings.xml | 1 + commons/src/main/res/values-it/strings.xml | 1 + commons/src/main/res/values-ja/strings.xml | 1 + commons/src/main/res/values-ko-rKR/strings.xml | 1 + commons/src/main/res/values-lt/strings.xml | 1 + commons/src/main/res/values-nb/strings.xml | 1 + commons/src/main/res/values-nl/strings.xml | 1 + commons/src/main/res/values-no/strings.xml | 1 + commons/src/main/res/values-pl/strings.xml | 1 + commons/src/main/res/values-pt-rBR/strings.xml | 1 + commons/src/main/res/values-pt/strings.xml | 1 + commons/src/main/res/values-ru/strings.xml | 1 + commons/src/main/res/values-sk/strings.xml | 1 + commons/src/main/res/values-sv/strings.xml | 1 + commons/src/main/res/values-tr/strings.xml | 1 + commons/src/main/res/values-zh-rCN/strings.xml | 1 + commons/src/main/res/values-zh-rTW/strings.xml | 1 + commons/src/main/res/values/strings.xml | 1 + 30 files changed, 34 insertions(+), 1 deletion(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt index c55f489d6..30b2349a4 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt @@ -290,8 +290,9 @@ fun BaseSimpleActivity.checkWhatsNew(releases: List, currVersion: Int) val newReleases = arrayListOf() releases.filterTo(newReleases) { it.id > baseConfig.lastVersion } - if (newReleases.isNotEmpty()) + if (newReleases.isNotEmpty() && !baseConfig.avoidWhatsNew) { WhatsNewDialog(this, newReleases) + } baseConfig.lastVersion = currVersion } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt index ece589de7..9bf564c22 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt @@ -139,4 +139,8 @@ open class BaseConfig(val context: Context) { var lastConflictResolution: Int get() = prefs.getInt(LAST_CONFLICT_RESOLUTION, CONFLICT_SKIP) set(lastConflictResolution) = prefs.edit().putInt(LAST_CONFLICT_RESOLUTION, lastConflictResolution).apply() + + var avoidWhatsNew: Boolean + get() = prefs.getBoolean(AVOID_WHATS_NEW, false) + set(avoidWhatsNew) = prefs.edit().putBoolean(AVOID_WHATS_NEW, avoidWhatsNew).apply() } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt index 9648b4e43..cf4af2f3f 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt @@ -40,6 +40,7 @@ const val SHOW_INFO_BUBBLE = "show_info_bubble" const val SORTING = "sorting" const val LAST_CONFLICT_RESOLUTION = "last_conflict_resolution" const val LAST_CONFLICT_APPLY_TO_ALL = "last_conflict_apply_to_all" +const val AVOID_WHATS_NEW = "avoid_whats_new" // licenses const val LICENSE_KOTLIN = 1 diff --git a/commons/src/main/res/values-ca/strings.xml b/commons/src/main/res/values-ca/strings.xml index c8d46d95b..2ff9f5a31 100644 --- a/commons/src/main/res/values-ca/strings.xml +++ b/commons/src/main/res/values-ca/strings.xml @@ -228,6 +228,7 @@ Ajustaments Canviar colors Usar l’idioma Anglès + Avoid showing What\'s New on startup after app upgrade Mostra elements ocults Mida de la font Petita diff --git a/commons/src/main/res/values-cs/strings.xml b/commons/src/main/res/values-cs/strings.xml index e16ecd793..e7a187b71 100644 --- a/commons/src/main/res/values-cs/strings.xml +++ b/commons/src/main/res/values-cs/strings.xml @@ -229,6 +229,7 @@ Nastavení Přizpůsobit barvy Use English language + Avoid showing What\'s New on startup after app upgrade Zobrazit skryté položky Font size Small diff --git a/commons/src/main/res/values-da/strings.xml b/commons/src/main/res/values-da/strings.xml index 325ef532e..878027c93 100644 --- a/commons/src/main/res/values-da/strings.xml +++ b/commons/src/main/res/values-da/strings.xml @@ -229,6 +229,7 @@ Indstillinger Rediger farver Use English language + Avoid showing What\'s New on startup after app upgrade Vis skjulte elementer Skriftstørrelse Lille diff --git a/commons/src/main/res/values-de/strings.xml b/commons/src/main/res/values-de/strings.xml index e3749d41d..b49e98b92 100644 --- a/commons/src/main/res/values-de/strings.xml +++ b/commons/src/main/res/values-de/strings.xml @@ -229,6 +229,7 @@ Einstellungen Farben anpassen App in Englisch verwenden + Avoid showing What\'s New on startup after app upgrade Versteckte Elemente anzeigen Schriftgröße Klein diff --git a/commons/src/main/res/values-es/strings.xml b/commons/src/main/res/values-es/strings.xml index 829adbe2d..cb68b33bc 100644 --- a/commons/src/main/res/values-es/strings.xml +++ b/commons/src/main/res/values-es/strings.xml @@ -228,6 +228,7 @@ Ajustes Cambiar colores Usar el idioma Inglés + Avoid showing What\'s New on startup after app upgrade Mostrar elementos ocultos Tamaño de fuente Pequeña diff --git a/commons/src/main/res/values-fi/strings.xml b/commons/src/main/res/values-fi/strings.xml index 3fdd25b19..9ac943b24 100644 --- a/commons/src/main/res/values-fi/strings.xml +++ b/commons/src/main/res/values-fi/strings.xml @@ -229,6 +229,7 @@ Settings Customize colors Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items Font size Small diff --git a/commons/src/main/res/values-fr/strings.xml b/commons/src/main/res/values-fr/strings.xml index 351f3fc65..ac892bbf4 100644 --- a/commons/src/main/res/values-fr/strings.xml +++ b/commons/src/main/res/values-fr/strings.xml @@ -229,6 +229,7 @@ Paramètres Personnaliser les couleurs Utiliser l\'affichage en anglais + Avoid showing What\'s New on startup after app upgrade Afficher les éléments cachés Taille police Petite diff --git a/commons/src/main/res/values-hi-rIN/strings.xml b/commons/src/main/res/values-hi-rIN/strings.xml index f03fdcb42..092cf5ba8 100644 --- a/commons/src/main/res/values-hi-rIN/strings.xml +++ b/commons/src/main/res/values-hi-rIN/strings.xml @@ -229,6 +229,7 @@ Settings Customize colors Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items Font size Small diff --git a/commons/src/main/res/values-hr/strings.xml b/commons/src/main/res/values-hr/strings.xml index a235c312a..71b005c88 100644 --- a/commons/src/main/res/values-hr/strings.xml +++ b/commons/src/main/res/values-hr/strings.xml @@ -233,6 +233,7 @@ Postavke Prilagodi boje Koristi Engleski jezik + Avoid showing What\'s New on startup after app upgrade Show hidden items Veličina fonta Malo diff --git a/commons/src/main/res/values-hu/strings.xml b/commons/src/main/res/values-hu/strings.xml index a3e72e4e4..3c28d09ed 100644 --- a/commons/src/main/res/values-hu/strings.xml +++ b/commons/src/main/res/values-hu/strings.xml @@ -229,6 +229,7 @@ Settings Customize colors Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items Betűméret Kicsi diff --git a/commons/src/main/res/values-it/strings.xml b/commons/src/main/res/values-it/strings.xml index 2ad3707ae..7868ef234 100644 --- a/commons/src/main/res/values-it/strings.xml +++ b/commons/src/main/res/values-it/strings.xml @@ -229,6 +229,7 @@ Impostazioni Personalizza i colori Forza la lingua inglese + Avoid showing What\'s New on startup after app upgrade Mostra gli elementi nascosti Dimensione carattere Piccolo diff --git a/commons/src/main/res/values-ja/strings.xml b/commons/src/main/res/values-ja/strings.xml index fffbc8ba2..59346929d 100644 --- a/commons/src/main/res/values-ja/strings.xml +++ b/commons/src/main/res/values-ja/strings.xml @@ -229,6 +229,7 @@ 設定 表示色のカスタマイズ Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items メモのフォントサイズ diff --git a/commons/src/main/res/values-ko-rKR/strings.xml b/commons/src/main/res/values-ko-rKR/strings.xml index d54bb83fc..f648cb622 100644 --- a/commons/src/main/res/values-ko-rKR/strings.xml +++ b/commons/src/main/res/values-ko-rKR/strings.xml @@ -229,6 +229,7 @@ 설정 앱 테마 및 색상 설정 영어 사용 + Avoid showing What\'s New on startup after app upgrade 숨김항목 활성화 폰트 크기 작게 diff --git a/commons/src/main/res/values-lt/strings.xml b/commons/src/main/res/values-lt/strings.xml index 4c4aa6531..195f912a4 100644 --- a/commons/src/main/res/values-lt/strings.xml +++ b/commons/src/main/res/values-lt/strings.xml @@ -229,6 +229,7 @@ Nustatymai Spalvø redagavimas Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items Teksto dydis Smulkus diff --git a/commons/src/main/res/values-nb/strings.xml b/commons/src/main/res/values-nb/strings.xml index df5db2309..d2067df3a 100644 --- a/commons/src/main/res/values-nb/strings.xml +++ b/commons/src/main/res/values-nb/strings.xml @@ -229,6 +229,7 @@ Innstillinger Tilpass farger Bruk engelsk språk + Avoid showing What\'s New on startup after app upgrade Vis skjulte elementer Skriftstørrelse Liten diff --git a/commons/src/main/res/values-nl/strings.xml b/commons/src/main/res/values-nl/strings.xml index 218997d42..6daf61596 100644 --- a/commons/src/main/res/values-nl/strings.xml +++ b/commons/src/main/res/values-nl/strings.xml @@ -229,6 +229,7 @@ Instellingen Kleuren aanpassen Use English language + Avoid showing What\'s New on startup after app upgrade Verborgen items tonen Lettergrootte Klein diff --git a/commons/src/main/res/values-no/strings.xml b/commons/src/main/res/values-no/strings.xml index 831156f23..819c13965 100644 --- a/commons/src/main/res/values-no/strings.xml +++ b/commons/src/main/res/values-no/strings.xml @@ -229,6 +229,7 @@ Innstillinger Tilpass farger Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items Skriftstørrelse Liten diff --git a/commons/src/main/res/values-pl/strings.xml b/commons/src/main/res/values-pl/strings.xml index 81b1cc645..dceb4d35e 100644 --- a/commons/src/main/res/values-pl/strings.xml +++ b/commons/src/main/res/values-pl/strings.xml @@ -233,6 +233,7 @@ Ustawienia Dostosuj kolory    Wymuś używanie przez aplikację języka angielskiego + Avoid showing What\'s New on startup after app upgrade    Pokazuj ukryte elementy Rozmiar czcionki Mała diff --git a/commons/src/main/res/values-pt-rBR/strings.xml b/commons/src/main/res/values-pt-rBR/strings.xml index 01de06ace..d9679e21f 100644 --- a/commons/src/main/res/values-pt-rBR/strings.xml +++ b/commons/src/main/res/values-pt-rBR/strings.xml @@ -229,6 +229,7 @@ Configurações Personalizar cores Usar o idioma inglês + Avoid showing What\'s New on startup after app upgrade Mostrar itens ocultos Tamanho do texto Pequeno diff --git a/commons/src/main/res/values-pt/strings.xml b/commons/src/main/res/values-pt/strings.xml index 0279c1973..5e25e7a8f 100644 --- a/commons/src/main/res/values-pt/strings.xml +++ b/commons/src/main/res/values-pt/strings.xml @@ -229,6 +229,7 @@ Definições Personalizar cores Utilizar aplicação em inglês + Avoid showing What\'s New on startup after app upgrade Mostrar itens ocultos Tamanho do texto Pequeno diff --git a/commons/src/main/res/values-ru/strings.xml b/commons/src/main/res/values-ru/strings.xml index 2811dfd1f..cfef18594 100644 --- a/commons/src/main/res/values-ru/strings.xml +++ b/commons/src/main/res/values-ru/strings.xml @@ -232,6 +232,7 @@ Настройки Настроить цвета Use English language + Avoid showing What\'s New on startup after app upgrade Показывать скрытые папки Размер шрифта Мелкий diff --git a/commons/src/main/res/values-sk/strings.xml b/commons/src/main/res/values-sk/strings.xml index 635aa0914..327fff73e 100644 --- a/commons/src/main/res/values-sk/strings.xml +++ b/commons/src/main/res/values-sk/strings.xml @@ -233,6 +233,7 @@ Nastavenia Upraviť farby Použiť angličtinu + Nikdy nezobrazovať Novinky po aktualizovaní apky Zobraziť skryté položky Veľkosť písma Malé diff --git a/commons/src/main/res/values-sv/strings.xml b/commons/src/main/res/values-sv/strings.xml index 5c83e751d..89e143d1c 100644 --- a/commons/src/main/res/values-sv/strings.xml +++ b/commons/src/main/res/values-sv/strings.xml @@ -229,6 +229,7 @@ Inställningar Anpassa färger Använd engelska + Avoid showing What\'s New on startup after app upgrade Visa dolda objekt Teckenstorlek Liten diff --git a/commons/src/main/res/values-tr/strings.xml b/commons/src/main/res/values-tr/strings.xml index f1e503a69..dc3e9fac2 100644 --- a/commons/src/main/res/values-tr/strings.xml +++ b/commons/src/main/res/values-tr/strings.xml @@ -229,6 +229,7 @@ Ayarlar Renkleri özelleştir İngilizce dilini kullan + Avoid showing What\'s New on startup after app upgrade Gizli öğeleri göster Yazı tipi boyutu Küçük diff --git a/commons/src/main/res/values-zh-rCN/strings.xml b/commons/src/main/res/values-zh-rCN/strings.xml index 628dbc544..c691d75c2 100644 --- a/commons/src/main/res/values-zh-rCN/strings.xml +++ b/commons/src/main/res/values-zh-rCN/strings.xml @@ -229,6 +229,7 @@ 设置 自定义颜色 强制使用英语语言 + Avoid showing What\'s New on startup after app upgrade 显示隐藏的项目 字体大小 diff --git a/commons/src/main/res/values-zh-rTW/strings.xml b/commons/src/main/res/values-zh-rTW/strings.xml index db3876a3b..525500de8 100644 --- a/commons/src/main/res/values-zh-rTW/strings.xml +++ b/commons/src/main/res/values-zh-rTW/strings.xml @@ -228,6 +228,7 @@ 設定 自訂顏色 使用英文語言 + Avoid showing What\'s New on startup after app upgrade 顯示隱藏的項目 字體大小 diff --git a/commons/src/main/res/values/strings.xml b/commons/src/main/res/values/strings.xml index 2befae8fd..eb8d02826 100644 --- a/commons/src/main/res/values/strings.xml +++ b/commons/src/main/res/values/strings.xml @@ -229,6 +229,7 @@ Settings Customize colors Use English language + Avoid showing What\'s New on startup after app upgrade Show hidden items Font size Small