UiModeManager - NightMode (Froyo)

天涯浪子 提交于 2019-12-03 08:30:54

Answering my own question as the Froyo source code has just been released:

I don't think you have to use the UIModeManager class. This is how the DeskClock app does:

Window win = getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();

//Look at this!
winParams.buttonBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF;

win.setAttributes(winParams);

..And it works for me as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!