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 466225d96..a9137cf0b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -121,8 +121,12 @@ class SettingsActivity : SimpleActivity() { toggleGoogleSync() } } else { - ConfirmationDialog(this, getString(R.string.google_sync_testing), positive = R.string.ok, negative = 0) { - toggleGoogleSync() + if (isOnline()) { + ConfirmationDialog(this, getString(R.string.google_sync_testing), positive = R.string.ok, negative = 0) { + toggleGoogleSync() + } + } else { + toast(R.string.cannot_while_offline) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt index 24b212bd2..eb367fef2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt @@ -10,6 +10,7 @@ import android.content.ComponentName import android.content.Context import android.content.Intent import android.graphics.Color +import android.net.ConnectivityManager import android.net.Uri import android.os.Build import android.support.v7.app.NotificationCompat @@ -239,6 +240,11 @@ fun Context.getGoogleSyncService(): com.google.api.services.calendar.Calendar { .build() } +fun Context.isOnline(): Boolean { + val connectivityManager = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager + return connectivityManager.activeNetworkInfo != null +} + fun Context.getNewEventTimestampFromCode(dayCode: String) = Formatter.getLocalDateTimeFromCode(dayCode).withTime(13, 0, 0, 0).seconds() fun Context.getCurrentOffset() = SimpleDateFormat("Z", Locale.getDefault()).format(Date()) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 95d6a98c8..26d166867 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 31836b2b3..b997d42da 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 9af65a3ac..b57498ee3 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml index c06b97db1..db14db958 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7e959e339..d720c8837 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index e9cab8f5f..fe8bdcb90 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index c7b056727..eba6f5625 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 265001d1b..b715bf31a 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ec59510c9..86ef7c876 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index ae05b1c8d..e5bd23767 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 + You cannot do that while offline. A sincronização Google ainda não está terminada. Reporte os erros encontrados para hello@simplemobiletools.com. Obrigado! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index db4993baf..8497af17f 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index a5e675c4a..300c2521e 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 + Nemôžete to urobiť bez internetu. Google synchronizácia je v testovacej prevádzke, buďte opatrní pri spoliehaní sa na ňu. Nahlásenie akýchkoľvek ohlasov na hello@simplemobiletools.com je vítané. Vďaka! Odoslať lokálne vytvorené udalosti do oblakov? Vypnutie Google synchonizácie odstráni všetky synchronizované udalosti zo zariadenia, no v oblakoch ostanú nedotknuté. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index e61565a35..9f9f719a7 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 66019a60a..be6d5c62b 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 386f3925e..8c9c748ef 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 + You cannot do that while offline. Google sync is in a testing mode, please be cautions when relying on it. Reporting any feedback at hello@simplemobiletools.com would be appreciated. Thanks! Send locally created events to the cloud? Disabling Google sync will delete all synced events from your device, while leaving them intact in the cloud.