You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to disable next/prev slot reservation with setMediaButtonPreferences? #2976
I read the note that says setCustomLayout is deprecated, and tried to migrate to setMediaButtonPreferences, however the next/prev slot reservation appeared and I don't want it. It seems it's hardcoded if there is no next/prev button:
Could you provide more details on what you want to happen exactly? That is, which buttons do you want to show and where?
These slot reservation are used for compatibility with the older model only, and the idea is to just define your preferences in the new model without considering how exactly this compatibility layer is implemented. In theory, you shouldn't even need to know these constants exist or when they are set.
I'm sorry, but I still don't understand what you expect to happen exactly. If you want the button to disappear without being replaced by a custom button and without leaving an empty space, what else should be shown in the UI space instead?
Thanks for the clarification, I wasn't aware this is happening. This is an unusual UI decision by the system media notification and I guess the desired outcome is always to fill the remaining space with the seek bar if there is nothing else to fill the gap.
Will see how we can best implement that, but I guess we can remove the flag if there is no other custom button that can accidentally fill the slot.
if there is no other custom button that can accidentally fill the slot.
Do you mean SLOT_BACK/SLOT_NEXT or what exactly? Because with setCustomLayout() I have two SLOT_OVERFLOW buttons and I don't set the flag. So the end result is:
(no next button)
(next button)
that is what I want to achieve using the new API, and that is what is achieved if the flag is just never set by media3.
Thanks, I can definitely see the issue myself now and I still wonder why System UI does not extend the progress bar automatically to fill all the empty space. I'm no UX expert, but it doesn't look like this was ever intended as a design option.
And yes, you are right, we can probably just never set the flag for NEXT to achieve the desired result. Still need to handle the PREV flag in cases where this slot is meant to stay empty and overflow buttons are present
Activity
tonihei commentedon Jan 5, 2026
Could you provide more details on what you want to happen exactly? That is, which buttons do you want to show and where?
These slot reservation are used for compatibility with the older model only, and the idea is to just define your preferences in the new model without considering how exactly this compatibility layer is implemented. In theory, you shouldn't even need to know these constants exist or when they are set.
nift4 commentedon Jan 5, 2026
Well, it adds empty space to the notification if it's the first/last playlist item, and I want there to be no empty space.
I want the default prev/next buttons to show if it's possible to seek prev/next, and otherwise I want them to disappear without leaving empty space.
edit: I don't have custom buttons that go into these slots.
tonihei commentedon Jan 5, 2026
I'm sorry, but I still don't understand what you expect to happen exactly. If you want the button to disappear without being replaced by a custom button and without leaving an empty space, what else should be shown in the UI space instead?
nift4 commentedon Jan 5, 2026
If I use setCustomLayout(), the seekbar gets bigger to fill the empty space.
tonihei commentedon Jan 5, 2026
Thanks for the clarification, I wasn't aware this is happening. This is an unusual UI decision by the system media notification and I guess the desired outcome is always to fill the remaining space with the seek bar if there is nothing else to fill the gap.
Will see how we can best implement that, but I guess we can remove the flag if there is no other custom button that can accidentally fill the slot.
nift4 commentedon Jan 5, 2026
Do you mean SLOT_BACK/SLOT_NEXT or what exactly? Because with setCustomLayout() I have two SLOT_OVERFLOW buttons and I don't set the flag. So the end result is:
(no next button)
(next button)
that is what I want to achieve using the new API, and that is what is achieved if the flag is just never set by media3.
tonihei commentedon Jan 6, 2026
Thanks, I can definitely see the issue myself now and I still wonder why System UI does not extend the progress bar automatically to fill all the empty space. I'm no UX expert, but it doesn't look like this was ever intended as a design option.
And yes, you are right, we can probably just never set the flag for NEXT to achieve the desired result. Still need to handle the PREV flag in cases where this slot is meant to stay empty and overflow buttons are present
Remove unintended gaps in system notification
nift4 commentedon Jan 7, 2026
Thanks, it works!
Remove unintended gaps in system notification
Remove unintended gaps in system notification
Remove unintended gaps in system notification
Remove unintended gaps in system notification
Remove unintended gaps in system notification
Remove unintended gaps in system notification