diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl index 77bb5141d1e0e..9228b178c76f6 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl @@ -55,9 +55,16 @@ interface ISystemUiProxy { /** * Control the {@param alpha} of the back button in the navigation bar and {@param animate} if * needed from current value + * @deprecated */ void setBackButtonAlpha(float alpha, boolean animate) = 8; + /** + * Control the {@param alpha} of the option nav bar button (back-button in 2 button mode + * and home bar in no-button mode) and {@param animate} if needed from current value + */ + void setNavBarButtonAlpha(float alpha, boolean animate) = 19; + /** * Proxies motion events from the homescreen UI to the status bar. Only called when * swipe down is detected on WORKSPACE. The sender guarantees the following order of events on diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index 88a8b31dc3612..c13c46d1ba4c6 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -115,7 +115,7 @@ public class OverviewProxyService implements CallbackController { - notifyBackButtonAlphaChanged(alpha, animate); - }); + mNavBarButtonAlpha = alpha; + mHandler.post(() -> notifyNavBarButtonAlphaChanged(alpha, animate)); } finally { Binder.restoreCallingIdentity(token); } } + @Override + public void setBackButtonAlpha(float alpha, boolean animate) { + setNavBarButtonAlpha(alpha, animate); + } + @Override public void onAssistantProgress(@FloatRange(from = 0.0, to = 1.0) float progress) { if (!verifyCaller("onAssistantProgress")) { @@ -465,7 +468,7 @@ public class OverviewProxyService implements CallbackController= 0; --i) { - mConnectionCallbacks.get(i).onBackButtonAlphaChanged(alpha, animate); + mConnectionCallbacks.get(i).onNavBarButtonAlphaChanged(alpha, animate); } } @@ -766,7 +769,8 @@ public class OverviewProxyService implements CallbackController 0 ? View.VISIBLE : View.INVISIBLE); - backButton.setAlpha(alpha, animate); + public void onNavBarButtonAlphaChanged(float alpha, boolean animate) { + ButtonDispatcher buttonDispatcher = null; + if (QuickStepContract.isSwipeUpMode(mNavBarMode)) { + buttonDispatcher = mNavigationBarView.getBackButton(); + } else if (QuickStepContract.isGesturalMode(mNavBarMode)) { + buttonDispatcher = mNavigationBarView.getHomeHandle(); + } + if (buttonDispatcher != null) { + buttonDispatcher.setVisibility(alpha > 0 ? View.VISIBLE : View.INVISIBLE); + buttonDispatcher.setAlpha(alpha, animate); } } };