Fix TaskbarBackgroundRenderer not being applied correctly in 2 cases

- Rename isInAppAndNotStashed to areTaskbarIconsVisibleAndNotStashing,
  and check taskbarViewController.areIconsVisible() accordingly. This
  effectively handles the same as before, but also handles Overview,
  which is not inApp but does have areIconsVisible()
  - This fixes bubble scrim over overview taskbar, as well as showing
    taskbar background behind assistant in 3 button mode.
- Also fix nav bar button dark density changing when applying the
  separate background for assistant

Test: Open bubble and invoke assistant in overview, over IME, inside
an app, over home
Fixes: 266715337

Change-Id: Ie655de7abd1634e2165543d57664d7c7e054a986
This commit is contained in:
Tony Wickham
2023-01-25 19:00:53 +00:00
parent 68f5667338
commit b9ecff07e4
5 changed files with 24 additions and 13 deletions
@@ -60,6 +60,7 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa
private AnimatedFloat mNavButtonDarkIntensityMultiplier;
private float mLastSetBackgroundAlpha;
private boolean mIsBackgroundDrawnElsewhere;
public TaskbarDragLayerController(TaskbarActivityContext activity,
TaskbarDragLayer taskbarDragLayer) {
@@ -168,9 +169,23 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa
mTaskbarDragLayer.setCornerRoundness(cornerRoundness);
}
/**
* Set if another controller is temporarily handling background drawing. In this case we:
* - Override our background alpha to be 0.
* - Keep the nav bar dark intensity assuming taskbar background is at full alpha.
*/
public void setIsBackgroundDrawnElsewhere(boolean isBackgroundDrawnElsewhere) {
mIsBackgroundDrawnElsewhere = isBackgroundDrawnElsewhere;
mBgOverride.updateValue(mIsBackgroundDrawnElsewhere ? 0 : 1);
updateNavBarDarkIntensityMultiplier();
}
private void updateNavBarDarkIntensityMultiplier() {
// Zero out the app-requested dark intensity when we're drawing our own background.
float effectiveBgAlpha = mLastSetBackgroundAlpha * (1 - mBgOffset.value);
if (mIsBackgroundDrawnElsewhere) {
effectiveBgAlpha = 1;
}
mNavButtonDarkIntensityMultiplier.updateValue(1 - effectiveBgAlpha);
}