Revert "Add support for taskbar background to wrap around hotseat"
This reverts commit 5dc07d786fcb910557747d049a6f7857bcc16c75.
Reason for revert: b/360116669
Bug: 345768019
Change-Id: Id70ceed141e2106f746d4a0e68a09675ba45dd28
Fixes: 360116669
Test: open taskbar, open all apps w/ ime, use ime back button
Flag: com.android.launcher3.enable_scaling_reveal_home_animation
diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
index 180af1e..477f90c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java
@@ -24,7 +24,6 @@
import android.animation.Animator;
import android.animation.AnimatorSet;
-import android.graphics.Rect;
import android.window.RemoteTransition;
import androidx.annotation.NonNull;
@@ -190,24 +189,6 @@
}
/**
- * Returns the bounds of launcher's hotseat.
- */
- public void getHotseatBounds(Rect hotseatBoundsOut) {
- DeviceProfile launcherDP = mLauncher.getDeviceProfile();
- if (launcherDP.isQsbInline) {
- // Not currently supported.
- hotseatBoundsOut.setEmpty();
- return;
- }
- int left = (launcherDP.widthPx - launcherDP.getHotseatWidthPx()
- - mLauncher.getHotseat().getUnusedHorizontalSpace()) / 2;
- int right = left + launcherDP.getHotseatWidthPx();
- int bottom = launcherDP.getHotseatLayoutPadding(mLauncher).bottom;
- int top = bottom - launcherDP.hotseatCellHeightPx;
- hotseatBoundsOut.set(left, top, right, bottom);
- }
-
- /**
* Should be called from onResume() and onPause(), and animates the Taskbar accordingly.
*/
@Override
diff --git a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
index fabf3a5..7273fac 100644
--- a/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java
@@ -208,11 +208,8 @@
* Creates and returns a {@link RevealOutlineAnimation} Animator that updates the stashed handle
* shape and size. When stashed, the shape is a thin rounded pill. When unstashed, the shape
* morphs into the size of where the taskbar icons will be.
- *
- * @param taskbarToHotseatOffsets A Rect of offsets used to transform the bounds of the
- * stashed handle to wrap around the hotseat items.
*/
- public Animator createRevealAnimToIsStashed(boolean isStashed, Rect taskbarToHotseatOffsets) {
+ public Animator createRevealAnimToIsStashed(boolean isStashed) {
Rect visualBounds = mControllers.taskbarViewController.getIconLayoutVisualBounds();
float startRadius = mStashedHandleRadius;
@@ -223,13 +220,6 @@
visualBounds.bottom += heightDiff;
startRadius = visualBounds.height() / 2f;
-
- // We use these offsets to create a larger stashed handle to wrap around the items
- // of the hotseat. This is only used for certain animations.
- visualBounds.top += taskbarToHotseatOffsets.top;
- visualBounds.bottom += taskbarToHotseatOffsets.bottom;
- visualBounds.left += taskbarToHotseatOffsets.left;
- visualBounds.right += taskbarToHotseatOffsets.right;
}
final RevealOutlineAnimation handleRevealProvider = new RoundedRectRevealOutlineProvider(
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index 4f9310c..c355e46 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -362,38 +362,6 @@
}
/**
- * Calculate the offsets needed to transform the transient taskbar bounds to the hotseat bounds.
- * @return The offsets will be stored in a Rect
- */
- public Rect calculateTaskbarToHotseatOffsets(Rect hotseatBounds) {
- Rect taskbar = getTransientTaskbarBounds();
- Rect offsets = new Rect();
-
- offsets.left = hotseatBounds.left - taskbar.left;
- offsets.right = hotseatBounds.right - taskbar.right;
-
- int heightDiff = hotseatBounds.height() - taskbar.height();
- offsets.top = (taskbar.height() - heightDiff) / 2;
-
- int gleanedTaskbarPadding = (mDeviceProfile.taskbarHeight
- - getTransientTaskbarBounds().height()) / 2;
- offsets.left -= gleanedTaskbarPadding;
- offsets.top -= gleanedTaskbarPadding;
- offsets.right += gleanedTaskbarPadding;
-
- // Bottom is relative to the bottom of layout, so we can calculate it with padding included.
- offsets.bottom = (hotseatBounds.height() - taskbar.height()) / 2;
-
- // Update bounds in taskbar background
- if (hotseatBounds.isEmpty()) {
- mDragLayer.getTaskbarToHotseatOffsetRect().setEmpty();
- } else {
- mDragLayer.getTaskbarToHotseatOffsetRect().set(offsets);
- }
- return offsets;
- }
-
- /**
* Copy the original DeviceProfile, match the number of hotseat icons and qsb width and update
* the icon size
*/
@@ -1717,18 +1685,6 @@
}
/**
- * Returns the bounds of launcher's hotseat (if exists).
- */
- public void getHotseatBounds(Rect hotseatBoundsOut) {
- TaskbarUIController uiController = mControllers.uiController;
- if (uiController instanceof LauncherTaskbarUIController launcherController) {
- launcherController.getHotseatBounds(hotseatBoundsOut);
- } else {
- hotseatBoundsOut.setEmpty();
- }
- }
-
- /**
* Called when we determine the touchable region.
*
* @param exclude {@code true} then the magnification region computation will omit the window.
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt
index d6ce3a4..c0e921e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt
@@ -21,7 +21,6 @@
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Path
-import android.graphics.Rect
import android.graphics.RectF
import com.android.app.animation.Interpolators
import com.android.internal.policy.ScreenDecorationsUtils
@@ -60,9 +59,6 @@
var translationYForSwipe = 0f
var translationYForStash = 0f
- // When not empty, we can use this to transform transient taskbar background to hotseat bounds.
- val taskbarToHotseatOffsetRect = Rect()
-
private val transientBackgroundBounds = context.transientTaskbarBounds
private val shadowAlpha: Float
@@ -230,12 +226,6 @@
val radius = newBackgroundHeight / 2f
val bottomMarginProgress = bottomMargin * ((1f - progress) / 2f)
- // Used to transform the background so that it wraps around the items on the hotseat.
- val hotseatOffsetLeft = taskbarToHotseatOffsetRect.left * progress
- val hotseatOffsetTop = taskbarToHotseatOffsetRect.top * progress
- val hotseatOffsetRight = taskbarToHotseatOffsetRect.right * progress
- val hotseatOffsetBottom = taskbarToHotseatOffsetRect.bottom * progress
-
// Aligns the bottom with the bottom of the stashed handle.
val bottom =
canvas.height - bottomMargin +
@@ -260,10 +250,10 @@
strokePaint.alpha = (paint.alpha * strokeAlpha) / 255
lastDrawnTransientRect.set(
- transientBackgroundBounds.left + halfWidthDelta + hotseatOffsetLeft,
- bottom - newBackgroundHeight + hotseatOffsetTop,
- transientBackgroundBounds.right - halfWidthDelta + hotseatOffsetRight,
- bottom + hotseatOffsetBottom,
+ transientBackgroundBounds.left + halfWidthDelta,
+ bottom - newBackgroundHeight,
+ transientBackgroundBounds.right - halfWidthDelta,
+ bottom
)
val horizontalInset = fullWidth * widthInsetPercentage
lastDrawnTransientRect.inset(horizontalInset, 0f)
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
index a090956..a9b34d2 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java
@@ -22,7 +22,6 @@
import android.content.Context;
import android.graphics.Canvas;
-import android.graphics.Rect;
import android.graphics.RectF;
import android.media.permission.SafeCloseable;
import android.util.AttributeSet;
@@ -260,11 +259,6 @@
return mBackgroundRenderer.getLastDrawnTransientRect();
}
- /** Returns the rect used to transform transient taskbar to the hotseat */
- public Rect getTaskbarToHotseatOffsetRect() {
- return mBackgroundRenderer.getTaskbarToHotseatOffsetRect();
- }
-
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
TestLogging.recordMotionEvent(TestProtocol.SEQUENCE_MAIN, "Touch event", ev);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
index 7624afb..266f384 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java
@@ -42,7 +42,6 @@
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.app.RemoteAction;
-import android.graphics.Rect;
import android.graphics.drawable.Icon;
import android.os.SystemClock;
import android.util.Log;
@@ -209,7 +208,6 @@
* by not scaling the height of the taskbar background.
*/
private static final int TRANSITION_UNSTASH_SUW_MANUAL = 3;
- private static final Rect EMPTY_RECT = new Rect();
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {
@@ -771,7 +769,7 @@
}
fullLengthAnimatorSet.play(mControllers.stashedHandleViewController
- .createRevealAnimToIsStashed(isStashed, EMPTY_RECT));
+ .createRevealAnimToIsStashed(isStashed));
// Return the stashed handle to its default scale in case it was changed as part of the
// feedforward hint. Note that the reveal animation above also visually scales it.
fullLengthAnimatorSet.play(mTaskbarStashedHandleHintScale.animateToValue(1f));
@@ -821,19 +819,6 @@
}
}
-
- Rect taskbarToHotseatOffsets = new Rect();
- if (enableScalingRevealHomeAnimation() && animationType == TRANSITION_HOME_TO_APP) {
- Rect hotseatRect = new Rect();
- mActivity.getHotseatBounds(hotseatRect);
-
- // Calculate and store offsets so that we can sync with the taskbar stashed handle
- taskbarToHotseatOffsets.set(
- mActivity.calculateTaskbarToHotseatOffsets(hotseatRect));
- as.addListener(AnimatorListeners.forEndCallback(
- () -> mActivity.calculateTaskbarToHotseatOffsets(EMPTY_RECT)));
- }
-
play(as, mTaskbarStashedHandleAlpha.animateToValue(stashedHandleAlphaTarget),
backgroundAndHandleAlphaStartDelay,
backgroundAndHandleAlphaDuration, LINEAR);
@@ -882,12 +867,10 @@
}
mControllers.taskbarViewController.addRevealAnimToIsStashed(skippable, isStashed, duration,
- EMPHASIZED, animationType == TRANSITION_UNSTASH_SUW_MANUAL,
- animationType == TRANSITION_HOME_TO_APP);
+ EMPHASIZED, animationType == TRANSITION_UNSTASH_SUW_MANUAL);
play(skippable, mControllers.stashedHandleViewController
- .createRevealAnimToIsStashed(isStashed, taskbarToHotseatOffsets), 0, duration,
- EMPHASIZED);
+ .createRevealAnimToIsStashed(isStashed), 0, duration, EMPHASIZED);
// Return the stashed handle to its default scale in case it was changed as part of the
// feedforward hint. Note that the reveal animation above also visually scales it.
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 3a84915..b207b37 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -36,7 +36,6 @@
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_ALIGNMENT_ANIM;
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_PINNING_ANIM;
import static com.android.launcher3.util.MultiTranslateDelegate.INDEX_TASKBAR_REVEAL_ANIM;
-import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -671,8 +670,7 @@
* @param interpolator The interpolator to use for all animations.
*/
public void addRevealAnimToIsStashed(AnimatorSet as, boolean isStashed, long duration,
- Interpolator interpolator, boolean dispatchOnAnimationStart,
- boolean isHomeToAppAnimation) {
+ Interpolator interpolator, boolean dispatchOnAnimationStart) {
AnimatorSet reveal = new AnimatorSet();
Rect stashedBounds = new Rect();
@@ -721,21 +719,8 @@
reveal.play(ObjectAnimator.ofFloat(mtd.getTranslationX(INDEX_TASKBAR_REVEAL_ANIM),
MULTI_PROPERTY_VALUE, transX)
.setDuration(duration));
-
- if (enableScalingRevealHomeAnimation()) {
- // Delay y-translation by 1 frame to keep icons within the bounds of the bg.
- int delay = isHomeToAppAnimation ? getSingleFrameMs(mActivity) : 0;
- ObjectAnimator yAnimator =
- ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
- MULTI_PROPERTY_VALUE, transY)
- .setDuration(Math.max(0, duration - delay));
- yAnimator.setStartDelay(delay);
- reveal.play(yAnimator);
- } else {
- reveal.play(
- ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
- MULTI_PROPERTY_VALUE, transY));
- }
+ reveal.play(ObjectAnimator.ofFloat(mtd.getTranslationY(INDEX_TASKBAR_REVEAL_ANIM),
+ MULTI_PROPERTY_VALUE, transY));
as.addListener(forEndCallback(() ->
mtd.setTranslation(INDEX_TASKBAR_REVEAL_ANIM, 0, 0)));
} else {
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index cc5baea..483f5f8 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -1056,6 +1056,7 @@
return mHotseatColumnSpan;
}
+ @VisibleForTesting
public int getHotseatWidthPx() {
return mHotseatWidthPx;
}