MediaRouteChooserDialog


class MediaRouteChooserDialog : AppCompatDialog


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

MediaRouteChooserDialog(context: Context, theme: Int)

Public functions

Unit
MediaRouteSelector

Gets the media route selector for filtering the routes that the user can select.

Unit
Unit
Boolean

Returns true if the route should be included in the list.

Unit

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

Sets the media route selector for filtering the routes that the user can select.

Unit
Unit
setTitle(titleId: Int)

Protected functions

Unit
onCreate(savedInstanceState: Bundle?)

Inherited Constants

From android.content.DialogInterface
const Int
BUTTON1 = -1

This property is deprecated.

const Int
BUTTON2 = -2

This property is deprecated.

const Int
BUTTON3 = -3

This property is deprecated.

const Int
const Int
const Int

Inherited functions

From androidx.appcompat.app.AppCompatDialog
Unit
Boolean
T?
<T : View?> findViewById(id: @IdRes Int)
AppCompatDelegate
ActionBar!

Support library version of getActionBar.

Unit
Unit

Called when a support action mode has finished.

Unit

Called when a support action mode has been started.

ActionMode?

Called when a support action mode is being started for this window.

Unit
setContentView(layoutResID: @LayoutRes Int)
Unit
Unit
Boolean

Enable extended support library window features.

From androidx.activity.ComponentDialog
Unit
Lifecycle!
SavedStateRegistry!
Unit

Sets the view tree owners before setting the content view so that the inflation process and attach listeners will see them already present.

Unit

This function is deprecated.

Unit
onCreate(savedInstanceState: Bundle!)
Bundle!
Unit
Unit
Unit
setContentView(layoutResID: Int)
From android.app.Dialog
Unit
Unit
Unit
Unit
Unit
Boolean
Boolean
Boolean
Boolean
Boolean
Boolean
T!
<T : View?> findViewById(id: Int)
ActionBar!
Context!
View!
LayoutInflater!
OnBackInvokedDispatcher!
Activity!
SearchEvent!
Int
Window!
Unit
Unit
Boolean
Unit
Unit
Unit

This function is deprecated.

Unit
Boolean
Unit
Unit
onCreate(savedInstanceState: Bundle!)
Unit
onCreateContextMenu(
    menu: ContextMenu!,
    v: View!,
    menuInfo: ContextMenu.ContextMenuInfo!
)
Boolean
Boolean
onCreatePanelMenu(featureId: Int, menu: Menu!)
View!
onCreatePanelView(featureId: Int)
Boolean
Boolean
onKeyDown(keyCode: Int, event: KeyEvent!)
Boolean
onKeyLongPress(keyCode: Int, event: KeyEvent!)
Boolean
onKeyMultiple(keyCode: Int, repeatCount: Int, event: KeyEvent!)
Boolean
onKeyShortcut(keyCode: Int, event: KeyEvent!)
Boolean
onKeyUp(keyCode: Int, event: KeyEvent!)
Boolean
onMenuItemSelected(featureId: Int, item: MenuItem!)
Boolean
onMenuOpened(featureId: Int, menu: Menu!)
Boolean
Unit
Unit
onPanelClosed(featureId: Int, menu: Menu!)
Boolean
Boolean
onPreparePanel(featureId: Int, view: View!, menu: Menu!)
Unit
onRestoreInstanceState(savedInstanceState: Bundle!)
Bundle!
Boolean
Unit
Unit
Boolean
Boolean
Unit
Unit
ActionMode!
Unit
Unit
Unit
Boolean
T!
<T : View?> requireViewById(id: Int)
Unit
Unit
Unit
Unit
setContentView(layoutResID: Int)
Unit
Unit
setFeatureDrawable(featureId: Int, drawable: Drawable!)
Unit
setFeatureDrawableAlpha(featureId: Int, alpha: Int)
Unit
setFeatureDrawableResource(featureId: Int, resId: Int)
Unit
setFeatureDrawableUri(featureId: Int, uri: Uri!)
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
Unit
From androidx.lifecycle.LifecycleOwner
abstract Lifecycle!
From androidx.savedstate.SavedStateRegistryOwner
From android.view.Window.Callback
Unit
Unit
onProvideKeyboardShortcuts(
    data: (Mutable)List<KeyboardShortcutGroup!>!,
    menu: Menu!,
    deviceId: Int
)

Inherited properties

From androidx.activity.ComponentDialog
OnBackPressedDispatcher!

The OnBackPressedDispatcher that should handle the system back button.

Public constructors

MediaRouteChooserDialog

Added in 1.1.0
MediaRouteChooserDialog(context: Context)

MediaRouteChooserDialog

Added in 1.1.0
MediaRouteChooserDialog(context: Context, theme: Int)

Public functions

dismiss

fun dismiss(): Unit

getRouteSelector

Added in 1.1.0
fun getRouteSelector(): MediaRouteSelector

Gets the media route selector for filtering the routes that the user can select.

Returns
MediaRouteSelector

The selector, never null.

onAttachedToWindow

fun onAttachedToWindow(): Unit

onDetachedFromWindow

fun onDetachedFromWindow(): Unit

onFilterRoute

Added in 1.1.0
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

Added in 1.1.0
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

Added in 1.1.0
fun refreshRoutes(): Unit

Refreshes the list of routes that are shown in the chooser dialog.

setRouteSelector

Added in 1.1.0
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.

setTitle

fun setTitle(title: CharSequence?): Unit

setTitle

fun setTitle(titleId: Int): Unit

Protected functions

onCreate

protected fun onCreate(savedInstanceState: Bundle?): Unit