在Android中如何设置屏幕亮度?
我想要一个使用在Android中如何设置屏幕亮度?,android,screen-brightness,Android,Screen Brightness,我想要一个使用SeekBar调整屏幕亮度的对话框 如何使用调整屏幕亮度的SeekBar显示自定义对话框?。这将改变窗口的屏幕亮度,而不是整个系统的亮度 // Make the screen full bright for this activity. WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.screenBrightness = 1.0f; ge
SeekBar
调整屏幕亮度的对话框
如何使用调整屏幕亮度的SeekBar
显示自定义对话框?。这将改变窗口的屏幕亮度,而不是整个系统的亮度
// Make the screen full bright for this activity.
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 1.0f;
getWindow().setAttributes(lp);
这应该对你有帮助
pdlg = ProgressDialog.show(getParent(), "Loading...", "");
WindowManager.LayoutParams lp = pdlg.getWindow().getAttributes();
p.dimAmount=0.0f; //Dim Amount
pdlg.getWindow().setAttributes(lp); //Applying properties to progress dialog
pdlg.dismiss(); //Dismiss the dialog
嘿,您可以这样设置系统亮度:
//Set the system brightness using the brightness variable value
System.putInt(cResolver, System.SCREEN_BRIGHTNESS, brightness);
//Get the current window attributes
LayoutParams layoutpars = window.getAttributes();
//Set the brightness of this window
layoutpars.screenBrightness = brightness / (float)255;
//Apply attribute changes to this window
window.setAttributes(layoutpars);
或者您可以参考此完整的,您无法再在全球范围内调整屏幕亮度;注意这个问题是的。。它将只适用于您的窗口。