Merge "More dimming tweaks (for accessibility)" into oc-mr1-dev
am: dbb448a3d7
Change-Id: I94fe9f6055a48cdc596fe333a3f6d304cb7e33da
This commit is contained in:
@@ -80,7 +80,8 @@ public final class NavigationBarTransitions extends BarTransitions {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isLightsOut(int mode) {
|
protected boolean isLightsOut(int mode) {
|
||||||
return super.isLightsOut(mode) || (mAutoDim && !mWallpaperVisible);
|
return super.isLightsOut(mode) || (mAutoDim && !mWallpaperVisible
|
||||||
|
&& mode != MODE_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LightBarTransitionsController getLightTransitionsController() {
|
public LightBarTransitionsController getLightTransitionsController() {
|
||||||
@@ -108,7 +109,9 @@ public final class NavigationBarTransitions extends BarTransitions {
|
|||||||
// ok, everyone, stop it right there
|
// ok, everyone, stop it right there
|
||||||
navButtons.animate().cancel();
|
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) {
|
if (!animate) {
|
||||||
navButtons.setAlpha(navButtonsAlpha);
|
navButtons.setAlpha(navButtonsAlpha);
|
||||||
@@ -130,6 +133,9 @@ public final class NavigationBarTransitions extends BarTransitions {
|
|||||||
for (int i = buttonDispatchers.size() - 1; i >= 0; i--) {
|
for (int i = buttonDispatchers.size() - 1; i >= 0; i--) {
|
||||||
buttonDispatchers.valueAt(i).setDarkIntensity(darkIntensity);
|
buttonDispatchers.valueAt(i).setDarkIntensity(darkIntensity);
|
||||||
}
|
}
|
||||||
|
if (mAutoDim) {
|
||||||
|
applyLightsOut(false, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final View.OnTouchListener mLightsOutListener = new View.OnTouchListener() {
|
private final View.OnTouchListener mLightsOutListener = new View.OnTouchListener() {
|
||||||
|
|||||||
Reference in New Issue
Block a user