From cfeaf7bfc86bde7e92721ebdcef9b9e503407733 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Jul 2017 23:46:04 +0200 Subject: [PATCH] show a confirmation dialog before enabling Google Sync mentioning beta feature --- .../calendar/activities/SettingsActivity.kt | 21 ++++++++++++++----- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hi-rIN/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-iw/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 16 files changed, 31 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt index 703413d6f..649b27980 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -25,6 +25,7 @@ import com.simplemobiletools.calendar.extensions.* import com.simplemobiletools.calendar.helpers.FONT_SIZE_LARGE import com.simplemobiletools.calendar.helpers.FONT_SIZE_MEDIUM import com.simplemobiletools.calendar.helpers.FONT_SIZE_SMALL +import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.updateTextColors @@ -115,15 +116,25 @@ class SettingsActivity : SimpleActivity() { private fun setupGoogleSync() { settings_google_sync.isChecked = config.googleSync settings_google_sync_holder.setOnClickListener { - settings_google_sync.toggle() - config.googleSync = settings_google_sync.isChecked - - if (settings_google_sync.isChecked) { - tryEnablingSync() + if (!config.googleSync) { + ConfirmationDialog(this, getString(R.string.google_sync_testing), positive = R.string.ok, negative = 0) { + toggleGoogleSync() + } + } else { + toggleGoogleSync() } } } + private fun toggleGoogleSync() { + settings_google_sync.toggle() + config.googleSync = settings_google_sync.isChecked + + if (settings_google_sync.isChecked) { + tryEnablingSync() + } + } + private fun setupSundayFirst() { settings_sunday_first.isChecked = config.isSundayFirst settings_sunday_first_holder.setOnClickListener { diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4a7014dea..162d6f5e7 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index fde0fed90..ba239250c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 8b0d146a1..e4369552d 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml index c74437fb6..e111d6b11 100644 --- a/app/src/main/res/values-hi-rIN/strings.xml +++ b/app/src/main/res/values-hi-rIN/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 4aeff30a5..7b3534d33 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 43ab72cd4..638141c44 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index 5bf19213f..928ae03d5 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 43a93fcb6..ba8b5ccb7 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 3ffa83efa..de763a897 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index e8547a191..e9639ef21 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -189,6 +189,7 @@ Mostrar eventos passados Adiar lembrete com a opção Snooze Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minuto diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index ac07a9327..7a83cac53 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -203,6 +203,7 @@ Показывать прошедшие события Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d минута diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index f2a23290f..fa42af4a0 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -196,6 +196,7 @@ Zobraziť minulé udalosti spred Posunúť pripomienku s Odložiť o Widgety + Google synchronizácia je v testovacej prevádzke, nahlásenie akýchkoľvek ohlasov na hello@simplemobiletools.com je vítané. Vďaka! %1$d minútu diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 63c1b655e..279a603f6 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -189,6 +189,7 @@ Visa tidigare händelser Skjut upp påminnelse med Snooza Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minut diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 0988d46e9..c5ecc6ceb 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 990dc952e..1416a7008 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -189,6 +189,7 @@ Display events from the past Postpone reminder with Snooze by Widgets + Google sync is in a testing mode, reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! %1$d minute