feat(widget): add adaptive card & circular desktop widgets - #1006
feat(widget): add adaptive card & circular desktop widgets#1006SteveZMTstudios wants to merge 6 commits into
Conversation
f5c9b4d to
e7d7146
Compare
nift4
left a comment
There was a problem hiding this comment.
Note I didn't have time to go through all of the code yet, this is only partial comments
| ) { | ||
| val uri = state.artworkUri ?: return | ||
| CoroutineScope(Dispatchers.IO).launch { | ||
| val request = ImageRequest.Builder(context) |
There was a problem hiding this comment.
I'm wondering if there's a more optimal way to do it, did you test letting image view load the cover itself? (I guess a placeholder can be achieved by stacking two imageview in a framelayout, but IDK if that is a great idea)
There was a problem hiding this comment.
My initial attempt involved handling album art loading directly with RemoteViews/ImageViews, but I encountered noticeable UI flickering issues: Whenever controls were updated (e.g., scrolling lyrics from a lyrics control, progress updates, or play/pause switching), reapplying RemoteViews caused the launcher's ImageView to reload/redraw the URI from scratch, resulting in very noticeable and distracting flickering of the album art.
Stacking two ImageViews within a FrameLayout was completely unnecessary, not only adding unnecessary layout overhead but also failing to prevent the top album art view from flickering during subsequent RemoteViews updates, as they refreshed together.
By loading the album art once in the background using Coil and caching it in memory (cachedArtworkBitmap), subsequent control updates (progress bar jumps, playback status changes) could immediately reuse the existing Bitmap, completely eliminating flickering and making updates visually smoother.
|
There's still unused methods fyi, and a conflict because your other PR was merged |
55c398c to
2637746
Compare
Summary
Card widget — a new responsive home-screen widget family for quick playback control. One provider delivers pill (1×1), circle (2×2 w/ progress ring), card (4×1), medium (4×2) and large (4×4 / wide 5×4) layouts, plus favorite & shuffle actions on wide slots.
Widget favorite action connects through a dedicated playback-service helper so the current item's heart rating and widget state stay in sync across lyric/session updates.
Widget resources use Material You system colors on Android 12+ with stable theme-token fallbacks for pre-12 and night mode; default + zh-rCN strings added for all new settings and the widget picker label.
Screenshots, CI tests and more, see #1003