A builder for creating an instance of NotificationOptions.
|
Builder()
|
| NotificationOptions |
build()
Builds and returns the
NotificationOptions object.
|
| NotificationOptions.Builder |
setActions(List<String> actions,
int[] compatActionIndices)
Sets at most 5 actions to show in the notification, and the indices to the
actions to show in the compact view.
|
| NotificationOptions.Builder |
setDisconnectDrawableResId(int resId)
Sets the resource ID of the icon that indicates "disconnect".
|
| NotificationOptions.Builder |
setForward10DrawableResId(int resId)
Sets the resource ID of the icon that indicates "skip forward 10 seconds".
|
| NotificationOptions.Builder |
setForward30DrawableResId(int resId)
Sets the resource ID of the icon that indicates "skip forward 30 seconds".
|
| NotificationOptions.Builder |
setForwardDrawableResId(int resId)
Sets the resource ID of the icon that indicates "skip forward".
|
| NotificationOptions.Builder |
setNotificationActionsProvider(NotificationActionsProvider
notificationActionsProvider)
Sets a
NotificationActionsProvider, which can be subclassed to provide
dynamic custom actions.
|
| NotificationOptions.Builder |
setPauseDrawableResId(int resId)
Sets the resource ID of the icon that indicates "pause".
|
| NotificationOptions.Builder |
setPlayDrawableResId(int resId)
Sets the resource ID of the icon that indicates "play".
|
| NotificationOptions.Builder |
setRewind10DrawableResId(int resId)
Sets the resource ID of the icon that indicates "rewind 10 seconds".
|
| NotificationOptions.Builder |
setRewind30DrawableResId(int resId)
Sets the resource ID of the icon that indicates "rewind 30 seconds".
|
| NotificationOptions.Builder |
setRewindDrawableResId(int resId)
Sets the resource ID of the icon that indicates "rewind".
|
| NotificationOptions.Builder |
setSkipNextDrawableResId(int resId)
Sets the resource ID of the icon that indicates "skip next".
|
| NotificationOptions.Builder |
setSkipPrevDrawableResId(int resId)
Sets the resource ID of the icon that indicates "skip previous".
|
| NotificationOptions.Builder |
setSkipStepMs(long notificationSkipStepMs)
Sets the amount to jump if
MediaIntentReceiver.ACTION_FORWARD or
MediaIntentReceiver.ACTION_REWIND are included for the notification
actions.
|
| NotificationOptions.Builder |
setSkipToNextSlotReserved(boolean skipToNextSlotReserved)
Sets
true to reserve the slot of skip-to-next action for Android T
or above.
|
| NotificationOptions.Builder |
setSkipToPrevSlotReserved(boolean skipToPrevSlotReserved)
Sets
true to reserve the slot of skip-to-previous action for
Android T or above.
|
| NotificationOptions.Builder |
setSmallIconDrawableResId(int resId)
Sets the resource ID for the notification icon drawable.
|
| NotificationOptions.Builder |
setStopLiveStreamDrawableResId(int resId)
Sets the resource ID of the icon that indicates "stop playing live stream".
|
| NotificationOptions.Builder |
setTargetActivityClassName(String className)
Sets the name of the
Activity
that will be launched when user taps on the content area of the notification.
|
Builds and returns the
NotificationOptions object.
Sets at most 5 actions to show in the notification, and the indices to the actions
to show in the compact view. If both actions and
compatActionIndices are null, the default values,
MediaIntentReceiver.ACTION_TOGGLE_PLAYBACK and
MediaIntentReceiver.ACTION_STOP_CASTING will be used.
The list of actions that can be set through this method is defined in
MediaIntentReceiver. To provide a dynamic custom action, set a
NotificationActionsProvider using the
setNotificationActionsProvider(NotificationActionsProvider) method below. If
a
NotificationActionsProvider is set, the SDK will use it to get the list of
actions and the indices that should appear in the compact view, instead of the values
provided here. See
NotificationActionsProvider for how to implement dynamic custom actions.
| actions | The list of actions, defined in
MediaIntentReceiver. |
|---|---|
| compatActionIndices | Indices of the actions in the actions list, which will be shown in
the compact view. |
| IllegalArgumentException | If actions and compatActionIndices are not either
both null or non-null, or if the length of
compatActionIndices is greater than the size of actions,
or if any index in compatActionIndices is out of range. |
|---|
Sets the resource ID of the icon that indicates "disconnect". By default, a drawable
ic_notification_disconnect.xml from the SDK is used.
Sets the resource ID of the icon that indicates "skip forward 10 seconds". By
default, a drawable ic_notification_forward10.xml from the SDK is
used.
Sets the resource ID of the icon that indicates "skip forward 30 seconds". By
default, a drawable ic_notification_forward30.xml from the SDK is
used.
Sets the resource ID of the icon that indicates "skip forward". By default, a
drawable ic_notification_forward.xml from the SDK is used.
Sets a
NotificationActionsProvider, which can be subclassed to provide dynamic
custom actions. If set, the SDK will use it to get the list of actions and the indices
that should appear in the compact view. If not set, the SDK will use the value provided
by the call to
setActions(List, int[]).
See
MediaIntentReceiver for a list of predefined actions that you can use to
implement your
NotificationActionsProvider. See
NotificationActionsProvider for how to implement custom actions.
| notificationActionsProvider | The
NotificationActionsProvider that provides the list of
NotificationAction that should appear in the expanded view and indices
of actions that should appear in the compact view. |
|---|
| IllegalArgumentException | If notificationActionsProvider is null. |
|---|
Sets the resource ID of the icon that indicates "pause". By default, a drawable
ic_notification_pause.xml from the SDK is used.
Sets the resource ID of the icon that indicates "play". By default, a drawable
ic_notification_play.xml from the SDK is used.
Sets the resource ID of the icon that indicates "rewind 10 seconds". By default, a
drawable ic_notification_rewind10.xml from the SDK is used.
Sets the resource ID of the icon that indicates "rewind 30 seconds". By default, a
drawable ic_notification_rewind30.xml from the SDK is used.
Sets the resource ID of the icon that indicates "rewind". By default, a drawable
ic_notification_rewind.xml from the SDK is used.
Sets the resource ID of the icon that indicates "skip next". By default, a drawable
ic_notification_skip_next.xml from the SDK is used.
Sets the resource ID of the icon that indicates "skip previous". By default, a
drawable ic_notification_skip_prev.xml from the SDK is used.
Sets the amount to jump if
MediaIntentReceiver.ACTION_FORWARD or
MediaIntentReceiver.ACTION_REWIND are included for the notification actions.
Any tap on those actions will result in moving the media position forward or backward
by notificationSkipStepMs milliseconds. The default value is
NotificationOptions.SKIP_STEP_TEN_SECONDS_IN_MS.
| notificationSkipStepMs | The amount of time to skip, in milliseconds. |
|---|
| IllegalArgumentException | if notificationSkipStepMs is not positive. |
|---|
Sets true to reserve the slot of skip-to-next action for Android T or
above.
| skipToNextSlotReserved | if the slot of skip-to-next action is reserved |
|---|
Sets true to reserve the slot of skip-to-previous action for Android T
or above.
| skipToPrevSlotReserved | if the slot of skip-to-previous action is reserved |
|---|
Sets the resource ID for the notification icon drawable. By default, a drawable
ic_notification_small_icon.xml from the SDK is used.
Sets the resource ID of the icon that indicates "stop playing live stream". By
default, a drawable ic_notification_stop_live_stream.xml from the SDK is
used.