use of android.support.v7.app.MediaRouteDialogFactory in project AndroidChromium by JackyAndroid.
the class RemoteMediaPlayerController method showMediaRouteDialog.
private void showMediaRouteDialog(MediaStateListener player, MediaRouteController controller, Activity activity) {
FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
if (fm == null) {
throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
}
MediaRouteDialogFactory factory = new MediaRouteChooserDialogFactory(player, controller, activity);
if (fm.findFragmentByTag("android.support.v7.mediarouter:MediaRouteChooserDialogFragment") != null) {
Log.w(TAG, "showDialog(): Route chooser dialog already showing!");
return;
}
MediaRouteChooserDialogFragment f = factory.onCreateChooserDialogFragment();
f.setRouteSelector(controller.buildMediaRouteSelector());
f.show(fm, "android.support.v7.mediarouter:MediaRouteChooserDialogFragment");
}
use of android.support.v7.app.MediaRouteDialogFactory in project AndroidChromium by JackyAndroid.
the class RemoteMediaPlayerController method showMediaRouteControlDialog.
private void showMediaRouteControlDialog(Activity activity) {
FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
if (fm == null) {
throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
}
MediaRouteDialogFactory factory = new MediaRouteControllerDialogFactory();
if (fm.findFragmentByTag("android.support.v7.mediarouter:MediaRouteControllerDialogFragment") != null) {
Log.w(TAG, "showDialog(): Route controller dialog already showing!");
return;
}
MediaRouteControllerDialogFragment f = factory.onCreateControllerDialogFragment();
f.show(fm, "android.support.v7.mediarouter:MediaRouteControllerDialogFragment");
}
Aggregations