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

Commit 2debd80f authored by Tony Wickham's avatar Tony Wickham
Browse files

Hide nav handle/background when taskbar is showing

Test: nav handle isn't showing unless taskbar is hidden or removed
Fixes: 181206743
Bug: 171917176
Change-Id: I84b7d0bba1a5d208b1f8b1b467faf79f04078348
parent af0d09b9
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ public class TaskbarVisibilityController {
    }

    protected void cleanup() {
        setNavBarButtonAlpha(1f);
    }

    protected AnimatedFloat getTaskbarVisibilityForLauncherState() {
@@ -93,6 +94,14 @@ public class TaskbarVisibilityController {
        float alphaDueToLauncher = Math.max(mTaskbarBackgroundAlpha.value,
                mTaskbarVisibilityAlphaForLauncherState.value);
        float alphaDueToOther = mTaskbarVisibilityAlphaForIme.value;
        mTaskbarCallbacks.updateTaskbarVisibilityAlpha(alphaDueToLauncher * alphaDueToOther);
        float taskbarAlpha = alphaDueToLauncher * alphaDueToOther;
        mTaskbarCallbacks.updateTaskbarVisibilityAlpha(taskbarAlpha);

        // Make the nav bar invisible if taskbar is visible.
        setNavBarButtonAlpha(1f - taskbarAlpha);
    }

    private void setNavBarButtonAlpha(float navBarAlpha) {
        SystemUiProxy.INSTANCE.get(mLauncher).setNavBarButtonAlpha(navBarAlpha, false);
    }
}
+4 −1
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ public class SystemUiProxy implements ISystemUiProxy,
    private boolean mLastShelfVisible;
    private float mLastNavButtonAlpha;
    private boolean mLastNavButtonAnimate;
    private boolean mHasNavButtonAlphaBeenSet = false;

    // TODO(141886704): Find a way to remove this
    private int mLastSystemUiStateFlags;
@@ -163,10 +164,12 @@ public class SystemUiProxy implements ISystemUiProxy,
    @Override
    public void setNavBarButtonAlpha(float alpha, boolean animate) {
        boolean changed = Float.compare(alpha, mLastNavButtonAlpha) != 0
                || animate != mLastNavButtonAnimate;
                || animate != mLastNavButtonAnimate
                || !mHasNavButtonAlphaBeenSet;
        if (mSystemUiProxy != null && changed) {
            mLastNavButtonAlpha = alpha;
            mLastNavButtonAnimate = animate;
            mHasNavButtonAlphaBeenSet = true;
            try {
                mSystemUiProxy.setNavBarButtonAlpha(alpha, animate);
            } catch (RemoteException e) {