Reputation: 705
The MediaStyle Notification introduced in Android 10 works but is however black and doesn't display duration either.
Here is a link to the code: https://github.com/ryanheise/audio_service/blob/master/android/src/main/java/com/ryanheise/audioservice/AudioService.java
Reference another question: android 10 seek bar on notification
This only appears to happen to certain devices where on other devices the seek bar will display perfectly fine.
Additionally on the same device other media players have perfectly fine displaying seek bars, such as Youtube, Youtube Red, Google Play Music, etc.
Upvotes: 1
Views: 1322
Reputation: 51
I followed the hints reported in this bug report and I solved the problem. I successfully tested it on Samsung and Huawei devices with Android 10.
The trick is:
As per Google's Material Design guidelines, the small icon in the notification should be monochrome white, and have a transparent background. If you follow those guidelines, the slider displays correctly.
Some people report also that you have to set a non transparent color (like Color.BLACK
) using setColor()
method to make it work on some devices.
Upvotes: 5