Glance Widget Over Existing State

Build a home-screen widget that renders the app's existing state holder rather than a parallel copy of it, by injecting the same shared state object and the same long-lived scope the app already uses and re-issuing the widget update whenever that state changes. Covers dispatching the app's own UI events from widget buttons, why the injection target must be a singleton rather than a screen-scoped definition, making the whole widget a tap target, turning off hardware bitmaps for artwork the widget must read, and the leak to avoid when starting those collectors from the widget's provide-glance callback. Android only. Use when a widget shows stale playback or session state, when its artwork is blank, when a tap on it opens the launcher's menu or does nothing at all, or when its buttons need their own duplicate logic.

maxrave-dev 9e4a9fb 8.7 KB Updated

File contents

maxrave-dev/kotlin-footguns/tree/main/skills/glance-widget-over-existing-state commit 9e4a9fbba7

Frequently asked questions

npx skillmds@latest add maxrave-dev/glance-widget-over-existing-state