Add new-mail notifications and persisted settings

Increment 6 — notifications and settings.

- Local new-mail notifications (no push service): MailNotifier posts a notification
  when background sync finds newly-arrived unread mail, and tapping it opens the app.
  Adds a POST_NOTIFICATIONS request on launch.
- MailSyncer detects genuinely new messages (diff against cached ids, skipped on an
  account's first sync) and notifies when the setting is enabled.
- SettingsRepository (Preferences DataStore) persists settings; the Settings screen
  gains a Notifications section, and "Use wallpaper colors" now actually drives the
  Material You theme (MainActivity collects it reactively).
- assemble/test/lint green; verified on the Android 17 emulator — delivered a new
  message and the on-device notification appeared in the shade.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 20:21:49 -05:00
co-authored by Claude Opus 4.8
parent 22ddc08a24
commit 40b0d9b3ad
11 changed files with 261 additions and 35 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ experience with power-user features tucked under an **Advanced Settings** group.
> Room cache with pull-to-refresh; and **reading** — message bodies fetched on open and
> rendered in a hardened WebView (JavaScript off, remote images blocked by default),
> with mark-read, star, and delete; and **composing** — a compose screen with device-
> contacts autocomplete that sends over SMTP, plus reply. Outlook Graph send, push
> notifications, and multi-account polish are upcoming.
> contacts autocomplete that sends over SMTP, plus reply; and **on-device new-mail
> notifications** (no push service) with persisted settings. Outlook Graph send, IMAP
> IDLE push, attachments, and multi-account polish are upcoming.
## Features (target MVP)