OSDN Git Service

More dimming tweaks (for accessibility)
authorJason Monk <jmonk@google.com>
Wed, 8 Nov 2017 20:51:59 +0000 (15:51 -0500)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Tue, 28 Nov 2017 03:31:58 +0000 (03:31 +0000)
 - Don't dim when battery saver bar is showing.
 - Bump alpha by 10% for light nav bar

Test: manual
Change-Id: I296aa68c0904f7972dd941eb1aac3b4c71114eee
Fixes: 63630024
(cherry picked from commit cdec5ff9f496e345d1e2e40f3d36d66938ace5f6)

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarTransitions.java

index c950036..b81a3b0 100644 (file)
@@ -80,7 +80,8 @@ public final class NavigationBarTransitions extends BarTransitions {
 
     @Override
     protected boolean isLightsOut(int mode) {
-        return super.isLightsOut(mode) || (mAutoDim && !mWallpaperVisible);
+        return super.isLightsOut(mode) || (mAutoDim && !mWallpaperVisible
+                && mode != MODE_WARNING);
     }
 
     public LightBarTransitionsController getLightTransitionsController() {
@@ -108,7 +109,9 @@ public final class NavigationBarTransitions extends BarTransitions {
         // ok, everyone, stop it right there
         navButtons.animate().cancel();
 
-        final float navButtonsAlpha = lightsOut ? 0.6f : 1f;
+        // Bump percentage by 10% if dark.
+        float darkBump = mLightTransitionsController.getCurrentDarkIntensity() / 10;
+        final float navButtonsAlpha = lightsOut ? 0.6f + darkBump : 1f;
 
         if (!animate) {
             navButtons.setAlpha(navButtonsAlpha);
@@ -130,6 +133,9 @@ public final class NavigationBarTransitions extends BarTransitions {
         for (int i = buttonDispatchers.size() - 1; i >= 0; i--) {
             buttonDispatchers.valueAt(i).setDarkIntensity(darkIntensity);
         }
+        if (mAutoDim) {
+            applyLightsOut(false, true);
+        }
     }
 
     private final View.OnTouchListener mLightsOutListener = new View.OnTouchListener() {