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 51c0d8843..cb3c8b68a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -18,6 +18,7 @@ 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.calendar.models.EventType +import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_READ_CALENDAR @@ -49,6 +50,7 @@ class SettingsActivity : SimpleActivity() { setupManageEventTypes() setupHourFormat() setupSundayFirst() + setupDeleteAllEvents() setupReplaceDescription() setupWeekNumbers() setupWeeklyStart() @@ -204,6 +206,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupDeleteAllEvents() { + settings_delete_all_events_holder.setOnClickListener { + ConfirmationDialog(this, messageId = R.string.delete_all_events_confirmation) { + dbHelper.deleteAllEvents() + } + } + } + private fun setupReplaceDescription() { settings_replace_description.isChecked = config.replaceDescription settings_replace_description_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt index 7eb444543..90d166db4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/CalDAVHandler.kt @@ -412,7 +412,6 @@ class CalDAVHandler(val context: Context) { try { context.contentResolver.delete(contentUri, null, null) } catch (ignored: Exception) { - } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt index 324aef5d5..5f5d97b98 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/DBHelper.kt @@ -426,6 +426,10 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont return fillEvents(cursor) } + fun deleteAllEvents() { + + } + fun deleteEvents(ids: Array, deleteFromCalDAV: Boolean) { val args = TextUtils.join(", ", ids) val selection = "$MAIN_TABLE_NAME.$COL_ID IN ($args)" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 25fd15e75..50ef0227d 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -109,6 +109,28 @@ + + + + + + Daleañ an adc\'halv eus Widjetoù Amsaviñ an deskrivadur gant al lec\'hiadur er gwell roll enankadoù + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 2232c67e1..98f1486a9 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -202,6 +202,8 @@ Odložit připomenutí pomocí funkce Snooze by Widgety Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 8c1c96838..82b36b4ef 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -195,6 +195,8 @@ Udsæt påmindelsen med en snooze på Widgets Erstat beskrivelse med sted på visningen af begivenhedslisten + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9c4b4c8fa..41574ee21 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -195,6 +195,8 @@ Erinnerung mit Snooze verschieben um Widgets Ersetze Beschreibung mit Ort bei Listeneinträgen + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e2cd8b0e8..0c100eb3a 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -195,6 +195,8 @@ Retrasar recordatorio durante Widgets Remplazar la descripción con la ubicación al mostrar entradas + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 45898ef7e..3dc89a785 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -195,6 +195,8 @@ Reporter le rappel avec Snooze de Widgets Remplacer la description par la position dans la vue sous forme de liste + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml index c39dcbb1b..5682d5d37 100644 --- a/app/src/main/res/values-hi-rIN/strings.xml +++ b/app/src/main/res/values-hi-rIN/strings.xml @@ -196,6 +196,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 9d41c7962..0bb7d0d41 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -195,6 +195,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 95ba74e65..e71a0caf3 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -195,6 +195,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index f70a5160f..d0dfe4bbc 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -196,6 +196,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 1ed656ce6..565926fa1 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -195,6 +195,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 857f5e69b..7655fed6d 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -195,6 +195,8 @@ 스누즈 알림 시간 위젯 목록보기의 설명정보를 위치정보로 대체 + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index f1e91fde7..35855ca10 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -195,6 +195,8 @@ Utsett påminnelser med Snooze Moduler Erstatt Beskrivelse med Sted i listevisningen + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 143721853..955aada6a 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -195,6 +195,8 @@ Herinnering uitstellen met Widgets Beschrijving vervangen door Locatie in lijstweergave + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml index c7c403e3b..62e781e9a 100644 --- a/app/src/main/res/values-no/strings.xml +++ b/app/src/main/res/values-no/strings.xml @@ -195,6 +195,8 @@ Utsett påminnelser med Snooze med Moduler Erstatt Beskrivelse med Sted i listevisningen + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index ae1a989e7..038a9f71a 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -200,6 +200,8 @@ Opóźnij przypomnienie o Widżety Zastąp Opis z Lokalizacją w widoku wejść + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 0ecbcd8db..2d26d119b 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -195,6 +195,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index bc9a57b21..ce7d69f4c 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -195,6 +195,8 @@ Adiar lembrete com a opção Snooze Widgets Substituir descrição e localização nas entradas da vista de lista + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 39297f167..e380ef2b7 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -209,6 +209,8 @@ Отложить напоминание на Виджеты Показывать место вместо описания в списке событий + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 85bfde8f7..f70b39f73 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -202,6 +202,8 @@ Posunúť pripomienku s Odložiť o Widgety Nahradiť Popis udalosti Miestom v listových zobrazeniach + Odstrániť všetky udalosti + Ste si istý, že chcete odstrániť všetky udalosti? Všetky typy udalostí a nastavenia ostanú nedotknuté. CalDAV diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 9589b2423..916421b08 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -195,6 +195,8 @@ Skjut upp påminnelse med Snooza Widgetar Ersätt Beskrivning med Plats i listvyn + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index e0a75e3cc..f24fbbba7 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -195,6 +195,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 563a88c90..bd5e44685 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -195,6 +195,8 @@ Postpone reminder with Snooze by Widgets Replace Description with Location at list view entries + Delete all events + Are you sure you want to delete all events? This will leave your event types and other settings intact. CalDAV