Added in API level 16

MediaRouteButton

open class MediaRouteButton : View
kotlin.Any
   ↳ android.view.View
   ↳ android.app.MediaRouteButton

Summary

Inherited XML attributes
Inherited constants
Public constructors

MediaRouteButton(context: Context!, attrs: AttributeSet!)

MediaRouteButton(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

MediaRouteButton(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Public methods
open Int

Gets the media route types for filtering the routes that the user can select using the media route chooser dialog.

open Unit

open Unit

open Unit

open Boolean

open Unit
setContentDescription(contentDescription: CharSequence!)

open Unit

open Unit

Sets the types of routes that will be shown in the media route chooser dialog launched by this button.

open Unit
setVisibility(visibility: Int)

open Unit

Show the route chooser or controller dialog.

Protected methods
open Unit

open IntArray!

open Unit
onDraw(canvas: Canvas)

open Unit
onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)

open Boolean

If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying.

Inherited functions
Inherited properties

Public constructors

MediaRouteButton

Added in API level 16
MediaRouteButton(context: Context!)

MediaRouteButton

Added in API level 16
MediaRouteButton(
    context: Context!,
    attrs: AttributeSet!)

MediaRouteButton

Added in API level 16
MediaRouteButton(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int)

MediaRouteButton

Added in API level 16
MediaRouteButton(
    context: Context!,
    attrs: AttributeSet!,
    defStyleAttr: Int,
    defStyleRes: Int)

Public methods

getRouteTypes

Added in API level 16
open fun getRouteTypes(): Int

Gets the media route types for filtering the routes that the user can select using the media route chooser dialog.

Return
Int The route types.

jumpDrawablesToCurrentState

Added in API level 16
open fun jumpDrawablesToCurrentState(): Unit

onAttachedToWindow

Added in API level 16
open fun onAttachedToWindow(): Unit

onDetachedFromWindow

Added in API level 16
open fun onDetachedFromWindow(): Unit

performClick

Added in API level 16
open fun performClick(): Boolean
Return
Boolean True there was an assigned OnClickListener that was called, false otherwise is returned.

setContentDescription

Added in API level 16
open fun setContentDescription(contentDescription: CharSequence!): Unit
Parameters
contentDescription CharSequence!: The content description.

setExtendedSettingsClickListener

Added in API level 16
open fun setExtendedSettingsClickListener(listener: View.OnClickListener!): Unit

setRouteTypes

Added in API level 16
open fun setRouteTypes(types: Int): Unit

Sets the types of routes that will be shown in the media route chooser dialog launched by this button.

Parameters
types Int: The route types to match.

setVisibility

Added in API level 16
open fun setVisibility(visibility: Int): Unit
Parameters
visibility Int: One of VISIBLE, INVISIBLE, or GONE. Value is android.view.View#VISIBLE, android.view.View#INVISIBLE, or android.view.View#GONE

showDialog

Added in API level 16
open fun showDialog(): Unit

Show the route chooser or controller dialog.

If the default route is selected or if the currently selected route does not match the route types, then shows the route chooser dialog. Otherwise, shows the route controller dialog to offer the user a choice to disconnect from the route or perform other control actions such as setting the route's volume.

This will attach a DialogFragment to the containing Activity.

Protected methods

drawableStateChanged

Added in API level 16
protected open fun drawableStateChanged(): Unit

onCreateDrawableState

Added in API level 16
protected open fun onCreateDrawableState(extraSpace: Int): IntArray!
Parameters
extraSpace Int: if non-zero, this is the number of extra entries you would like in the returned array in which you can place your own states.
Return
IntArray! Returns an array holding the current Drawable state of the view.

onDraw

Added in API level 16
protected open fun onDraw(canvas: Canvas): Unit
Parameters
canvas Canvas: the canvas on which the background will be drawn This value cannot be null.

onMeasure

Added in API level 16
protected open fun onMeasure(
    widthMeasureSpec: Int,
    heightMeasureSpec: Int
): Unit
Parameters
widthMeasureSpec Int: horizontal space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.
heightMeasureSpec Int: vertical space requirements as imposed by the parent. The requirements are encoded with android.view.View.MeasureSpec.

verifyDrawable

Added in API level 16
protected open fun verifyDrawable(who: Drawable): Boolean

If your view subclass is displaying its own Drawable objects, it should override this function and return true for any Drawable it is displaying. This allows animations for those drawables to be scheduled.

Be sure to call through to the super class when overriding this function.
If you override this method you must call through to the superclass implementation.

Parameters
who Drawable: This value cannot be null.
Return
Boolean boolean If true then the Drawable is being displayed in the view; else false and it is not allowed to animate.