MediaRouteControllerDialog


class MediaRouteControllerDialog : AlertDialog


This class implements the route controller dialog for MediaRouter.

This dialog allows the user to control or disconnect from the currently selected route.

Summary

Public constructors

Public functions

View?

Gets the media control view that was created by onCreateMediaControlView.

MediaSessionCompat.Token?

Gets the session to use for metadata and transport controls.

MediaRouter.RouteInfo

Gets the route that this dialog is controlling.

Boolean

Returns whether to enable the volume slider and volume control using the volume keys when the route supports it.

Unit
View?
onCreateMediaControlView(savedInstanceState: Bundle?)

Provides the subclass an opportunity to create a view that will replace the default media controls for the currently playing content.

Unit
Boolean
onKeyDown(keyCode: Int, event: KeyEvent)
Boolean
onKeyUp(keyCode: Int, event: KeyEvent)
Unit

Sets whether to enable the volume slider and volume control using the volume keys when the route supports it.

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.AlertDialog
Button!
getButton(whichButton: Int)

Gets one of the buttons used in the dialog.

ListView!

Gets the list view used in the dialog.

Unit
setButton(
    whichButton: Int,
    text: CharSequence!,
    listener: DialogInterface.OnClickListener!
)

Sets a listener to be invoked when the positive button of the dialog is pressed.

Unit
setButton(whichButton: Int, text: CharSequence!, msg: Message!)

Sets a message to be sent when a button is pressed.

Unit
setButton(
    whichButton: Int,
    text: CharSequence!,
    icon: Drawable!,
    listener: DialogInterface.OnClickListener!
)

Sets an icon to be displayed along with the button text and a listener to be invoked when the positive button of the dialog is pressed.

Unit
setCustomTitle(customTitleView: View!)

This method has no effect if called after show.

Unit
setIcon(icon: Drawable!)

Set the Drawable to be used in the title.

Unit
setIcon(resId: Int)

Set resId to 0 if you don't want an icon.

Unit

Sets an icon as supplied by a theme attribute. e.g. android.R.attr.alertDialogIcon

Unit

Sets the message to display.

Unit
Unit
setView(view: View!)

Set the view to display in the dialog.

Unit
setView(
    view: View!,
    viewSpacingLeft: Int,
    viewSpacingTop: Int,
    viewSpacingRight: Int,
    viewSpacingBottom: Int
)

Set the view to display in the dialog, specifying the spacing to appear around that view.

From androidx.appcompat.app.AppCompatDialog
Unit
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
Unit
setTitle(titleId: Int)
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
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 android.content.DialogInterface
abstract Unit
abstract 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

MediaRouteControllerDialog

Added in 1.1.0
MediaRouteControllerDialog(context: Context)

MediaRouteControllerDialog

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

Public functions

getMediaControlView

Added in 1.1.0
fun getMediaControlView(): View?

Gets the media control view that was created by onCreateMediaControlView.

Returns
View?

The media control view, or null if none.

getMediaSession

Added in 1.1.0
fun getMediaSession(): MediaSessionCompat.Token?

Gets the session to use for metadata and transport controls.

Returns
MediaSessionCompat.Token?

The token for the session to use or null if none.

getRoute

Added in 1.1.0
fun getRoute(): MediaRouter.RouteInfo

Gets the route that this dialog is controlling.

isVolumeControlEnabled

Added in 1.1.0
fun isVolumeControlEnabled(): Boolean

Returns whether to enable the volume slider and volume control using the volume keys when the route supports it.

onAttachedToWindow

fun onAttachedToWindow(): Unit

onCreateMediaControlView

Added in 1.1.0
fun onCreateMediaControlView(savedInstanceState: Bundle?): View?

Provides the subclass an opportunity to create a view that will replace the default media controls for the currently playing content.

Parameters
savedInstanceState: Bundle?

The dialog's saved instance state.

Returns
View?

The media control view, or null if none.

onDetachedFromWindow

fun onDetachedFromWindow(): Unit

onKeyDown

fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean

onKeyUp

fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean

setVolumeControlEnabled

Added in 1.1.0
fun setVolumeControlEnabled(enable: Boolean): Unit

Sets whether to enable the volume slider and volume control using the volume keys when the route supports it.

The default value is true.

Protected functions

onCreate

protected fun onCreate(savedInstanceState: Bundle?): Unit