Configure brightening screen when display a barcode

When a barcode is displayed the screen's brightness is set to
the maximum, in an attempt to provide the best chance for a barcode
scanner to capture the barcode. However, it may not always
be desired to increase the brightness, for example when using
the app in low light.

This change adds a setting to control the screen brightening
behavior when a barcode is viewed.
This commit is contained in:
Branden Archer
2018-07-25 22:24:18 -04:00
parent 8c7a3273e8
commit 34c07800dd
4 changed files with 17 additions and 2 deletions

View File

@@ -96,7 +96,7 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
// '1' is the brightest. We attempt to maximize the brightness
// to help barcode readers scan the barcode.
Window window = getWindow();
if(window != null)
if(window != null && settings.useMaxBrightnessDisplayingBarcode())
{
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.screenBrightness = 1F;