@Override public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() { return new MediaRouteChooserDialogFragment() { final SystemVisibilitySaver mVisibilitySaver = new SystemVisibilitySaver(); @Override public MediaRouteChooserDialog onCreateChooserDialog( Context context, Bundle savedInstanceState) { mVisibilitySaver.saveSystemVisibility(getActivity()); return new MediaRouteChooserDialog(context); } @Override public void onStop() { super.onStop(); mVisibilitySaver.restoreSystemVisibility(getActivity()); } }; }
@Override @DebugLog protected void onCreate(Bundle savedInstanceState) { boolean light = getIntent().getBooleanExtra(RendererConstants.EXTRA_WANT_LIGHT_THEME, true); setTheme(light ? R.style.CastThemeTranslucentLight : R.style.CastThemeTranslucentDark); super.onCreate(savedInstanceState); CastComponent parent = DaggerService.getDaggerComponent(getApplicationContext()); DevicePickerActivityComponent.FACTORY.call(parent).inject(this); setResult(RESULT_CANCELED, new Intent()); //always reset route mMediaRouter.selectRoute(mMediaRouter.getDefaultRoute()); final MediaRouteSelector selector = new MediaRouteSelector.Builder() .addControlCategory(CastMediaControlIntent.categoryForCast(getString(R.string.cast_id))) .build(); mCallback = new MediaRouterCallback(); mMediaRouter.addCallback(selector, mCallback, MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY); mDialog = new MediaRouteChooserDialog(this); mDialog.setOnDismissListener(this); mDialog.setRouteSelector(selector); mDialog.show(); }
@Override public MediaRouteChooserDialog onCreateChooserDialog( Context context, Bundle savedInstanceState) { mVisibilitySaver.saveSystemVisibility(getActivity()); mContext = context; return new MediaRouteChooserDialog(context); }
@Override public MediaRouteChooserDialog onCreateChooserDialog(Context context, Bundle savedInstanceState) { return new MediaRouteChooserDialog(context); }
@Override public MediaRouteChooserDialog onCreateChooserDialog(Context context, Bundle savedInstanceState) { return new MediaRouteChooserDialog(context, ThemeUtil.getThemeRes(context)); }