• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MediaRouteChooserDialogFragment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: showMediaRouteDialog

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


示例2: onActivityResult

import android.support.v7.app.MediaRouteChooserDialogFragment; //导入依赖的package包/类
/**
 * called after the user finishes the screen capture permissions activity
 * @param requestCode arbitrary int representing why the activity was started
 * @param resultCode int indicating success or failure
 * @param data an Intent representing screen capture permission
 */
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode != SCREEN_CAPTURE_REQUEST) {
        // this request wasn't meant for us
    } else if (resultCode != AppCompatActivity.RESULT_OK) {
        Toast.makeText(this, "Screen casting won't work without capture permission", Toast.LENGTH_LONG).show();
    } else {
        mPermissionsResultCode = resultCode;
        mPermissionsData = data;

        if (mProvider != null && mProvider.getMediaRouteButton() != null) {
            MediaRouteDialogFactory factory = mProvider.getMediaRouteButton().getDialogFactory();
            MediaRouteChooserDialogFragment chooser = factory.onCreateChooserDialogFragment();
            chooser.setRouteSelector(mSelector);
            FragmentManager fm = getSupportFragmentManager();
            chooser.show(fm, CastScreenMediaRouteButton.CHOOSER_TAG);
        } else {
            Log.e(TAG, "Null action provider or route button - " + PLEASE_REPORT_BUG);
        }
    }
}
 
开发者ID:ankyl,项目名称:castscreen,代码行数:28,代码来源:CastScreenActivity.java


示例3: showMediaRouteDialog

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


示例4: onCreateChooserDialogFragment

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


示例5: openCastDialog

import android.support.v7.app.MediaRouteChooserDialogFragment; //导入依赖的package包/类
private void openCastDialog() {
    final FragmentManager fm = getSupportFragmentManager();
    MediaRouteChooserDialogFragment f = MediaRouteDialogFactory.getDefault().onCreateChooserDialogFragment();
    f.setRouteSelector(CastContext.getSharedInstance(this).getMergedSelector());
    f.show(fm, "android.support.v7.mediarouter:MediaRouteChooserDialogFragment");
}
 
开发者ID:aschober,项目名称:vinyl-cast,代码行数:7,代码来源:MainActivity.java


示例6: onCreateChooserDialogFragment

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


示例7: onCreateChooserDialogFragment

import android.support.v7.app.MediaRouteChooserDialogFragment; //导入依赖的package包/类
@NonNull
@Override
public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() {
	return new CustomMediaRouteChooserDialogFragment();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:6,代码来源:StreamFragment.java


示例8: onCreateChooserDialogFragment

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Tone类代码示例发布时间:2022-05-23
下一篇:
Java GeneratorException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap