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(Creates a builder for a track selection dialog. |
TrackSelectionDialogBuilder(Creates a builder for a track selection dialog. |
Public functions |
|
|---|---|
Dialog! |
build()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! |
setOverride(override: TrackSelectionOverride?)Sets the single initial override. |
TrackSelectionDialogBuilder! |
setOverrides(Sets the initial track overrides. |
TrackSelectionDialogBuilder! |
setShowDisableOption(showDisableOption: Boolean)Sets whether an option is available for disabling the renderer. |
TrackSelectionDialogBuilder! |
Sets the resource ID of the theme used to inflate this dialog. |
Unit |
setTrackFormatComparator(trackFormatComparator: Comparator<Format!>?)Sets a |
TrackSelectionDialogBuilder! |
setTrackNameProvider(trackNameProvider: TrackNameProvider?)Sets the |
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 |
@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 |
callback: TrackSelectionDialogBuilder.DialogCallback! |
The |
Public functions
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 |
| 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.
| 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 |
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 |