Skip to content

feat(widget): add adaptive card & circular desktop widgets - #1006

Open
SteveZMTstudios wants to merge 6 commits into
FoedusProgramme:betafrom
SteveZMTstudios:feat/desktop-widgets
Open

feat(widget): add adaptive card & circular desktop widgets#1006
SteveZMTstudios wants to merge 6 commits into
FoedusProgramme:betafrom
SteveZMTstudios:feat/desktop-widgets

Conversation

@SteveZMTstudios

Copy link
Copy Markdown
Contributor

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

@SteveZMTstudios

Copy link
Copy Markdown
Contributor Author

@SteveZMTstudios
SteveZMTstudios force-pushed the feat/desktop-widgets branch 2 times, most recently from f5c9b4d to e7d7146 Compare August 22, 2026 18:44
@SteveZMTstudios

Copy link
Copy Markdown
Contributor Author

@nift4 nift4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note I didn't have time to go through all of the code yet, this is only partial comments

Comment thread app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt Outdated
Comment thread app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt Outdated
Comment thread app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt Outdated
) {
val uri = state.artworkUri ?: return
CoroutineScope(Dispatchers.IO).launch {
val request = ImageRequest.Builder(context)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/src/main/java/org/akanework/gramophone/logic/GramophonePlaybackService.kt Outdated
@nift4

nift4 commented Aug 31, 2026

Copy link
Copy Markdown
Member

There's still unused methods fyi, and a conflict because your other PR was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants