public
class
MediaRouteControllerDialog
extends AlertDialog
| java.lang.Object | ||||
| ↳ | android.app.Dialog | |||
| ↳ | android.support.v7.app.AppCompatDialog | |||
| ↳ | android.support.v7.app.AlertDialog | |||
| ↳ | android.support.v7.app.MediaRouteControllerDialog | |||
This class implements the route controller dialog for MediaRouter.
This dialog allows the user to control or disconnect from the currently selected route.
See also:
Inherited constants |
|---|
android.content.DialogInterface
|
Public constructors | |
|---|---|
MediaRouteControllerDialog(Context context)
|
|
MediaRouteControllerDialog(Context context, int theme)
|
|
Public methods | |
|---|---|
View
|
getMediaControlView()
Gets the media control view that was created by |
MediaSessionCompat.Token
|
getMediaSession()
Gets the session to use for metadata and transport controls. |
MediaRouter.RouteInfo
|
getRoute()
Gets the route that this dialog is controlling. |
boolean
|
isVolumeControlEnabled()
Returns whether to enable the volume slider and volume control using the volume keys when the route supports it. |
void
|
onAttachedToWindow()
Called when the window has been attached to the window manager. |
View
|
onCreateMediaControlView(Bundle savedInstanceState)
Provides the subclass an opportunity to create a view that will replace the default media controls for the currently playing content. |
void
|
onDetachedFromWindow()
Called when the window has been attached to the window manager. |
boolean
|
onKeyDown(int keyCode, KeyEvent event)
A key was pressed down. |
boolean
|
onKeyUp(int keyCode, KeyEvent event)
A key was released. |
void
|
setVolumeControlEnabled(boolean enable)
Sets whether to enable the volume slider and volume control using the volume keys when the route supports it. |
Protected methods | |
|---|---|
void
|
onCreate(Bundle savedInstanceState)
Similar to |
Inherited methods | |
|---|---|
android.support.v7.app.AlertDialog
| |
android.support.v7.app.AppCompatDialog
| |
android.app.Dialog
| |
java.lang.Object
| |
android.content.DialogInterface
| |
android.support.v7.app.AppCompatCallback
| |
android.view.Window.Callback
| |
android.view.KeyEvent.Callback
| |
android.view.View.OnCreateContextMenuListener
| |
MediaRouteControllerDialog (Context context, int theme)
| Parameters | |
|---|---|
context |
Context
|
theme |
int
|
View getMediaControlView ()
Gets the media control view that was created by onCreateMediaControlView(Bundle).
| Returns | |
|---|---|
View |
The media control view, or null if none. |
MediaSessionCompat.Token getMediaSession ()
Gets the session to use for metadata and transport controls.
| Returns | |
|---|---|
MediaSessionCompat.Token |
The token for the session to use or null if none. |
MediaRouter.RouteInfo getRoute ()
Gets the route that this dialog is controlling.
| Returns | |
|---|---|
MediaRouter.RouteInfo |
|
boolean isVolumeControlEnabled ()
Returns whether to enable the volume slider and volume control using the volume keys when the route supports it.
| Returns | |
|---|---|
boolean |
|
void onAttachedToWindow ()
Called when the window has been attached to the window manager.
See View.onAttachedToWindow()
for more information.
View onCreateMediaControlView (Bundle savedInstanceState)
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. |
void onDetachedFromWindow ()
Called when the window has been attached to the window manager.
See View.onDetachedFromWindow()
for more information.
boolean onKeyDown (int keyCode,
KeyEvent event)
A key was pressed down.
If the focused view didn't want this event, this method is called.
The default implementation consumed the KEYCODE_BACK to later
handle it in onKeyUp(int, KeyEvent).
| Parameters | |
|---|---|
keyCode |
int:
The value in event.getKeyCode(). |
event |
KeyEvent:
Description of the key event. |
| Returns | |
|---|---|
boolean |
If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false. |
boolean onKeyUp (int keyCode,
KeyEvent event)
A key was released.
The default implementation handles KEYCODE_BACK to close the dialog.
| Parameters | |
|---|---|
keyCode |
int:
The value in event.getKeyCode(). |
event |
KeyEvent:
Description of the key event. |
| Returns | |
|---|---|
boolean |
If you handled the event, return true. If you want to allow the event to be handled by the next receiver, return false. |
void setVolumeControlEnabled (boolean enable)
Sets whether to enable the volume slider and volume control using the volume keys when the route supports it.
The default value is true.
| Parameters | |
|---|---|
enable |
boolean
|
void onCreate (Bundle savedInstanceState)
Similar to onCreate(Bundle), you should initialize your dialog
in this method, including calling setContentView(View).
| Parameters | |
|---|---|
savedInstanceState |
Bundle:
If this dialog is being reinitialized after a
the hosting activity was previously shut down, holds the result from
the most recent call to onSaveInstanceState(), or null if this
is the first time.
|