Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

MediaRouteDialogFactory

open class MediaRouteDialogFactory
kotlin.Any
   ↳ androidx.mediarouter.app.MediaRouteDialogFactory

The media route dialog factory is responsible for creating the media route chooser and controller dialogs as needed.

The application can customize the dialogs by providing a subclass of the dialog factory to the MediaRouteButton using the setDialogFactory method.

Summary

Public constructors

Creates a default media route dialog factory.

Public methods

open static MediaRouteDialogFactory

Gets the default factory instance.

open MediaRouteChooserDialogFragment

Called when the chooser dialog is being opened and it is time to create the fragment.

open MediaRouteControllerDialogFragment

Called when the controller dialog is being opened and it is time to create the fragment.

Public constructors

<init>

MediaRouteDialogFactory()

Creates a default media route dialog factory.

Public methods

getDefault

@NonNull open static fun getDefault(): MediaRouteDialogFactory

Gets the default factory instance.

Return
MediaRouteDialogFactory: The default media route dialog factory, never null.

onCreateChooserDialogFragment

@NonNull open fun onCreateChooserDialogFragment(): MediaRouteChooserDialogFragment

Called when the chooser dialog is being opened and it is time to create the fragment.

Subclasses may override this method to create a customized fragment.

Return
MediaRouteChooserDialogFragment: The media route chooser dialog fragment, must not be null.

onCreateControllerDialogFragment

@NonNull open fun onCreateControllerDialogFragment(): MediaRouteControllerDialogFragment

Called when the controller dialog is being opened and it is time to create the fragment.

Subclasses may override this method to create a customized fragment.

Return
MediaRouteControllerDialogFragment: The media route controller dialog fragment, must not be null.