public class MediaRouteControllerDialog extends AlertDialog
MediaRouter
.
This dialog allows the user to control or disconnect from the currently selected route.
MediaRouteButton
,
MediaRouteActionProvider
AlertDialog.Builder
DialogInterface.OnCancelListener, DialogInterface.OnClickListener, DialogInterface.OnDismissListener, DialogInterface.OnKeyListener, DialogInterface.OnMultiChoiceClickListener, DialogInterface.OnShowListener
mCancelable
BUTTON_NEGATIVE, BUTTON_NEUTRAL, BUTTON_POSITIVE, BUTTON1, BUTTON2, BUTTON3
Constructor and Description |
---|
MediaRouteControllerDialog(Context context) |
MediaRouteControllerDialog(Context context,
int theme) |
Modifier and Type | Method and Description |
---|---|
View |
getMediaControlView()
Gets the media control view that was created by
onCreateMediaControlView(Bundle) . |
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.
|
protected void |
onCreate(Bundle savedInstanceState)
Similar to
Activity.onCreate(android.os.Bundle) , you should initialize your dialog
in this method, including calling Dialog.setContentView(int) . |
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.
|
getButton, getListView, setButton, setButton, setCustomTitle, setIcon, setIcon, setIconAttribute, setMessage, setTitle, setView, setView
addContentView, findViewById, getDelegate, getSupportActionBar, invalidateOptionsMenu, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onWindowStartingSupportActionMode, setContentView, setContentView, setContentView, setTitle, supportRequestWindowFeature
cancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, isShowing, onActionModeFinished, onActionModeStarted, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onGenericMotionEvent, onKeyLongPress, onKeyMultiple, onKeyShortcut, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setVolumeControlStream, show, takeCancelAndDismissListeners, takeKeyEvents, unregisterForContextMenu
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, dismiss
onProvideKeyboardShortcuts
public MediaRouteControllerDialog(Context context)
public MediaRouteControllerDialog(Context context, int theme)
public MediaRouter.RouteInfo getRoute()
public View onCreateMediaControlView(Bundle savedInstanceState)
savedInstanceState
- The dialog's saved instance state.public View getMediaControlView()
onCreateMediaControlView(Bundle)
.public void setVolumeControlEnabled(boolean enable)
The default value is true.
public boolean isVolumeControlEnabled()
public MediaSessionCompat.Token getMediaSession()
protected void onCreate(Bundle savedInstanceState)
Dialog
Activity.onCreate(android.os.Bundle)
, you should initialize your dialog
in this method, including calling Dialog.setContentView(int)
.onCreate
in class AlertDialog
savedInstanceState
- If this dialog is being reinitialized after a
the hosting activity was previously shut down, holds the result from
the most recent call to Dialog.onSaveInstanceState()
, or null if this
is the first time.public void onAttachedToWindow()
Window.Callback
View.onAttachedToWindow()
for more information.onAttachedToWindow
in interface Window.Callback
onAttachedToWindow
in class Dialog
public void onDetachedFromWindow()
Window.Callback
View.onDetachedFromWindow()
for more information.onDetachedFromWindow
in interface Window.Callback
onDetachedFromWindow
in class Dialog
public boolean onKeyDown(int keyCode, KeyEvent event)
Dialog
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 Dialog.onKeyUp(int, android.view.KeyEvent)
.
onKeyDown
in interface KeyEvent.Callback
onKeyDown
in class AlertDialog
keyCode
- The value in event.getKeyCode().event
- Description of the key event.Dialog.onKeyUp(int, android.view.KeyEvent)
,
KeyEvent
public boolean onKeyUp(int keyCode, KeyEvent event)
Dialog
The default implementation handles KEYCODE_BACK to close the dialog.
onKeyUp
in interface KeyEvent.Callback
onKeyUp
in class AlertDialog
keyCode
- The value in event.getKeyCode().event
- Description of the key event.Dialog.onKeyDown(int, android.view.KeyEvent)
,
KeyEvent