tanguyantoine / react-native-music-control

Display and manage media controls on lock screen and notification center for iOS and Android.
https://www.npmjs.com/package/react-native-music-control
MIT License
697 stars 264 forks source link

[Android] Customizing notification icons in compact view #384

Closed armaanshah96 closed 3 years ago

armaanshah96 commented 3 years ago

Description

Hi,

I noticed that a PR was recently merged to add ACTION_FAST_FORWARD and ACTION_REWIND to the compact notification screen on Android which is great! On my current project I'd like to go one step further and be able to customize which notification icons of the ones enabled I'd like to present in the compact view.

I currently enableControl for:

In the full expanded view, I see what I expect, which is (in order):

However in the compact view, I see:

I believe this is because Android limits the number of controls available in the compact view to 3 (based on the docs I've seen at least). I would like to replace "stop" with "skipForward" in the compact view.

Goal: I want to specify which 3 controls are visible in compact view

Proposal: Adding functionality on enableControl to take a new options key compactView with a boolean value. This boolean would be used to collect which actions should be enabled in compact view when running setShowActionsInCompactView in MusicControlModule in Android. Alternatively, a custom function like setCompactViewActions that takes a list of actions might work as well.

I'm new to this library, so might be missing some considerations (or if this is possible already I may have just missed it ). Thoughts on this feature?

Platform ?

bradfloodx commented 3 years ago

Sounds good @armaanshah96 :)

bradfloodx commented 3 years ago

On @armaanshah96 's todo list :)

armaanshah96 commented 3 years ago

yup noted, apologies, been struggling to find time recently

bradfloodx commented 3 years ago

You and me both haha :)