java.lang.Object | |
↳ | com.google.android.gms.cast.framework.media.NotificationOptions.Builder |
A builder for creating an instance of NotificationOptions
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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.
| |||||||||||
Sets the resource ID of the icon that indicates "disconnect".
| |||||||||||
Sets the resource ID of the icon that indicates "skip forward 10 seconds".
| |||||||||||
Sets the resource ID of the icon that indicates "skip forward 30 seconds".
| |||||||||||
Sets the resource ID of the icon that indicates "skip forward".
| |||||||||||
Sets a
NotificationActionsProvider , which can be subclassed to provide dynamic custom
actions. | |||||||||||
Sets the resource ID of the icon that indicates "pause".
| |||||||||||
Sets the resource ID of the icon that indicates "play".
| |||||||||||
Sets the resource ID of the icon that indicates "rewind 10 seconds".
| |||||||||||
Sets the resource ID of the icon that indicates "rewind 30 seconds".
| |||||||||||
Sets the resource ID of the icon that indicates "rewind".
| |||||||||||
Sets the resource ID of the icon that indicates "skip next".
| |||||||||||
Sets the resource ID of the icon that indicates "skip previous".
| |||||||||||
Sets the amount to jump if
ACTION_FORWARD or ACTION_REWIND are included for the notification actions. | |||||||||||
Sets the resource ID for the notification icon drawable.
| |||||||||||
Sets the resource ID of the icon that indicates "stop playing live stream".
| |||||||||||
Sets the name of the
Activity that will be launched when user taps on the content
area of the notification. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Builds and returns the NotificationOptions
object.
Returns | |
---|---|
NotificationOptions |
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, ACTION_TOGGLE_PLAYBACK
and 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.
Parameters | |
---|---|
actions |
List : The list of actions, defined in MediaIntentReceiver . |
compatActionIndices |
int : Indices of the actions in the actions list, which will be
shown in the compact view. |
Returns | |
---|---|
NotificationOptions.Builder |
Throws | |
---|---|
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. |
See also:
Sets the resource ID of the icon that indicates "disconnect". By default, a drawable ic_notification_disconnect.xml
from the SDK is used.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
Sets the resource ID of the icon that indicates "skip forward". By default, a drawable ic_notification_forward.xml
from the SDK is used.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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
.
See MediaIntentReceiver
for a list of predefined actions that you can use to
implement your NotificationActionsProvider
. See NotificationActionsProvider
for how to implement custom actions.
Parameters | |
---|---|
notificationActionsProvider |
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. |
Returns | |
---|---|
NotificationOptions.Builder |
Throws | |
---|---|
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
Sets the resource ID of the icon that indicates "play". By default, a drawable ic_notification_play.xml
from the SDK is used.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
Sets the resource ID of the icon that indicates "rewind". By default, a drawable ic_notification_rewind.xml
from the SDK is used.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
Sets the amount to jump if ACTION_FORWARD
or 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 SKIP_STEP_TEN_SECONDS_IN_MS
.
Parameters | |
---|---|
notificationSkipStepMs |
long : The amount of time to skip, in milliseconds. |
Returns | |
---|---|
NotificationOptions.Builder |
Throws | |
---|---|
IllegalArgumentException |
if notificationSkipStepMs is not positive.
|
Sets the resource ID for the notification icon drawable. By default, a drawable ic_notification_small_icon.xml
from the SDK is used.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
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.
Parameters | |
---|---|
resId |
int |
Returns | |
---|---|
NotificationOptions.Builder |
Sets the name of the Activity
that will be launched when user taps on the content
area of the notification. If set to null
then clicking on the content area will not
launch any Activity
. The default value is null
.
Parameters | |
---|---|
className |
String |
Returns | |
---|---|
NotificationOptions.Builder |