calendar: custom-reminder dialog is a route with its content file
- Commit
fc30ba26a2d77d243e6cb13dbbbd5b9bcb3882c3- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-01 21:15 UTC (4 days ago)
- Parents
c8191d8
DialogsAsRoutes batch for calendar (fixes a broken HEAD the dialogs sweep left behind: CustomReminderDialog was committed referencing CustomReminderDialogContent while that file, the Route entry, and the EditEvent reminders wiring sat uncommitted on the main tree, so :calendar:compileReleaseKotlin failed on a clean tree with Unresolved reference CustomReminderDialogContent — this broke ./install all). CustomReminderDialogContent (with its WheelColumn) is now committed, Route.EditEvent.CustomReminderDialog is a DialogPage() destination pushed from EditEventReminders with the result wired through the reminders backStack, and HolidayCalendarsScreen/NavigationEntries carry the matching entries. Verified on the main tree: :calendar:compileReleaseKotlin green, :calendar:testDevUnitTest green.
Diff
calendar/AGENTS.md
diff --git a/calendar/AGENTS.md b/calendar/AGENTS.mdindex ac5ce6a941..52e943246b 100644--- a/calendar/AGENTS.md+++ b/calendar/AGENTS.md@@ -5,7 +5,7 @@ _Install: ./install calendar (dev by default)._ - Gradle: :calendar / dir: calendar/ - Package roots present: ui, data, intents-- Entry files: MainActivity.kt (no Route.kt — single-screen app with dialogs, not nav destinations)+- Entry files: MainActivity.kt, Route.kt, Navigation.kt - Deps: :library:widgets - Metadata: metadata_data/calendar.md (present) - Rust: no / screenshotTest: yes@@ -77,6 +77,8 @@ _Install: ./install calendar (dev by default)._ - com/vayunmathur/calendar/ui/dialogs/SettingsDeleteCalendarDialog.kt - com/vayunmathur/calendar/ui/dialogs/SettingsRenameCalendarDialog.kt - com/vayunmathur/calendar/ui/dialogs/TimezonePickerDialog.kt+- com/vayunmathur/calendar/ui/dialogs/CustomReminderDialog.kt+- com/vayunmathur/calendar/ui/dialogs/CustomReminderDialogContent.kt ### glance/ + intents/ — widgets and assistant IPC - com/vayunmathur/calendar/glance/CalendarGlanceWidget.kt - com/vayunmathur/calendar/glance/CalendarGlanceWidgetReceiver.kt
calendar/src/main/java/com/vayunmathur/calendar/Route.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/Route.kt b/calendar/src/main/java/com/vayunmathur/calendar/Route.ktindex 48e936deed..a1f13238f1 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/Route.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/Route.kt@@ -7,6 +7,19 @@ import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalTime import kotlinx.serialization.Serializable +// SCREENSHOT COVERAGE EXCEPTION: Calendar.GotoDialog: go-to-date dialog dispatches through the nav result registry and a live back stack; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: Settings.ChangeColor: colour dialog reads and writes ViewModel calendar state; no stateless slice for Layoutlib+// SCREENSHOT COVERAGE EXCEPTION: Settings.AddCalendar: add-calendar dialog writes through the ViewModel to the system CalendarProvider; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: Settings.RenameCalendar: rename dialog writes through the ViewModel to the system CalendarProvider; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: Settings.DeleteCalendar: delete dialog writes through the ViewModel to the system CalendarProvider; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: Settings.DefaultReminders: reminders dialog writes through the ViewModel to the system CalendarProvider; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: Settings.HolidayCalendars: holiday picker reads generated data through LocalContext and ViewModel state; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: Settings.ImportIcs: import reads SAF file URIs and provider writes; no stateless slice for Layoutlib+// SCREENSHOT COVERAGE EXCEPTION: EditEvent.DatePickerDialog: date picker dispatches through the nav result registry and a live back stack; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: EditEvent.TimePickerDialog: time picker dispatches through the nav result registry and a live back stack; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: EditEvent.CalendarPickerDialog: calendar picker reads ViewModel calendars and dispatches through the result registry; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: EditEvent.TimezonePickerDialog: timezone picker dispatches through the nav result registry and a live back stack; no stateless slice+// SCREENSHOT COVERAGE EXCEPTION: EditEvent.RecurrenceDialog: recurrence editor dispatches through the nav result registry and a live back stack; no stateless slice /** Navigation keys for calendar screens and dialogs, serializable so the back stack can be restored. */ sealed interface Route: NavKey { @Serializable@@ -88,6 +101,9 @@ sealed interface Route: NavKey { data class TimezonePickerDialog(val key: String): Route @Serializable+ /** Custom-reminder wheel dialog returning its result (minutes) under its key. */+ data class CustomReminderDialog(val key: String): Route+ /** Recurrence-editor dialog returning its result under its key for an event starting on the start date. */ data class RecurrenceDialog( val key: String,
calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventReminders.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventReminders.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventReminders.ktindex 4bda8067b4..f24a9e03f8 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventReminders.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventReminders.kt@@ -1,46 +1,30 @@ package com.vayunmathur.calendar.ui import androidx.compose.foundation.clickable-import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box-import androidx.compose.foundation.layout.Column-import androidx.compose.foundation.layout.PaddingValues-import androidx.compose.foundation.layout.Row-import androidx.compose.foundation.layout.fillMaxWidth-import androidx.compose.foundation.layout.height-import androidx.compose.foundation.pager.PageSize-import androidx.compose.foundation.pager.VerticalPager-import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.runtime.Composable-import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember-import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue-import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource-import androidx.compose.ui.text.font.FontWeight-import androidx.compose.ui.text.style.TextAlign-import androidx.compose.ui.unit.dp import com.vayunmathur.calendar.R-import com.vayunmathur.library.ui.AlertDialog-import com.vayunmathur.library.ui.Button+import com.vayunmathur.calendar.Route import com.vayunmathur.library.ui.DropdownMenu import com.vayunmathur.library.ui.DropdownMenuItem import com.vayunmathur.library.ui.IconSchedule-import com.vayunmathur.library.ui.MaterialTheme import com.vayunmathur.library.ui.Text import com.vayunmathur.library.ui.R as UiR-import kotlinx.coroutines.launch+import com.vayunmathur.library.util.NavBackStack @Composable internal fun EditEventReminders( reminders: List<Int>, onReminders: (List<Int>) -> Unit,+ backStack: NavBackStack<Route>,+ customReminderKey: String, ) { val context = LocalContext.current // Reminders@@ -52,7 +36,6 @@ internal fun EditEventReminders( ) } var addReminderExpanded by remember { mutableStateOf(false) }- var showCustomDialog by remember { mutableStateOf(false) } val available = REMINDER_PRESETS.filter { it !in reminders } // The Custom option means the add row always has something to offer, even when // every preset is already selected.@@ -75,133 +58,11 @@ internal fun EditEventReminders( text = { Text(stringResource(R.string.reminder_custom)) }, onClick = { addReminderExpanded = false- showCustomDialog = true+ backStack.add(Route.EditEvent.CustomReminderDialog(customReminderKey)) }, ) } } }, )- if (showCustomDialog) {- CustomReminderDialog(- onDismiss = { showCustomDialog = false },- onConfirm = { minutes ->- showCustomDialog = false- if (minutes !in reminders) onReminders((reminders + minutes).sorted())- },- )- }-}--@Composable-private fun CustomReminderDialog(- onDismiss: () -> Unit,- onConfirm: (Int) -> Unit,-) {- val context = LocalContext.current- var hours by remember { mutableIntStateOf(0) }- var minutes by remember { mutableIntStateOf(15) }- val totalMinutes = hours * 60 + minutes- AlertDialog(- onDismissRequest = onDismiss,- title = { Text(stringResource(R.string.reminder_custom_title)) },- text = {- Column(horizontalAlignment = Alignment.CenterHorizontally) {- Row(- Modifier.fillMaxWidth(),- horizontalArrangement = Arrangement.Center,- verticalAlignment = Alignment.Top,- ) {- Column(Modifier.weight(1f), horizontalAlignment = Alignment.CenterHorizontally) {- Text(- stringResource(R.string.reminder_unit_hours),- style = MaterialTheme.typography.labelMedium,- color = MaterialTheme.colorScheme.onSurfaceVariant,- )- WheelColumn(- range = 0..99,- value = hours,- onValue = { hours = it },- label = { it.toString() },- )- }- Column(Modifier.weight(1f), horizontalAlignment = Alignment.CenterHorizontally) {- Text(- stringResource(R.string.reminder_unit_minutes),- style = MaterialTheme.typography.labelMedium,- color = MaterialTheme.colorScheme.onSurfaceVariant,- )- WheelColumn(- range = 0..59,- value = minutes,- onValue = { minutes = it },- label = { "%02d".format(it) },- )- }- }- Text(- reminderLabel(context, totalMinutes),- style = MaterialTheme.typography.bodyMedium,- color = MaterialTheme.colorScheme.onSurfaceVariant,- )- }- },- confirmButton = {- Button(onClick = { onConfirm(totalMinutes) }, enabled = totalMinutes > 0) {- Text(stringResource(UiR.string.add))- }- },- dismissButton = {- Button(onClick = onDismiss) { Text(stringResource(UiR.string.cancel)) }- },- )-}--/**- * A spinning-wheel number column: a [VerticalPager] with a fixed page size so a fling- * settles on a value, with the settled row emphasized. The vertical content padding keeps- * the first and last values centerable. Reports the settled page via [onValue]; tapping a- * visible row animates to it.- */-@Composable-private fun WheelColumn(- range: IntRange,- value: Int,- onValue: (Int) -> Unit,- label: (Int) -> String,- modifier: Modifier = Modifier,-) {- val values = remember(range) { range.toList() }- val pagerState = rememberPagerState(- initialPage = values.indexOf(value).coerceAtLeast(0),- ) { values.size }- val scope = rememberCoroutineScope()- LaunchedEffect(pagerState.settledPage) {- val settled = values.getOrNull(pagerState.settledPage) ?: return@LaunchedEffect- if (settled != value) onValue(settled)- }- VerticalPager(- state = pagerState,- pageSize = PageSize.Fixed(48.dp),- contentPadding = PaddingValues(vertical = 48.dp),- modifier = modifier.height(144.dp),- ) { page ->- val v = values[page]- val selected = page == pagerState.currentPage- Box(- Modifier- .fillMaxWidth()- .height(48.dp)- .clickable { scope.launch { pagerState.animateScrollToPage(page) } },- contentAlignment = Alignment.Center,- ) {- Text(- label(v),- style = if (selected) MaterialTheme.typography.titleLarge else MaterialTheme.typography.bodyLarge,- fontWeight = if (selected) FontWeight.Bold else null,- color = if (selected) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant,- textAlign = TextAlign.Center,- )- }- } }
calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventScreen.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventScreen.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventScreen.ktindex 65dd20edfd..16b9ab15bd 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventScreen.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/EditEventScreen.kt@@ -68,6 +68,7 @@ private const val KEY_END_TIME = "EditEvent.endTime" private const val KEY_RECURRENCE = "EditEvent.recurrence" private const val KEY_CALENDAR = "EditEvent.calendar" private const val KEY_TIMEZONE = "EditEvent.timezone"+private const val KEY_CUSTOM_REMINDER = "EditEvent.customReminder" @OptIn(ExperimentalMaterial3Api::class) @Composable@@ -229,6 +230,11 @@ fun EditEventScreen(viewModel: CalendarViewModel, editRoute: Route.EditEvent, ba // Timezone selector (navigation dialog) - open via Nav route and handle result ResultEffect<String>(KEY_TIMEZONE) { z -> timezone = z } + // Custom-reminder wheel dialog result (minutes).+ ResultEffect<Int>(KEY_CUSTOM_REMINDER) { minutes ->+ if (minutes !in reminders) reminders = (reminders + minutes).sorted()+ }+ DetailScaffold( title = "", onNavigateBack = { backStack.pop() },@@ -317,7 +323,7 @@ fun EditEventScreen(viewModel: CalendarViewModel, editRoute: Route.EditEvent, ba HorizontalDivider(Modifier.padding(vertical = 8.dp)) - EditEventReminders(reminders = reminders, onReminders = { reminders = it })+ EditEventReminders(reminders = reminders, onReminders = { reminders = it }, backStack = backStack, customReminderKey = KEY_CUSTOM_REMINDER) HorizontalDivider(Modifier.padding(vertical = 8.dp)) // The location line on the detail screen morphs into this field. sharedTextKey, not a
calendar/src/main/java/com/vayunmathur/calendar/ui/HolidayCalendarsScreen.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/HolidayCalendarsScreen.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/HolidayCalendarsScreen.ktindex 3bdc952eb5..bc70e493d1 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/HolidayCalendarsScreen.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/HolidayCalendarsScreen.kt@@ -1,4 +1,5 @@ package com.vayunmathur.calendar.ui+// DIALOG LOCAL EXCEPTION: holiday language picker is a search-picker over generated holiday data whose selection immediately adds the calendar with that language; a route version needs a country/language result contract, tracked as a follow-up // SCAFFOLD SEARCH EXCEPTION: language-picker dialog-local search filter in this file; the screen's country search uses the scaffold search parameter
calendar/src/main/java/com/vayunmathur/calendar/ui/NavigationEntries.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/NavigationEntries.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/NavigationEntries.ktindex 7272e69355..2bc5137339 100644--- a/calendar/src/main/java/com/vayunmathur/calendar/ui/NavigationEntries.kt+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/NavigationEntries.kt@@ -3,6 +3,7 @@ package com.vayunmathur.calendar.ui import com.vayunmathur.calendar.Route import com.vayunmathur.calendar.platform.CalendarViewModel import com.vayunmathur.calendar.ui.dialogs.CalendarPickerDialog+import com.vayunmathur.calendar.ui.dialogs.CustomReminderDialog import com.vayunmathur.calendar.ui.dialogs.CalendarSetDateDialog import com.vayunmathur.calendar.ui.dialogs.RecurrenceDialog import com.vayunmathur.calendar.ui.dialogs.SettingsAddCalendarDialog@@ -72,6 +73,10 @@ internal fun EntryProviderScope<Route>.dialogEntries( entry<Route.EditEvent.RecurrenceDialog>(metadata = DialogPage()) { key -> RecurrenceDialog(backStack, key.key, key.startDate, key.initial, key.initialDates) }++ entry<Route.EditEvent.CustomReminderDialog>(metadata = DialogPage()) { key ->+ CustomReminderDialog(backStack, key.key)+ } } internal fun EntryProviderScope<Route>.settingsDialogEntries(
calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/CustomReminderDialogContent.kt
diff --git a/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/CustomReminderDialogContent.kt b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/CustomReminderDialogContent.ktnew file mode 100644index 0000000000..338eea4d20--- /dev/null+++ b/calendar/src/main/java/com/vayunmathur/calendar/ui/dialogs/CustomReminderDialogContent.kt@@ -0,0 +1,149 @@+package com.vayunmathur.calendar.ui.dialogs++import androidx.compose.foundation.clickable+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Box+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.PaddingValues+import androidx.compose.foundation.layout.Row+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.height+import androidx.compose.foundation.pager.PageSize+import androidx.compose.foundation.pager.VerticalPager+import androidx.compose.foundation.pager.rememberPagerState+import androidx.compose.runtime.Composable+import androidx.compose.runtime.LaunchedEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableIntStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.rememberCoroutineScope+import androidx.compose.runtime.setValue+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.platform.LocalContext+import androidx.compose.ui.res.stringResource+import androidx.compose.ui.text.font.FontWeight+import androidx.compose.ui.text.style.TextAlign+import androidx.compose.ui.unit.dp+import com.vayunmathur.calendar.R+import com.vayunmathur.calendar.ui.reminderLabel+import com.vayunmathur.library.ui.AlertDialog+import com.vayunmathur.library.ui.Button+import com.vayunmathur.library.ui.MaterialTheme+import com.vayunmathur.library.ui.Text+import com.vayunmathur.library.ui.R as UiR+import kotlinx.coroutines.launch++/** The wheel-picker content, stateless apart from the wheels, for previews/tests. */+@Composable+fun CustomReminderDialogContent(+ onDismiss: () -> Unit,+ onConfirm: (Int) -> Unit,+) {+ val context = LocalContext.current+ var hours by remember { mutableIntStateOf(0) }+ var minutes by remember { mutableIntStateOf(15) }+ val totalMinutes = hours * 60 + minutes+ AlertDialog(+ onDismissRequest = onDismiss,+ title = { Text(stringResource(R.string.reminder_custom_title)) },+ text = {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Row(+ Modifier.fillMaxWidth(),+ horizontalArrangement = Arrangement.Center,+ verticalAlignment = Alignment.Top,+ ) {+ Column(Modifier.weight(1f), horizontalAlignment = Alignment.CenterHorizontally) {+ Text(+ stringResource(R.string.reminder_unit_hours),+ style = MaterialTheme.typography.labelMedium,+ color = MaterialTheme.colorScheme.onSurfaceVariant,+ )+ WheelColumn(+ range = 0..99,+ value = hours,+ onValue = { hours = it },+ label = { it.toString() },+ )+ }+ Column(Modifier.weight(1f), horizontalAlignment = Alignment.CenterHorizontally) {+ Text(+ stringResource(R.string.reminder_unit_minutes),+ style = MaterialTheme.typography.labelMedium,+ color = MaterialTheme.colorScheme.onSurfaceVariant,+ )+ WheelColumn(+ range = 0..59,+ value = minutes,+ onValue = { minutes = it },+ label = { "%02d".format(it) },+ )+ }+ }+ Text(+ reminderLabel(context, totalMinutes),+ style = MaterialTheme.typography.bodyMedium,+ color = MaterialTheme.colorScheme.onSurfaceVariant,+ )+ }+ },+ confirmButton = {+ Button(onClick = { onConfirm(totalMinutes) }, enabled = totalMinutes > 0) {+ Text(stringResource(UiR.string.add))+ }+ },+ dismissButton = {+ Button(onClick = onDismiss) { Text(stringResource(UiR.string.cancel)) }+ },+ )+}++/**+ * A spinning-wheel number column: a [VerticalPager] with a fixed page size so a fling+ * settles on a value, with the settled row emphasized. The vertical content padding keeps+ * the first and last values centerable. Reports the settled page via [onValue]; tapping a+ * visible row animates to it.+ */+@Composable+private fun WheelColumn(+ range: IntRange,+ value: Int,+ onValue: (Int) -> Unit,+ label: (Int) -> String,+ modifier: Modifier = Modifier,+) {+ val values = remember(range) { range.toList() }+ val pagerState = rememberPagerState(+ initialPage = values.indexOf(value).coerceAtLeast(0),+ ) { values.size }+ val scope = rememberCoroutineScope()+ LaunchedEffect(pagerState.settledPage) {+ val settled = values.getOrNull(pagerState.settledPage) ?: return@LaunchedEffect+ if (settled != value) onValue(settled)+ }+ VerticalPager(+ state = pagerState,+ pageSize = PageSize.Fixed(48.dp),+ contentPadding = PaddingValues(vertical = 48.dp),+ modifier = modifier.height(144.dp),+ ) { page ->+ val v = values[page]+ val selected = page == pagerState.currentPage+ Box(+ Modifier+ .fillMaxWidth()+ .height(48.dp)+ .clickable { scope.launch { pagerState.animateScrollToPage(page) } },+ contentAlignment = Alignment.Center,+ ) {+ Text(+ label(v),+ style = if (selected) MaterialTheme.typography.titleLarge else MaterialTheme.typography.bodyLarge,+ fontWeight = if (selected) FontWeight.Bold else null,+ color = if (selected) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant,+ textAlign = TextAlign.Center,+ )+ }+ }+}
calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/MetadataPreviews.kt
diff --git a/calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/MetadataPreviews.kt b/calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/MetadataPreviews.ktindex aec93a1f69..329171fd16 100644--- a/calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/MetadataPreviews.kt+++ b/calendar/src/screenshotTest/kotlin/com/vayunmathur/calendar/ui/MetadataPreviews.kt@@ -145,16 +145,19 @@ private val SAMPLE_EVENTS = listOf( * scheme rather than a user's accent colour. * * Coverage: `Calendar` (month), `Event` (detail) and `Settings` on phone, plus both the- * month (main) and event detail on large-tablet.- * Exceptions (no stateless slice; ViewModel + system CalendarProvider / intent URIs):+ * month (main) and event detail on large-tablet. The dialog route+ * `EditEvent.CustomReminderDialog` is captured from its stateless wheel content.+ * Exceptions (declared per route in `Route.kt` for the `RouteScreenshotCoverage`+ * lint; no stateless slice — ViewModel + system CalendarProvider / intent URIs): * `EditEvent`, `HolidayCalendars` and `ImportIcs` are not preview-rendered — faking them- * from literals would not show the real editor/import screens. Dialog routes- * (`GotoDialog`, pickers, recurrence, settings dialogs) are dialogs, not full screens.+ * from literals would not show the real editor/import screens; the remaining dialog+ * routes (`GotoDialog`, the pickers, recurrence, the settings dialogs) are+ * ViewModel/back-stack-coupled with no stateless slice. */ class MetadataPreviews { @PreviewTest- @Preview(name = "1-month", device = PHONE, group = "phone", showSystemUi = true)+ @Preview(name = "1-calendar", device = PHONE, group = "phone", showSystemUi = true) @Composable fun Preview1Month() { DynamicTheme(darkTheme = true) {@@ -207,7 +210,7 @@ class MetadataPreviews { } @PreviewTest- @Preview(name = "5-month-expanded", device = EXPANDED, group = "large-tablet", showSystemUi = true)+ @Preview(name = "5-calendar-expanded", device = EXPANDED, group = "large-tablet", showSystemUi = true) @Composable fun Preview5MonthExpanded() { DynamicTheme(darkTheme = true) {@@ -227,7 +230,7 @@ class MetadataPreviews { } @PreviewTest- @Preview(name = "4-expanded", device = EXPANDED, group = "large-tablet", showSystemUi = true)+ @Preview(name = "4-event-expanded", device = EXPANDED, group = "large-tablet", showSystemUi = true) @Composable fun Preview4Expanded() { // The detail pane at desktop width: the event the month grid selection opens.@@ -242,4 +245,13 @@ class MetadataPreviews { ) } }++ @PreviewTest+ @Preview(name = "6-edit-event-custom-reminder-dialog", device = PHONE, group = "phone", showSystemUi = true)+ @Composable+ fun Preview6CustomReminderDialog() {+ DynamicTheme(darkTheme = true) {+ com.vayunmathur.calendar.ui.dialogs.CustomReminderDialogContent(onDismiss = {}, onConfirm = {})+ }+ } }
calendar/src/test/java/com/vayunmathur/calendar/ui/BinderAndScopeTest.kt
diff --git a/calendar/src/test/java/com/vayunmathur/calendar/ui/BinderAndScopeTest.kt b/calendar/src/test/java/com/vayunmathur/calendar/ui/BinderAndScopeTest.ktindex ca178aed22..cbc008b76f 100644--- a/calendar/src/test/java/com/vayunmathur/calendar/ui/BinderAndScopeTest.kt+++ b/calendar/src/test/java/com/vayunmathur/calendar/ui/BinderAndScopeTest.kt@@ -1,5 +1,7 @@ package com.vayunmathur.calendar.ui +// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch.+ import android.app.Application import android.net.Uri import android.os.Looper
calendar/src/test/java/com/vayunmathur/calendar/util/ReminderHolidayIntentTest.kt
diff --git a/calendar/src/test/java/com/vayunmathur/calendar/util/ReminderHolidayIntentTest.kt b/calendar/src/test/java/com/vayunmathur/calendar/util/ReminderHolidayIntentTest.ktindex a47a30859c..6396f53035 100644--- a/calendar/src/test/java/com/vayunmathur/calendar/util/ReminderHolidayIntentTest.kt+++ b/calendar/src/test/java/com/vayunmathur/calendar/util/ReminderHolidayIntentTest.kt@@ -1,4 +1,6 @@ package com.vayunmathur.calendar.util++// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.calendar.platform.BootReceiver import com.vayunmathur.calendar.platform.ReminderReceiver import com.vayunmathur.calendar.platform.describe
calendar/src/test/java/com/vayunmathur/calendar/widget/GlanceContentTest.kt
diff --git a/calendar/src/test/java/com/vayunmathur/calendar/widget/GlanceContentTest.kt b/calendar/src/test/java/com/vayunmathur/calendar/widget/GlanceContentTest.ktindex e173dc016b..f89ff4be48 100644--- a/calendar/src/test/java/com/vayunmathur/calendar/widget/GlanceContentTest.kt+++ b/calendar/src/test/java/com/vayunmathur/calendar/widget/GlanceContentTest.kt@@ -1,4 +1,6 @@ package com.vayunmathur.calendar.widget++// FIXTURE RELATIVE-TIME EXCEPTION: timestamps are seeded relative to the wall clock the code under test reads internally, so the fresh/expired/relative-time branch under test keeps its meaning; a fixed past instant would silently change that branch. import com.vayunmathur.calendar.widget.Content import com.vayunmathur.calendar.widget.MonthContent import com.vayunmathur.calendar.widget.computeMonthGrid