Skip to content

Commit 6a9e714

Browse files
committed
feat(reminders): AddEditReminderDialog
GSoC 2025: Review Reminders - Creates AddEditReminderDialog. - Adds DialogMode, which represents whether the dialog is in adding or editing mode. - The dialog's state is tracked via a view model, which is initialized upon creation via `viewModelFactory`, as this is the common way of creating view models throughout AnkiDroid based on my reading of the codebase. Values are filled in from the old reminder (if in edit mode) or from defaults (if in add mode). - Sets submit, cancel, and delete actions for the dialog; this is the main way users can delete review reminders. Deletion is locked behind a confirmation box just in case the user accidentally clicks the button. - Results for the deck picker dropdown in the dialog are received in ScheduleReminders and sent to the AddEditReminderDialog via a FragmentResult. See the docstring of `onDeckSelected` in ScheduleReminders to see why this is done. - Filling in the values in the dialog fields and setting listeners for when the values change is pulled out into a separate methods for readability. - Adds `showTimePickerDialog`. Shows a TimePicker dialog for picking review reminder time via modern Material3 guidelines. Overrides `onConfigurationChanged` to properly handle device rotation, which for some reason is not handled by default by MaterialTimePicker. - An edited review reminder is passed back to ReviewRemindersDatabase as a FragmentResult, which is a simple way of passing information between fragments.
1 parent 51960c2 commit 6a9e714

File tree

1 file changed

+411
-0
lines changed

1 file changed

+411
-0
lines changed

0 commit comments

Comments
 (0)