Fix taskbar visibility when default-to-desktop
This CL fixes the taskbar visibility when showLockedTaskbarOnHome is
enabled.
Ife336ebd57eb2f60c2bc33ed6a4527c42111808f wrongly assumes that the
taskbar is always invisible when the launcher is visible, so this CL
fixes the assumption.
Bug: 379870867
Bug: 379785901
Flag: EXEMPT bug fix
Test: manual
Change-Id: I9043898fb499520954ee3c5463ab28208d374875
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index dce377d..8ad913d 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -40,6 +40,7 @@
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
+import android.content.Context;
import android.os.SystemClock;
import android.util.Log;
import android.view.animation.Interpolator;
@@ -581,7 +582,7 @@
float backgroundAlpha = isInLauncher && isTaskbarAlignedWithHotseat() ? 0 : 1;
AnimatedFloat taskbarBgOffset =
mControllers.taskbarDragLayerController.getTaskbarBackgroundOffset();
- boolean showTaskbar = !isInLauncher || isInOverview;
+ boolean showTaskbar = shouldShowTaskbar(mLauncher, isInLauncher, isInOverview);
float taskbarBgOffsetEnd = showTaskbar ? 0f : 1f;
float taskbarBgOffsetStart = showTaskbar ? 1f : 0f;
@@ -714,6 +715,14 @@
return animatorSet;
}
+ private static boolean shouldShowTaskbar(Context context, boolean isInLauncher,
+ boolean isInOverview) {
+ if (DisplayController.showLockedTaskbarOnHome(context) && isInLauncher) {
+ return true;
+ }
+ return !isInLauncher || isInOverview;
+ }
+
private void setupPinnedTaskbarAnimation(AnimatorSet animatorSet, boolean showTaskbar,
AnimatedFloat taskbarBgOffset, float taskbarBgOffsetStart, float taskbarBgOffsetEnd,
long duration, Animator taskbarBackgroundAlpha) {