RouteGroup
open class RouteGroup : MediaRouter.RouteInfo
Information about a route that consists of multiple other routes in a group.
Summary
Inherited constants |
From class RouteInfo
Int |
DEVICE_TYPE_BLUETOOTH
A receiver device type of the route indicating the presentation of the media is happening on a bluetooth device such as a bluetooth speaker.
|
Int |
DEVICE_TYPE_SPEAKER
A receiver device type of the route indicating the presentation of the media is happening on a speaker.
|
Int |
DEVICE_TYPE_TV
A receiver device type of the route indicating the presentation of the media is happening on a TV.
|
Int |
DEVICE_TYPE_UNKNOWN
The default receiver device type of the route indicating the type is unknown.
|
Int |
PLAYBACK_TYPE_LOCAL
The default playback type, "local", indicating the presentation of the media is happening on the same device (e.g. a phone, a tablet) as where it is controlled from.
|
Int |
PLAYBACK_TYPE_REMOTE
A playback type indicating the presentation of the media is happening on a different device (i.e. the remote device) than where it is controlled from.
|
Int |
PLAYBACK_VOLUME_FIXED
Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object. An example of fixed playback volume is a remote player, playing over HDMI where the user prefers to control the volume on the HDMI sink, rather than attenuate at the source.
|
Int |
PLAYBACK_VOLUME_VARIABLE
Playback information indicating the playback volume is variable and can be controlled from this object.
|
|
Public methods |
open Unit |
Add a route to this group.
|
open Unit |
Add a route to this group before the specified index.
|
open MediaRouter.RouteInfo! |
Return the route in this group at the specified index
|
open Int |
|
open Unit |
Remove a route from this group.
|
open Unit |
Remove the route at the specified index from this group.
|
open Unit |
|
open Unit |
|
open Unit |
Set an icon that will be used to represent this group.
|
open Unit |
Set an icon that will be used to represent this group.
|
open String |
|
Inherited functions |
From class RouteInfo
MediaRouter.RouteCategory! |
getCategory()
|
CharSequence! |
getDescription()
Gets the user-visible description of the route.
The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device.
|
Int |
getDeviceType()
Gets the type of the receiver device associated with this route.
|
MediaRouter.RouteGroup! |
getGroup()
|
Drawable! |
getIconDrawable()
Get the icon representing this route. This icon will be used in picker UIs if available.
|
CharSequence! |
getName()
Gets the user-visible name of the route.
The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.
|
CharSequence! |
getName(context: Context!)
Return the properly localized/resource user-visible name of this route.
The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number.
|
Int |
getPlaybackStream()
|
Int |
getPlaybackType()
|
Display! |
getPresentationDisplay()
Gets the Display that should be used by the application to show a android.app.Presentation on an external display when this route is selected. Depending on the route, this may only be valid if the route is currently selected.
The preferred presentation display may change independently of the route being selected or unselected. For example, the presentation display of the default system route may change when an external HDMI display is connected or disconnected even though the route itself has not changed.
This method may return null if there is no external display associated with the route or if the display is not ready to show UI yet.
The application should listen for changes to the presentation display using the Callback.onRoutePresentationDisplayChanged callback and show or dismiss its android.app.Presentation accordingly when the display becomes available or is removed.
This method only makes sense for live video routes.
|
CharSequence! |
getStatus()
|
Int |
getSupportedTypes()
|
Any! |
getTag()
|
Int |
getVolume()
Return the current volume for this route. Depending on the route, this may only be valid if the route is currently selected.
|
Int |
getVolumeHandling()
|
Int |
getVolumeMax()
|
Boolean |
isConnecting()
Returns true if the route is in the process of connecting and is not yet ready for use.
|
Boolean |
isEnabled()
Returns true if this route is enabled and may be selected.
|
Unit |
setTag(tag: Any!)
Set an application-specific tag object for this route. The application may use this to store arbitrary data associated with the route for internal tracking.
Note that the lifespan of a route may be well past the lifespan of an Activity or other Context; take care that objects you store here will not keep more data in memory alive than you intend.
|
|
Public methods
addRoute
open fun addRoute(route: MediaRouter.RouteInfo!): Unit
Add a route to this group. The route must not currently belong to another group.
getRouteAt
open fun getRouteAt(index: Int): MediaRouter.RouteInfo!
Return the route in this group at the specified index
Parameters |
index |
Int: Index to fetch |
getRouteCount
open fun getRouteCount(): Int
Return |
Int |
The number of routes in this group |
removeRoute
open fun removeRoute(index: Int): Unit
Remove the route at the specified index from this group.
Parameters |
index |
Int: index of the route to remove |
requestSetVolume
open fun requestSetVolume(volume: Int): Unit
Parameters |
volume |
Int: value between 0 and getVolumeMax |
requestUpdateVolume
open fun requestUpdateVolume(direction: Int): Unit
Parameters |
direction |
Int: Delta to apply to the current volume |
setIconDrawable
open fun setIconDrawable(icon: Drawable!): Unit
Set an icon that will be used to represent this group. The system may use this icon in picker UIs or similar.
Parameters |
icon |
Drawable!: icon drawable to use to represent this group |
setIconResource
open fun setIconResource(resId: Int): Unit
Set an icon that will be used to represent this group. The system may use this icon in picker UIs or similar.
Parameters |
resId |
Int: Resource ID of an icon drawable to use to represent this group |
toString
open fun toString(): String
Return |
String |
a string representation of the object. |