Package com.jwplayer.pub.api.background
Class NotificationButton.Builder
java.lang.Object
com.jwplayer.pub.api.background.NotificationButton.Builder
- Enclosing class:
- NotificationButton
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()compactViewIndex(int index) Position (0 to 2) in the collapsed notification, orNotificationButton.COMPACT_VIEW_NONE(the default).enabled(boolean enabled) A disabled button keeps its place in the notification but does nothing when tapped.inCompactView(boolean inCompactView) Shorthand forcompactViewIndex(inCompactView ? 0 : COMPACT_VIEW_NONE).placement(int placement) Where the system media controls should put the button:NotificationButton.PLACEMENT_OVERFLOW(the default),NotificationButton.PLACEMENT_BACKorNotificationButton.PLACEMENT_FORWARD.
-
Constructor Details
-
Builder
- Parameters:
id- passed back on a tap; unique within the listiconResId- a drawable resource (vector or bitmap)title- the label, used for accessibility and wherever the system shows text- Throws:
IllegalArgumentException- ifidortitleis null oriconResIdis 0
-
-
Method Details
-
enabled
A disabled button keeps its place in the notification but does nothing when tapped. Android 13+ system media controls do not show it. Defaulttrue. -
compactViewIndex
Position (0 to 2) in the collapsed notification, orNotificationButton.COMPACT_VIEW_NONE(the default). For lists built with this class, play/pause always stays in the collapsed notification (it is added if the list has none). A legacyaddNotificationActions/getCompactActionslist is rendered as given. Ignored by Android 13+ system media controls. -
inCompactView
Shorthand forcompactViewIndex(inCompactView ? 0 : COMPACT_VIEW_NONE). -
placement
Where the system media controls should put the button:NotificationButton.PLACEMENT_OVERFLOW(the default),NotificationButton.PLACEMENT_BACKorNotificationButton.PLACEMENT_FORWARD. A hint; the notification itself shows buttons in list order. -
build
-