From 2f4b18bada074d4d6ec9d1e1e14c96e556654b89 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 12 Jul 2021 14:33:54 -0700 Subject: [PATCH] Hide taskbar on lockscreen Add new animated float to disable taskbar background value when keyguard is visible. Fixes: 191857724 Test: Tested w/ and w/o bouncer for gesture + 3 button Tested w/ IME pw on lock screen. Change-Id: I2e1696fd25f4c170bfb2bc0694ccd644e453b1fe --- .../taskbar/NavbarButtonsViewController.java | 20 ++++++++++++------- .../taskbar/TaskbarDragLayerController.java | 10 +++++++++- .../taskbar/TaskbarKeyguardController.java | 4 ---- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java index 357dc7bc1e..be3f5d9ae8 100644 --- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java @@ -130,6 +130,15 @@ public class NavbarButtonsViewController { mPropertyHolders.add(new StatePropertyHolder(imeDownButton, flags -> (flags & FLAG_IME_VISIBLE) != 0)); + mPropertyHolders.add(new StatePropertyHolder( + mControllers.taskbarViewController.getTaskbarIconAlpha() + .getProperty(ALPHA_INDEX_KEYGUARD), + flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, MultiValueAlpha.VALUE, 1, 0)); + + mPropertyHolders.add(new StatePropertyHolder(mControllers.taskbarDragLayerController + .getKeyguardBgTaskbar(), + flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0)); + if (mContext.isThreeButtonNav()) { initButtons(mNavButtonContainer, mEndContextualContainer, mControllers.navButtonController); @@ -137,12 +146,9 @@ public class NavbarButtonsViewController { // Animate taskbar background when IME shows mPropertyHolders.add(new StatePropertyHolder( mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(), - flags -> (flags & FLAG_IME_VISIBLE) == 0, - AnimatedFloat.VALUE, 0, 1)); - mPropertyHolders.add(new StatePropertyHolder( - mControllers.taskbarViewController.getTaskbarIconAlpha() - .getProperty(ALPHA_INDEX_KEYGUARD), - flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, MultiValueAlpha.VALUE, 1, 0)); + flags -> (flags & FLAG_IME_VISIBLE) != 0 || + (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0, + AnimatedFloat.VALUE, 1, 0)); // Rotation button RotationButton rotationButton = new RotationButtonImpl( @@ -222,7 +228,7 @@ public class NavbarButtonsViewController { } /** - * Slightly misnamed, but should be called when only keyguard OR AOD is showing + * Slightly misnamed, but should be called when keyguard OR AOD is showing */ public void setKeyguardVisible(boolean isKeyguardVisible) { updateStateForFlag(FLAG_KEYGUARD_VISIBLE, isKeyguardVisible); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java index e15e9ffa71..df89285c3f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java @@ -39,6 +39,7 @@ public class TaskbarDragLayerController { // Alpha properties for taskbar background. private final AnimatedFloat mBgTaskbar = new AnimatedFloat(this::updateBackgroundAlpha); private final AnimatedFloat mBgNavbar = new AnimatedFloat(this::updateBackgroundAlpha); + private final AnimatedFloat mKeyguardBgTaskbar = new AnimatedFloat(this::updateBackgroundAlpha); // Translation property for taskbar background. private final AnimatedFloat mBgOffset = new AnimatedFloat(this::updateBackgroundOffset); @@ -56,6 +57,7 @@ public class TaskbarDragLayerController { public void init(TaskbarControllers controllers) { mControllers = controllers; mTaskbarDragLayer.init(new TaskbarDragLayerCallbacks()); + mKeyguardBgTaskbar.value = 1; } public void onDestroy() { @@ -80,12 +82,18 @@ public class TaskbarDragLayerController { return mBgNavbar; } + public AnimatedFloat getKeyguardBgTaskbar() { + return mKeyguardBgTaskbar; + } + public AnimatedFloat getTaskbarBackgroundOffset() { return mBgOffset; } private void updateBackgroundAlpha() { - mTaskbarDragLayer.setTaskbarBackgroundAlpha(Math.max(mBgNavbar.value, mBgTaskbar.value)); + mTaskbarDragLayer.setTaskbarBackgroundAlpha( + Math.max(mBgNavbar.value, mBgTaskbar.value * mKeyguardBgTaskbar.value) + ); } private void updateBackgroundOffset() { diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java index 2936bd2146..a2039b6e2d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarKeyguardController.java @@ -57,10 +57,6 @@ public class TaskbarKeyguardController { mKeyguardSysuiFlags = interestingKeyguardFlags; mBouncerShowing = bouncerShowing; - if (!mContext.isThreeButtonNav()) { - // For gesture nav we don't need to deal with bouncer or showing taskbar when locked - return; - } mNavbarButtonsViewController.setKeyguardVisible(keyguardShowing || dozing); updateIconsForBouncer();