MediaRouteChooserDialog
open class MediaRouteChooserDialog : AppCompatDialog
kotlin.Any | |||
↳ | android.app.Dialog | ||
↳ | 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.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
open MediaRouteSelector |
Gets the media route selector for filtering the routes that the user can select. |
open Unit | |
open Unit | |
open Boolean |
onFilterRoute(@NonNull route: MediaRouter.RouteInfo) Returns true if the route should be included in the list. |
open Unit |
onFilterRoutes(@NonNull routes: MutableList<MediaRouter.RouteInfo!>) Called to filter the set of routes that should be included in the list. |
open Unit |
Refreshes the list of routes that are shown in the chooser dialog. |
open Unit |
setRouteSelector(@NonNull selector: MediaRouteSelector) Sets the media route selector for filtering the routes that the user can select. |
open Unit |
setTitle(title: CharSequence?) |
open Unit |
Protected methods | |
---|---|
open Unit |
Inherited functions | |
---|---|
Public constructors
<init>
MediaRouteChooserDialog(context: Context!)
Public methods
getRouteSelector
@NonNull open fun getRouteSelector(): MediaRouteSelector
Gets the media route selector for filtering the routes that the user can select.
Return | |
---|---|
MediaRouteSelector |
The selector, never null. |
onAttachedToWindow
open fun onAttachedToWindow(): Unit
onDetachedFromWindow
open fun onDetachedFromWindow(): Unit
onFilterRoute
open fun onFilterRoute(@NonNull 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. |
Return | |
---|---|
Boolean |
True if the route should be included in the chooser dialog. |
onFilterRoutes
open fun onFilterRoutes(@NonNull routes: MutableList<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 |
MutableList<MediaRouter.RouteInfo!>: The list of routes to filter in-place, never null. |
refreshRoutes
open fun refreshRoutes(): Unit
Refreshes the list of routes that are shown in the chooser dialog.
setRouteSelector
open fun setRouteSelector(@NonNull 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. |
setTitle
open fun setTitle(title: CharSequence?): Unit