-
Notifications
You must be signed in to change notification settings - Fork 399
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
Add seekNext and seekPrev commandbuttons to the Android 12 "Compact" notification by default #410
Labels
Comments
@tianyif Could you take a look and see if this is something we want to enable by default? |
I'm making a change to address this, which should be available in |
tof-tof
pushed a commit
that referenced
this issue
Jun 9, 2023
This change is for Android 12 and below, where the buttons are derived from the actions added with the notification. From Android 13 (https://developer.android.com/about/versions/13/behavior-changes-13#playback-controls), the system derives media controls from `PlaybackState` actions. When adding the actions onto the notification, the logic will iterate all the command buttons. The `COMMAND_KEY_CONPACT_VIEW_INDEX` extra will be checked for each button. If that extra is set for the three buttons on the compact view, then the customized buttons and their order will be used. Otherwise, the compact view will be "seekPrev" (if any), "play/pause" (if any), "seekNext" (if any) buttons (in such order). Issue: #410 PiperOrigin-RevId: 538797874
tof-tof
pushed a commit
that referenced
this issue
Jun 12, 2023
This change is for Android 12 and below, where the buttons are derived from the actions added with the notification. From Android 13 (https://developer.android.com/about/versions/13/behavior-changes-13#playback-controls), the system derives media controls from `PlaybackState` actions. When adding the actions onto the notification, the logic will iterate all the command buttons. The `COMMAND_KEY_CONPACT_VIEW_INDEX` extra will be checked for each button. If that extra is set for the three buttons on the compact view, then the customized buttons and their order will be used. Otherwise, the compact view will be "seekPrev" (if any), "play/pause" (if any), "seekNext" (if any) buttons (in such order). Issue: #410 PiperOrigin-RevId: 538797874 (cherry picked from commit 2e2f193)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently the "compact" notification in Android 12 using the DefaultMediaNotificationProvider shows only the Play/Pause button.
Our users frequently requested it contains the seek buttons as well, so we added them by assigning a
COMMAND_KEY_COMPACT_VIEW_INDEX
to them.I would propose that the seek buttons get this flag by default as it seems to be most common that the basic buttons of a media player are prev, play/pause, and next.
For reference our custom class:
The text was updated successfully, but these errors were encountered: