DynamicRouteDescriptor

class DynamicRouteDescriptor
kotlin.Any
   ↳ androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor

Contains a route, its selection state and its capabilities. This is used in OnDynamicRoutesChangedListener.

Summary

Nested classes

Builder for DynamicRouteDescriptor

Constants
static Int

After a user unselects a route, it might take some time for a provider to complete the operation.

static Int

The route is unselected.

static Int

After a user selects a route, it might take some time for a provider to complete the operation.

static Int

The route is selected.

Public methods
Boolean

Returns true if the route can be grouped into the dynamic group route.

Boolean

Returns true if the route can be unselected.

Int

Gets the selection state.

Boolean

Returns true if the current dynamic group route can be transferred to this route.

MediaRouteDescriptor

Gets this route's MediaRouteDescriptor.

Constants

UNSELECTING

static val UNSELECTING: Int

After a user unselects a route, it might take some time for a provider to complete the operation. This state is used in this between time. MediaRouter can either block the UI or show the route as unchecked.

Value: 0

UNSELECTED

static val UNSELECTED: Int

The route is unselected.

Unselect operation is done by the route provider.

Value: 1

SELECTING

static val SELECTING: Int

After a user selects a route, it might take some time for a provider to complete the operation. This state is used in this between time. MediaRouter can either block the UI or show the route as checked.

Value: 2

SELECTED

static val SELECTED: Int

The route is selected.

Select operation is done by the route provider.

Value: 3

Public methods

isGroupable

fun isGroupable(): Boolean

Returns true if the route can be grouped into the dynamic group route.

Only applicable to unselected/unselecting routes. Note that isGroupable() and isTransferable() are NOT mutually exclusive.

isUnselectable

fun isUnselectable(): Boolean

Returns true if the route can be unselected.

For example, a static group has an old build which doesn't support dynamic group. All its members can't be removed.

Only applicable to selected/selecting routes.

getSelectionState

fun getSelectionState(): Int

Gets the selection state.

isTransferable

fun isTransferable(): Boolean

Returns true if the current dynamic group route can be transferred to this route.

Only applicable to unselected/unselecting routes. Note that isGroupable() and isTransferable() are NOT mutually exclusive.

getRouteDescriptor

@NonNull fun getRouteDescriptor(): MediaRouteDescriptor

Gets this route's MediaRouteDescriptor. i.e. which route this info is for.