DefaultMediaNotificationProvider.Builder


class DefaultMediaNotificationProvider.Builder


A builder for DefaultMediaNotificationProvider instances.

Summary

Public constructors

Builder(context: Context!)

Creates a builder.

Public functions

DefaultMediaNotificationProvider!

Builds the DefaultMediaNotificationProvider.

DefaultMediaNotificationProvider.Builder!

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

DefaultMediaNotificationProvider.Builder!

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

Builder(context: Context!)

Creates a builder.

Parameters
context: Context!

Any Context.

Public functions

build

fun build(): DefaultMediaNotificationProvider!

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

setChannelId

@CanIgnoreReturnValue
fun setChannelId(channelId: String!): DefaultMediaNotificationProvider.Builder!

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

Parameters
channelId: String!

The channel ID.

setChannelName

@CanIgnoreReturnValue
fun setChannelName(channelNameResourceId: @StringRes Int): DefaultMediaNotificationProvider.Builder!

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
channelNameResourceId: @StringRes Int

The string resource ID with the channel name.

setNotificationId

@CanIgnoreReturnValue
fun setNotificationId(notificationId: Int): DefaultMediaNotificationProvider.Builder!

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

Overwrites anything set in setNotificationIdProvider.

Parameters
notificationId: Int

The notification ID.

setNotificationIdProvider

@CanIgnoreReturnValue
fun setNotificationIdProvider(
    notificationIdProvider: DefaultMediaNotificationProvider.NotificationIdProvider!
): DefaultMediaNotificationProvider.Builder!

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
notificationIdProvider: DefaultMediaNotificationProvider.NotificationIdProvider!

The notification ID provider.