Search code examples
androidscreenpartialbrightness

Is it possible to set different brightness level to each part of screen/activity?


I know how to change brightness of entire window:

float brightness = 255;
brightness = brightness / (float) 255;
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = brightness;
getWindow().setAttributes(lp);

but is it possible to set brightness to different parts of the screen?

I want reach something like this:

img

or this:

enter image description here


Solution

  • Android API doesn't provide any means to achieve that(I've head a similar problem. Didn't find any solution).