当前位置: 首页>>代码示例>>Java>>正文


Java MediaRouteControllerDialogFragment类代码示例

本文整理汇总了Java中android.support.v7.app.MediaRouteControllerDialogFragment的典型用法代码示例。如果您正苦于以下问题:Java MediaRouteControllerDialogFragment类的具体用法?Java MediaRouteControllerDialogFragment怎么用?Java MediaRouteControllerDialogFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MediaRouteControllerDialogFragment类属于android.support.v7.app包,在下文中一共展示了MediaRouteControllerDialogFragment类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showMediaRouteControlDialog

import android.support.v7.app.MediaRouteControllerDialogFragment; //导入依赖的package包/类
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");
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:RemoteMediaPlayerController.java

示例2: showMediaRouteControlDialog

import android.support.v7.app.MediaRouteControllerDialogFragment; //导入依赖的package包/类
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");
    }
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:18,代码来源:RemoteMediaPlayerController.java

示例3: onCreateControllerDialogFragment

import android.support.v7.app.MediaRouteControllerDialogFragment; //导入依赖的package包/类
@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());
        }
    };
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:19,代码来源:ChromeMediaRouteDialogFactory.java

示例4: onCreateOptionsMenu

import android.support.v7.app.MediaRouteControllerDialogFragment; //导入依赖的package包/类
@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;
}
 
开发者ID:benhysell,项目名称:V.FlyoutTest,代码行数:31,代码来源:SampleMediaRouterActivity.java

示例5: onCreateControllerDialogFragment

import android.support.v7.app.MediaRouteControllerDialogFragment; //导入依赖的package包/类
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
    return new Fragment(mPlayer);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:5,代码来源:MediaRouteControllerDialogFactory.java

示例6: onCreateControllerDialogFragment

import android.support.v7.app.MediaRouteControllerDialogFragment; //导入依赖的package包/类
@Override
public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
	return new CustomMediaRouteControllerDialogFragment();
}
 
开发者ID:popeen,项目名称:Popeens-DSub,代码行数:5,代码来源:CustomMediaRouteDialogFactory.java


注:本文中的android.support.v7.app.MediaRouteControllerDialogFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。