hoangsonww / hoangsonww/Diffuse-Native-Apps
Ship Android home-screen widgets to reach parity with WidgetKit
- Dominant language
- Swift
- Stars
- 2
- Forks
- 0
- Avg merge
- 1h 53m
- Merged PRs (30d)
- 14
Description
## Motivation
The Apple apps expose the product's core answer — how many things changed, and how bad — without opening anything: Home Screen and Lock Screen widgets on iOS/iPadOS and `Δ N` complications on watchOS, sharing code in `Apps/Shared/ChangeCountWidget.swift`. Android has nothing equivalent; `grep -ri 'glance\|appwidget' Android/app/src/main/` returns no matches.
This is the single largest behavioural gap between the two families. Diffuse's value is a glanceable delta, and on Android the user must launch the app and wait for a capture to learn anything. The README presents five co-equal native apps, so the absence reads as an oversight rather than a decision.
## Proposed Solution
Add a Glance `GlanceAppWidget` in a new `Android/app/src/main/java/com/diffuse/android/widget/` package, with a small and a medium size. It reads the latest `SnapshotSummary` and the newest `DiffResult` through `DiffuseService` — no new collection path, no new permission — and renders the change count plus peak severity using the existing `ui/Theme.kt` palette.
Refresh piggybacks on `SnapshotWorker`: after a capture persists, enqueue a widget update, so the widget stays consistent with whatever the scheduler decided. When the library is empty or a capture is skipped, show the same honest empty state the app uses rather than a stale number.
## Acceptance Criteria
- [ ] Glance widget in at least two sizes, themed consistently with the app
- [ ] Widget reads existing service APIs only — no new permission, no new collector, no `INTERNET`
- [ ] Updated after each persisted capture via `SnapshotWorker`, not on a timer of its own
- [ ] Honest empty and skipped states rather than a stale count
- [ ] Instrumented test covers rendering with zero, one, and many snapshots
- [ ] `Documentation/Apps.md` and `Android/README.md` document the widget
## Additional Context
Apple prior art: `Apps/Shared/ChangeCountWidget.swift`, `ChangeCountSummary.swift`. Glance is an AndroidX library, consistent with the dependency policy in [ADR 0009](Documentation/adr/0009-native-android.md).
Contributor guide
Assessment
This issue has not been assessed yet.