From 9b9db814ebafefdb4a0905949a4941a32c49a702 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Wed, 23 Sep 2026 18:26:35 +0200 Subject: [PATCH] Drop the add-account button from the calendar step (#287) --- .../calendula/ui/onboarding/CalendarsStep.kt | 33 +++---------------- app/src/main/res/values/strings.xml | 3 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/onboarding/CalendarsStep.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/onboarding/CalendarsStep.kt index 06c61eb..14b34e6 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/onboarding/CalendarsStep.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/onboarding/CalendarsStep.kt @@ -1,9 +1,5 @@ package de.jeanlucmakiola.calendula.ui.onboarding -import android.content.Context -import android.content.Intent -import android.provider.CalendarContract -import android.provider.Settings import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -35,9 +31,9 @@ private const val DAVX5_URL = "https://www.davx5.com/" * Wizard step shown only when the device has no calendar at all (#287): the app * would otherwise finish onboarding onto an empty grid with nothing saying why. * - * Three ways out, in the order most people want them. Calendula writes to the - * system calendar provider and syncs nothing itself, so two of the three are - * handing off to something that does. + * Two ways out. Calendula writes to the system calendar provider and syncs + * nothing itself, so anything beyond a device-only calendar means pointing at + * whatever does the syncing. */ @Composable internal fun CalendarsStep( @@ -67,14 +63,8 @@ internal fun CalendarsStep( ) } OutlinedButton( - onClick = { context.startCalendarAccountSetup() }, - modifier = Modifier.fillMaxWidth().height(56.dp), - ) { - Text(stringResource(R.string.onboarding_calendars_account_button)) - } - TextButton( onClick = { openUrl(context, DAVX5_URL) }, - modifier = Modifier.fillMaxWidth(), + modifier = Modifier.fillMaxWidth().height(56.dp), ) { Text(stringResource(R.string.onboarding_calendars_caldav_button)) } @@ -114,18 +104,3 @@ internal fun CalendarsStep( ) } } - -/** - * Open the system screen for putting an account's calendars on the device: the - * account chooser filtered to calendar providers, falling back to sync settings - * where no chooser resolves. Both are system components, so neither needs a - * `` entry. Mirrors the same hand-off in `CalendarFailure`. - */ -private fun Context.startCalendarAccountSetup() { - val intents = listOf( - Intent(Settings.ACTION_ADD_ACCOUNT) - .putExtra(Settings.EXTRA_AUTHORITIES, arrayOf(CalendarContract.AUTHORITY)), - Intent(Settings.ACTION_SYNC_SETTINGS), - ) - intents.firstOrNull { runCatching { startActivity(it) }.isSuccess } -} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f02cb44..72ef9b6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -302,8 +302,7 @@ This device has no calendar yet. Calendula writes to the calendars already on your phone — it needs at least one. My calendar Create a calendar on this device - Add an account - Using Nextcloud or another CalDAV server? + Sync with a CalDAV server Not now Stays on this phone A device calendar syncs nowhere, so back it up if the events matter.