DefaultMediaNotificationProvider.Builder


public final class DefaultMediaNotificationProvider.Builder


A builder for DefaultMediaNotificationProvider instances.

Summary

Public constructors

Builder(Context context)

Creates a builder.

Public methods

DefaultMediaNotificationProvider

Builds the DefaultMediaNotificationProvider.

DefaultMediaNotificationProvider.Builder

Sets the ID of the NotificationChannel on which created notifications are posted on.

DefaultMediaNotificationProvider.Builder
@CanIgnoreReturnValue
setChannelName(@StringRes int channelNameResourceId)

Sets the name of the NotificationChannel on which created notifications are posted on.

DefaultMediaNotificationProvider.Builder

Sets the notificationId used for the created notifications.

DefaultMediaNotificationProvider.Builder

Sets the provider for the notificationId used for the created notifications.

Public constructors

Builder

public Builder(Context context)

Creates a builder.

Parameters
Context context

Any Context.

Public methods

build

public DefaultMediaNotificationProvider build()

Builds the DefaultMediaNotificationProvider. The method can be called at most once.

setChannelId

@CanIgnoreReturnValue
public DefaultMediaNotificationProvider.Builder setChannelId(String channelId)

Sets the ID of the NotificationChannel on which created notifications are posted on. By default, this is set to DEFAULT_CHANNEL_ID.

Parameters
String channelId

The channel ID.

setChannelName

@CanIgnoreReturnValue
public DefaultMediaNotificationProvider.Builder setChannelName(@StringRes int channelNameResourceId)

Sets the name of the NotificationChannel on which created notifications are posted on. By default, this is set to DEFAULT_CHANNEL_NAME_RESOURCE_ID.

Parameters
@StringRes int channelNameResourceId

The string resource ID with the channel name.

setNotificationId

@CanIgnoreReturnValue
public DefaultMediaNotificationProvider.Builder setNotificationId(int notificationId)

Sets the notificationId used for the created notifications. By default, this is set to DEFAULT_NOTIFICATION_ID.

Overwrites anything set in setNotificationIdProvider.

Parameters
int notificationId

The notification ID.

setNotificationIdProvider

@CanIgnoreReturnValue
public DefaultMediaNotificationProvider.Builder setNotificationIdProvider(
    DefaultMediaNotificationProvider.NotificationIdProvider notificationIdProvider
)

Sets the provider for the notificationId used for the created notifications. By default, this is set to a provider that always returns DEFAULT_NOTIFICATION_ID.

Overwrites anything set in setNotificationId.

Parameters
DefaultMediaNotificationProvider.NotificationIdProvider notificationIdProvider

The notification ID provider.