diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarVisibilityController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarVisibilityController.java index 6d20d9718f..715e4ca4c6 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarVisibilityController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarVisibilityController.java @@ -65,6 +65,7 @@ public class TaskbarVisibilityController { } protected void cleanup() { + setNavBarButtonAlpha(1f); } protected AnimatedFloat getTaskbarVisibilityForLauncherState() { @@ -93,6 +94,14 @@ public class TaskbarVisibilityController { float alphaDueToLauncher = Math.max(mTaskbarBackgroundAlpha.value, mTaskbarVisibilityAlphaForLauncherState.value); float alphaDueToOther = mTaskbarVisibilityAlphaForIme.value; - mTaskbarCallbacks.updateTaskbarVisibilityAlpha(alphaDueToLauncher * alphaDueToOther); + float taskbarAlpha = alphaDueToLauncher * alphaDueToOther; + mTaskbarCallbacks.updateTaskbarVisibilityAlpha(taskbarAlpha); + + // Make the nav bar invisible if taskbar is visible. + setNavBarButtonAlpha(1f - taskbarAlpha); + } + + private void setNavBarButtonAlpha(float navBarAlpha) { + SystemUiProxy.INSTANCE.get(mLauncher).setNavBarButtonAlpha(navBarAlpha, false); } } diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 619103c2ef..a70cc4ccd2 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -62,6 +62,7 @@ public class SystemUiProxy implements ISystemUiProxy, private boolean mLastShelfVisible; private float mLastNavButtonAlpha; private boolean mLastNavButtonAnimate; + private boolean mHasNavButtonAlphaBeenSet = false; // TODO(141886704): Find a way to remove this private int mLastSystemUiStateFlags; @@ -163,10 +164,12 @@ public class SystemUiProxy implements ISystemUiProxy, @Override public void setNavBarButtonAlpha(float alpha, boolean animate) { boolean changed = Float.compare(alpha, mLastNavButtonAlpha) != 0 - || animate != mLastNavButtonAnimate; + || animate != mLastNavButtonAnimate + || !mHasNavButtonAlphaBeenSet; if (mSystemUiProxy != null && changed) { mLastNavButtonAlpha = alpha; mLastNavButtonAnimate = animate; + mHasNavButtonAlphaBeenSet = true; try { mSystemUiProxy.setNavBarButtonAlpha(alpha, animate); } catch (RemoteException e) {