Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61eb1fe0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 2ed55ed9 2f4b18ba
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -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);
+9 −1
Original line number Diff line number Diff line
@@ -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() {
+0 −4
Original line number Diff line number Diff line
@@ -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();