MediaRouteActionProvider连接对话框主题 [英] MediaRouteActionProvider connection dialog theme

查看:62
本文介绍了MediaRouteActionProvider连接对话框主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试更改MediaRouteActionProvider连接对话框的主题.我在应用程序中使用带有Dark Actionbar的Light主题,因此该对话框具有深灰色内容,但背景是黑暗的. 当应用程序连接到设备时,其他对话框都可以,它们具有白色背景且主题正确. (对于在VideoMediaRouteControllerDialog和断开连接对话框中的示例.)

您有什么想法,如何更改连接对话框的主题?

非常感谢!

//屏幕截图1 :连接"对话框(带有主题问题)

//屏幕截图2 :控制器"对话框(带有正确的所需主题) )

解决方案

我所做的是从GitHub提取mediarouter appcompat库源代码,然后我修复了主题并将整个内容重建为Screenshot 1: Connection dialog (with the theme issue)

//Screenshot 2: Controller dialog (with the right, needed theme)

解决方案

What I did was pulling the mediarouter appcompat library source from GitHub, then I fixing the theming and rebuilding the whole thing into my own custom mediarouter library.

What you're looking for in the code is MediaRouteChooserDialog, and even there, the constructor that only takes a Context as a parameter, as that's the one being called by onCreateChooserDialog() in MediaRouteChooserDialogFragment.

I was lazy so I simply put android.R.style.Theme_Holo_Light_Dialog instead of the 0 in the constructor, and it worked just fine. But of course you can always look for a more sophisticated solution.

这篇关于MediaRouteActionProvider连接对话框主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆