public class MediaRouteControllerDialog extends Dialog
MediaRouter
.
This dialog allows the user to control or disconnect from the currently selected route.
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,
int theme) |
Modifier and Type | Method and Description |
---|---|
View |
getMediaControlView()
Gets the media control view that was created by
onCreateMediaControlView(Bundle) . |
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
be included within the body of the dialog to offer additional 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.
|
addContentView, cancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, 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, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setTitle, setVolumeControlStream, show, takeCancelAndDismissListeners, takeKeyEvents, unregisterForContextMenu
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onProvideKeyboardShortcuts
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()
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 Dialog
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 Dialog
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 Dialog
keyCode
- The value in event.getKeyCode().event
- Description of the key event.Dialog.onKeyDown(int, android.view.KeyEvent)
,
KeyEvent