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

Commit 3d458313 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Hide task bar icons when notification shade is expanded

Fixes: 199163951
Test: manual
Change-Id: Id2556aa5f08db55059c95d8c13cdc4d46b7d8c55
parent d8bbdce5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;

import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR;

@@ -156,7 +158,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
                MATCH_PARENT,
                mLastRequestedNonFullscreenHeight,
                TYPE_NAVIGATION_BAR_PANEL,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                        | WindowManager.LayoutParams.FLAG_SLIPPERY,
                PixelFormat.TRANSLUCENT);
        mWindowLayoutParams.setTitle(WINDOW_TITLE);
        mWindowLayoutParams.packageName = getPackageName();
@@ -311,6 +314,10 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
                systemUiStateFlags, forceUpdate);
        mControllers.taskbarViewController.setImeIsVisible(
                mControllers.navbarButtonsViewController.isImeVisible());
        boolean panelExpanded = (systemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0;
        boolean inSettings = (systemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) != 0;
        mControllers.taskbarViewController.setNotificationShadeIsExpanded(
                panelExpanded || inSettings);
        mControllers.taskbarViewController.setRecentsButtonDisabled(
                mControllers.navbarButtonsViewController.isRecentsDisabled());
        mControllers.taskbarKeyguardController.updateStateForSysuiFlags(systemUiStateFlags);
+12 −1
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@ public class TaskbarViewController {
    public static final int ALPHA_INDEX_KEYGUARD = 2;
    public static final int ALPHA_INDEX_STASH = 3;
    public static final int ALPHA_INDEX_RECENTS_DISABLED = 4;
    private static final int NUM_ALPHA_CHANNELS = 5;
    public static final int ALPHA_INDEX_NOTIFICATION_EXPANDED = 5;
    private static final int NUM_ALPHA_CHANNELS = 6;

    private final TaskbarActivityContext mActivity;
    private final TaskbarView mTaskbarView;
@@ -106,6 +107,16 @@ public class TaskbarViewController {
        mTaskbarView.setTouchesEnabled(!isImeVisible);
    }

    /**
     * Should be called when the notification shade is expanded, so we can hide taskbar icons as
     * well. Note that we are animating icons to appear / disappear.
     */
    public void setNotificationShadeIsExpanded(boolean isNotificationShadeExpanded) {
        mTaskbarIconAlpha.getProperty(ALPHA_INDEX_NOTIFICATION_EXPANDED)
                .animateToValue(isNotificationShadeExpanded ? 0 : 1)
                .start();
    }

    /**
     * Should be called when the recents button is disabled, so we can hide taskbar icons as well.
     */
+5 −2
Original line number Diff line number Diff line
@@ -125,10 +125,13 @@ public class MultiValueAlpha {
        }

        /**
         * Creates and returns an Animator from the current value to the given value.
         * Creates and returns an Animator from the current value to the given value. Future
         * animator on the same target automatically cancels the previous one.
         */
        public Animator animateToValue(float value) {
            return ObjectAnimator.ofFloat(this, VALUE, value);
            ObjectAnimator animator = ObjectAnimator.ofFloat(this, VALUE, value);
            animator.setAutoCancel(true);
            return animator;
        }
    }
}