I am having trouble with customizing the MediaRouteChooser / MediaRouteController dialogs (I would need different layouts, some extra actions).
The cast button is set up by calling
CastButtonFactory.setUpMediaRouteButton(getApplicationContext(), menu, R.id.media_route_menu_item);
inside onCreateOptionsMenu
.
I figured out that I would need to extend the MediaRouteDialogFactory
where I return my own MediaRouteChooserDialogFragment
where I overwrite the onCreateChooserDialog
and return my custom dialog. However this needs to be a MediaRouteChooserDialog
but it does not make much sense to extend this (you would need to duplicate all of the code, because everything is private and you can't use them e.g. mRouter
, mCallback
).
My question is that how can I do and show my own dialog and the route listing myself but also keep the CastButtonFactory.setUpMediaRouteButton
solution inside the onCreateOptionsMenu
? I really don't want to bother with the chromecast button states like visibility, connections state, decide if I need to show the route chooser or route controller etc. I am not even sure how should I do the route listing / managing discovery, so a little help would be nice also on that topic.