TrackSelectionView
@UnstableApi
class TrackSelectionView : LinearLayout
| kotlin.Any | ||||
| ↳ | android.view.View | |||
| ↳ | android.view.ViewGroup | |||
| ↳ | android.widget.LinearLayout | |||
| ↳ | androidx.media3.ui.TrackSelectionView |
A view for making track selections.
Summary
Nested types |
|---|
|
Listener for changes to the selected tracks. |
Public constructors |
|---|
TrackSelectionView(context: Context!)Creates a track selection view. |
TrackSelectionView(context: Context!, attrs: AttributeSet?)Creates a track selection view. |
TrackSelectionView(Creates a track selection view. |
Public functions |
|
|---|---|
java-static (Mutable)Map<TrackGroup!, TrackSelectionOverride!>! |
filterOverrides(Returns the subset of |
Unit |
init(Initialize the view to select tracks from a specified list of track groups. |
Unit |
setAllowAdaptiveSelections(allowAdaptiveSelections: Boolean)Sets whether adaptive selections (consisting of more than one track) can be made using this selection view. |
Unit |
setAllowMultipleOverrides(allowMultipleOverrides: Boolean)Sets whether tracks from multiple track groups can be selected. |
Unit |
setShowDisableOption(showDisableOption: Boolean)Sets whether the disabled option can be selected. |
Unit |
setTrackNameProvider(trackNameProvider: TrackNameProvider!)Sets the |
Public properties |
|
|---|---|
Boolean |
|
(Mutable)Map<TrackGroup!, TrackSelectionOverride!>! |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
TrackSelectionView
TrackSelectionView(context: Context!, attrs: AttributeSet?)
Creates a track selection view.
TrackSelectionView
TrackSelectionView(
context: Context!,
attrs: AttributeSet?,
defStyleAttr: @AttrRes Int
)
Creates a track selection view.
Public functions
filterOverrides
java-static fun filterOverrides(
overrides: (Mutable)Map<TrackGroup!, TrackSelectionOverride!>!,
trackGroups: (Mutable)List<Tracks.Group!>!,
allowMultipleOverrides: Boolean
): (Mutable)Map<TrackGroup!, TrackSelectionOverride!>!
Returns the subset of overrides that apply to the specified trackGroups. If allowMultipleOverrides is then at most one override is retained, which will be the one whose track group is first in trackGroups.
| Parameters | |
|---|---|
overrides: (Mutable)Map<TrackGroup!, TrackSelectionOverride!>! |
The overrides to filter. |
trackGroups: (Mutable)List<Tracks.Group!>! |
The track groups whose overrides should be retained. |
allowMultipleOverrides: Boolean |
Whether more than one override can be retained. |
| Returns | |
|---|---|
(Mutable)Map<TrackGroup!, TrackSelectionOverride!>! |
The filtered overrides. |
init
fun init(
trackGroups: (Mutable)List<Tracks.Group!>!,
isDisabled: Boolean,
overrides: (Mutable)Map<TrackGroup!, TrackSelectionOverride!>!,
trackFormatComparator: Comparator<Format!>?,
listener: TrackSelectionView.TrackSelectionListener?
): Unit
Initialize the view to select tracks from a specified list of track groups.
| Parameters | |
|---|---|
trackGroups: (Mutable)List<Tracks.Group!>! |
The |
isDisabled: Boolean |
Whether the disabled option should be initially selected. |
overrides: (Mutable)Map<TrackGroup!, TrackSelectionOverride!>! |
The initially selected track overrides. Any overrides that do not correspond to track groups in |
trackFormatComparator: Comparator<Format!>? |
An optional comparator used to determine the display order of the tracks within each track group. |
listener: TrackSelectionView.TrackSelectionListener? |
An optional listener to receive selection updates. |
setAllowAdaptiveSelections
fun setAllowAdaptiveSelections(allowAdaptiveSelections: Boolean): Unit
Sets whether adaptive selections (consisting of more than one track) can be made using this selection view.
For the 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. |
setAllowMultipleOverrides
fun setAllowMultipleOverrides(allowMultipleOverrides: Boolean): Unit
Sets whether tracks from multiple track groups can be selected. This results in multiple TrackSelectionOverrides being returned by getOverrides.
| Parameters | |
|---|---|
allowMultipleOverrides: Boolean |
Whether tracks from multiple track groups can be selected. |
setShowDisableOption
fun setShowDisableOption(showDisableOption: Boolean): Unit
Sets whether the disabled option can be selected.
| Parameters | |
|---|---|
showDisableOption: Boolean |
Whether the disabled option can be selected. |
setTrackNameProvider
fun setTrackNameProvider(trackNameProvider: TrackNameProvider!): Unit
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 |