diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 0b6f9c47ff..0316333a9d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -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); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index f359a3dbaa..4cd681428a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -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. */ diff --git a/src/com/android/launcher3/util/MultiValueAlpha.java b/src/com/android/launcher3/util/MultiValueAlpha.java index 8591872cdc..bd39391f44 100644 --- a/src/com/android/launcher3/util/MultiValueAlpha.java +++ b/src/com/android/launcher3/util/MultiValueAlpha.java @@ -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; } } }