[Predictive Back] Fix predictive back swipe on task bar all apps [1/n]

For taskbar all apps, the background scrim is child view of AbstractSlideInView, thus scaling AbstracSlideInView during PB swipe will scale down background scrim. There is no need to re-apply scale effect on background scrim separately.

Bug: 327490078
Flag: aconfig com.android.launcher3.enable_predictive_back_gesture TEAMFOOD
Test: manual
Change-Id: I125670d14bc788664a1371008589e4106496ae2e
This commit is contained in:
Fengjiang Li
2024-02-29 10:24:37 -08:00
parent 544f6e228c
commit cad1f13d27
3 changed files with 26 additions and 7 deletions

View File

@@ -1372,7 +1372,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
}
@Override
public void drawOnScrimWithScale(Canvas canvas, float scale) {
public void drawOnScrimWithScaleAndBottomOffset(
Canvas canvas, float scale, @Px int bottomOffsetPx) {
final View panel = mBottomSheetBackground;
final boolean hasBottomSheet = panel.getVisibility() == VISIBLE;
final float translationY = ((View) panel.getParent()).getTranslationY();
@@ -1384,6 +1385,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
final float topWithScale = topNoScale + verticalScaleOffset;
final float leftWithScale = panel.getLeft() + horizontalScaleOffset;
final float rightWithScale = panel.getRight() - horizontalScaleOffset;
final float bottomWithOffset = panel.getBottom() + bottomOffsetPx;
// Draw full background panel for tablets.
if (hasBottomSheet) {
mHeaderPaint.setColor(mBottomSheetBackgroundColor);
@@ -1393,7 +1395,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
leftWithScale,
topWithScale,
rightWithScale,
panel.getBottom());
bottomWithOffset);
mTmpPath.reset();
mTmpPath.addRoundRect(mTmpRectF, mBottomSheetCornerRadii, Direction.CW);
canvas.drawPath(mTmpPath, mHeaderPaint);