MediaRouteChooserDialog
class MediaRouteChooserDialog : AppCompatDialog
| kotlin.Any | ||||
| ↳ | android.app.Dialog | |||
| ↳ | androidx.activity.ComponentDialog | |||
| ↳ | androidx.appcompat.app.AppCompatDialog | |||
| ↳ | androidx.mediarouter.app.MediaRouteChooserDialog |
This class implements the route chooser dialog for MediaRouter.
This dialog allows the user to choose a route that matches a given selector.
| See also | |
|---|---|
MediaRouteButton |
|
MediaRouteActionProvider |
Summary
Public constructors |
|---|
MediaRouteChooserDialog(context: Context) |
MediaRouteChooserDialog(context: Context, theme: Int) |
Public functions |
|
|---|---|
Unit |
dismiss() |
MediaRouteSelector |
Gets the media route selector for filtering the routes that the user can select. |
Unit |
|
Unit |
|
Boolean |
onFilterRoute(route: MediaRouter.RouteInfo)Returns true if the route should be included in the list. |
Unit |
onFilterRoutes(routes: (Mutable)List<MediaRouter.RouteInfo!>)Called to filter the set of routes that should be included in the list. |
Unit |
Refreshes the list of routes that are shown in the chooser dialog. |
Unit |
setRouteSelector(selector: MediaRouteSelector)Sets the media route selector for filtering the routes that the user can select. |
Unit |
setTitle(title: CharSequence?) |
Unit |
Inherited Constants |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public functions
getRouteSelector
fun getRouteSelector(): MediaRouteSelector
Gets the media route selector for filtering the routes that the user can select.
| Returns | |
|---|---|
MediaRouteSelector |
The selector, never null. |
onFilterRoute
fun onFilterRoute(route: MediaRouter.RouteInfo): Boolean
Returns true if the route should be included in the list.
The default implementation returns true for enabled non-default routes that match the selector. Subclasses can override this method to filter routes differently.
| Parameters | |
|---|---|
route: MediaRouter.RouteInfo |
The route to consider, never null. |
| Returns | |
|---|---|
Boolean |
True if the route should be included in the chooser dialog. |
onFilterRoutes
fun onFilterRoutes(routes: (Mutable)List<MediaRouter.RouteInfo!>): Unit
Called to filter the set of routes that should be included in the list.
The default implementation iterates over all routes in the provided list and removes those for which onFilterRoute returns false.
| Parameters | |
|---|---|
routes: (Mutable)List<MediaRouter.RouteInfo!> |
The list of routes to filter in-place, never null. |
refreshRoutes
fun refreshRoutes(): Unit
Refreshes the list of routes that are shown in the chooser dialog.
setRouteSelector
fun setRouteSelector(selector: MediaRouteSelector): Unit
Sets the media route selector for filtering the routes that the user can select.
| Parameters | |
|---|---|
selector: MediaRouteSelector |
The selector, must not be null. |