Merge "Hide taskbar on lockscreen" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-07-23 19:01:26 +00:00
committed by Android (Google) Code Review
3 changed files with 22 additions and 12 deletions

View File

@@ -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);

View File

@@ -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() {

View File

@@ -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();