Java 类android.support.v7.app.MediaRouteControllerDialogFragment 实例源码
项目:chromium-for-android-56-debug-video
文件:RemoteMediaPlayerController.java
private void showMediaRouteControlDialog(MediaStateListener player, 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(player);
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");
}
项目:AndroidChromium
文件:RemoteMediaPlayerController.java
private void showMediaRouteControlDialog(MediaStateListener player, 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(player);
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");
}
项目:Vafrinn
文件:RemoteMediaPlayerController.java
private void showMediaRouteControlDialog(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 ChromeMediaRouteDialogFactory();
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");
}
项目:Vafrinn
文件:ChromeMediaRouteDialogFactory.java
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
return new MediaRouteControllerDialogFragment() {
final SystemVisibilitySaver mVisibilitySaver = new SystemVisibilitySaver();
@Override
public Dialog onCreateDialog(Bundle saved) {
mVisibilitySaver.saveSystemVisibility(getActivity());
return new MediaRouteControllerDialog(getActivity());
}
@Override
public void onStop() {
super.onStop();
mVisibilitySaver.restoreSystemVisibility(getActivity());
}
};
}
项目:365browser
文件:RemoteMediaPlayerController.java
private void showMediaRouteControlDialog(MediaStateListener player, 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(player);
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");
}
项目:V.FlyoutTest
文件:SampleMediaRouterActivity.java
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Be sure to call the super class.
super.onCreateOptionsMenu(menu);
// Inflate the menu and configure the media router action provider.
getMenuInflater().inflate(R.menu.sample_media_router_menu, menu);
MenuItem mediaRouteMenuItem = menu.findItem(R.id.media_route_menu_item);
MediaRouteActionProvider mediaRouteActionProvider =
(MediaRouteActionProvider)MenuItemCompat.getActionProvider(mediaRouteMenuItem);
mediaRouteActionProvider.setRouteSelector(mSelector);
mediaRouteActionProvider.setDialogFactory(new MediaRouteDialogFactory() {
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
return new MediaRouteControllerDialogFragment() {
@Override
public MediaRouteControllerDialog onCreateControllerDialog(
Context context, Bundle savedInstanceState) {
mControllerDialog = new SampleMediaRouteControllerDialog(
context, mSessionManager, mPlayer);
return mControllerDialog;
}
};
}
});
// Return true to show the menu.
return true;
}
项目:chromium-for-android-56-debug-video
文件:MediaRouteControllerDialogFactory.java
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
return new Fragment(mPlayer);
}
项目:AndroidChromium
文件:MediaRouteControllerDialogFactory.java
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
return new Fragment(mPlayer);
}
项目:365browser
文件:MediaRouteControllerDialogFactory.java
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
return new Fragment(mPlayer);
}
项目:Popeens-DSub
文件:CustomMediaRouteDialogFactory.java
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
return new CustomMediaRouteControllerDialogFragment();
}