2

Bwlow code is increasing the brightness of whole screen but I am taking a particular region in XML (like taking Linear Layout of 100*100), and I want to increase the brightness of that particular (Linear Layout) region only not the whole screen.

 getWindow().setAttributes(l);
 WindowManager.LayoutParams l = getWindow().getAttributes();

         lll8.screenBrightness = 1.0f;

        getWindow().setAttributes(l);
abhi
  • 154
  • 16

1 Answers1

0

Use two layouts and set two different alpha value for them to get different brightness level on a single screen.

Another ways is to use a gradient texture (shade with grey colour in thearea you want less brightness), put it in the drawable folder and use it in the xml and align it top of the parent.

Hope you have the codes to set the brightness.

Safvan 7
  • 395
  • 3
  • 12