Question: I want a dialog that adjusts brightness of the screen using `SeekBar`.

How to display custom dialog with `SeekBar` that adjusts brightness of screen?

Answer: 
[You can use this API](http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#screenBrightness). This will change screen brightness of your window and not of the whole system.

```
        // Make the screen full bright for this activity.
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.screenBrightness = 1.0f;

        getWindow().setAttributes(lp);

```
This [code snippet](http://androidcodesnips.blogspot.com/2011/07/reducing-dimness-while-running-progress.html) should help you

```
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

```