public class BrightnessHelper
extends java.lang.Object
Constructor and Description |
---|
BrightnessHelper() |
Modifier and Type | Method and Description |
---|---|
static float |
setBrightness(android.view.Window window,
float screenBrightness,
boolean isBrightnessIncrement)
Sets the brightness of the screen.
|
public static float setBrightness(@NonNull android.view.Window window, float screenBrightness, boolean isBrightnessIncrement)
screenBrightness
- 0 to 1 adjusts the brightness from dark to full bright. less than
0, the default(WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE
), means to use the preferred
screen brightness.isBrightnessIncrement
- is brightness increment (+origin)[0.01f <= screenBrightness <=
1.0f]