Frage

Ich möchte einen Dialog SeekBar.

So zeigen Sie benutzerdefinierten Dialog mit dem benutzerdefinierten Dialog mit SeekBar Das passt die Helligkeit des Bildschirms an?

War es hilfreich?

Lösung

Sie können diese API verwenden. Dies ändert die Bildschirmhelligkeit Ihres Fensters und nicht des gesamten Systems.

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

        getWindow().setAttributes(lp);

Andere Tipps

Dies Code-Auszug sollte dir helfen

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

Hey, du kannst die Systemhelligkeit so festlegen:

 //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);

Oder Sie können dies vollständig verweisen Lernprogramm

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top