Merge "Hide task bar icons when notification shade is expanded" into sc-v2-dev

This commit is contained in:
Tracy Zhou
2021-09-24 00:57:26 +00:00
committed by Android (Google) Code Review
3 changed files with 25 additions and 4 deletions
@@ -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);
@@ -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.
*/
@@ -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;
}
}
}