TrackSelectionDialogBuilder


@UnstableApi
class TrackSelectionDialogBuilder


Builder for a dialog with a TrackSelectionView.

Summary

Nested types

Callback which is invoked when a track selection has been made.

Public constructors

TrackSelectionDialogBuilder(
    context: Context!,
    title: CharSequence!,
    player: Player!,
    @C.TrackType trackType: Int
)

Creates a builder for a track selection dialog.

TrackSelectionDialogBuilder(
    context: Context!,
    title: CharSequence!,
    trackGroups: (Mutable)List<Tracks.Group!>!,
    callback: TrackSelectionDialogBuilder.DialogCallback!
)

Creates a builder for a track selection dialog.

Public functions

Dialog!

Builds the dialog.

TrackSelectionDialogBuilder!
setAllowAdaptiveSelections(allowAdaptiveSelections: Boolean)

Sets whether adaptive selections (consisting of more than one track) can be made.

TrackSelectionDialogBuilder!
setAllowMultipleOverrides(allowMultipleOverrides: Boolean)

Sets whether multiple overrides can be set and selected, i.e. tracks from multiple track groups can be selected.

TrackSelectionDialogBuilder!
setIsDisabled(isDisabled: Boolean)

Sets whether the selection is initially shown as disabled.

TrackSelectionDialogBuilder!

Sets the single initial override.

TrackSelectionDialogBuilder!

Sets the initial track overrides.

TrackSelectionDialogBuilder!
setShowDisableOption(showDisableOption: Boolean)

Sets whether an option is available for disabling the renderer.

TrackSelectionDialogBuilder!
setTheme(themeResId: @StyleRes Int)

Sets the resource ID of the theme used to inflate this dialog.

Unit
setTrackFormatComparator(trackFormatComparator: Comparator<Format!>?)

Sets a Comparator used to determine the display order of the tracks within each track group.

TrackSelectionDialogBuilder!

Sets the TrackNameProvider used to generate the user visible name of each track and updates the view with track names queried from the specified provider.

Public constructors

TrackSelectionDialogBuilder

TrackSelectionDialogBuilder(
    context: Context!,
    title: CharSequence!,
    player: Player!,
    @C.TrackType trackType: Int
)

Creates a builder for a track selection dialog.

Parameters
context: Context!

The context of the dialog.

title: CharSequence!

The title of the dialog.

player: Player!

The Player whose tracks should be selected.

@C.TrackType trackType: Int

The type of tracks to show for selection.

TrackSelectionDialogBuilder

TrackSelectionDialogBuilder(
    context: Context!,
    title: CharSequence!,
    trackGroups: (Mutable)List<Tracks.Group!>!,
    callback: TrackSelectionDialogBuilder.DialogCallback!
)

Creates a builder for a track selection dialog.

Parameters
context: Context!

The context of the dialog.

title: CharSequence!

The title of the dialog.

trackGroups: (Mutable)List<Tracks.Group!>!

The track groups.

callback: TrackSelectionDialogBuilder.DialogCallback!

The DialogCallback invoked when a track selection has been made.

Public functions

build

fun build(): Dialog!

Builds the dialog.

setAllowAdaptiveSelections

fun setAllowAdaptiveSelections(allowAdaptiveSelections: Boolean): TrackSelectionDialogBuilder!

Sets whether adaptive selections (consisting of more than one track) can be made.

For the selection view to enable adaptive selection it is necessary both for this feature to be enabled, and for the target renderer to support adaptation between the available tracks.

Parameters
allowAdaptiveSelections: Boolean

Whether adaptive selection is enabled.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setAllowMultipleOverrides

fun setAllowMultipleOverrides(allowMultipleOverrides: Boolean): TrackSelectionDialogBuilder!

Sets whether multiple overrides can be set and selected, i.e. tracks from multiple track groups can be selected.

Parameters
allowMultipleOverrides: Boolean

Whether multiple track selection overrides are allowed.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setIsDisabled

fun setIsDisabled(isDisabled: Boolean): TrackSelectionDialogBuilder!

Sets whether the selection is initially shown as disabled.

Parameters
isDisabled: Boolean

Whether the selection is initially shown as disabled.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setOverride

fun setOverride(override: TrackSelectionOverride?): TrackSelectionDialogBuilder!

Sets the single initial override.

Parameters
override: TrackSelectionOverride?

The initial override, or null for no override.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setOverrides

fun setOverrides(
    overrides: (Mutable)Map<TrackGroup!, TrackSelectionOverride!>!
): TrackSelectionDialogBuilder!

Sets the initial track overrides. Any overrides that do not correspond to track groups that were passed to the constructor will be ignored. If setAllowMultipleOverrides hasn't been set to true then all but one override will be ignored. The retained override will be the one whose track group was first in the list of track groups passed to the constructor.

Parameters
overrides: (Mutable)Map<TrackGroup!, TrackSelectionOverride!>!

The initially selected track overrides.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setShowDisableOption

fun setShowDisableOption(showDisableOption: Boolean): TrackSelectionDialogBuilder!

Sets whether an option is available for disabling the renderer.

Parameters
showDisableOption: Boolean

Whether the disable option is shown.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setTheme

fun setTheme(themeResId: @StyleRes Int): TrackSelectionDialogBuilder!

Sets the resource ID of the theme used to inflate this dialog.

Parameters
themeResId: @StyleRes Int

The resource ID of the theme.

Returns
TrackSelectionDialogBuilder!

This builder, for convenience.

setTrackFormatComparator

fun setTrackFormatComparator(trackFormatComparator: Comparator<Format!>?): Unit

Sets a Comparator used to determine the display order of the tracks within each track group.

Parameters
trackFormatComparator: Comparator<Format!>?

The comparator, or null to use the original order.

setTrackNameProvider

fun setTrackNameProvider(trackNameProvider: TrackNameProvider?): TrackSelectionDialogBuilder!

Sets the TrackNameProvider used to generate the user visible name of each track and updates the view with track names queried from the specified provider.

Parameters
trackNameProvider: TrackNameProvider?

The TrackNameProvider to use, or null to use the default.