-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I change the color of MediaSessionService's notification when the currently playing MediaItem doesn't have an artwork ? #1795
Comments
Thanks for your question. Yeah, I think regarding the color palette used for the media notification starting from API 33 I don't know about ways to change the colors. Media3 is using the API that System UI gives apps. There probably isn't a better answer or explanation then the one you gave yourself. :) The docs and config options I know are about Android Media Controls and the change from using notification vs. media session in Android 13 in the OEM docs. If you really want it you obviously can consider using a single colored bitmap as a fallback. Given old Android versions are out and won't change that behaviour this seems like the way, probably. Or make the fallback even prettier :) Regarding the coloring of the icon it seems that Media3 is using resource IDs in |
Android 14 One UI version 6.1
I am working on a local music player app using a
MediaSessionService
.Obviously, most audio files do not possess an artwork. So, what defines
MediaSessionService
's notification's color palette when the currentMediaItem
doesn't have an artwork ?After a quick test, it seems as if the notification's color palette depends on the app's icon. Here's an example with a generic red icon:
However, I would like to set a custom color palette for the notification which doesn't depend on the icon's color. Can it be done and, if so, how?
At first, I thought the solution was to use
MediaNotification.Provider
as specified in the documentation. However, the documentation also specifies this:Which means that it has basically no effect starting from Android 13.
Also, as a slight deviation from my main question, the two custom buttons' icons (thumbs up and down) are white despite the fact that their vector assets are colored. In fact, using these same drawables in an activity displays the desired colors. Is this working as intended ?
The text was updated successfully, but these errors were encountered: