[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

@@ -196,7 +196,13 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarOverla
@Override
protected void dispatchDraw(Canvas canvas) {
mAppsView.drawOnScrimWithScale(canvas, mSlideInViewScale.value);
// We should call drawOnScrimWithBottomOffset() rather than drawOnScrimWithScale(). Because
// for taskbar all apps, the scrim view is a child view of AbstractSlideInView. Thus scaling
// down in AbstractSlideInView#onScaleProgressChanged() with SCALE_PROPERTY has already
// done the job - there is no need to re-apply scale effect here. But it also means we need
// to pass extra bottom offset to background scrim to fill the bottom gap during predictive
// back swipe.
mAppsView.drawOnScrimWithBottomOffset(canvas, getBottomOffsetPx());
super.dispatchDraw(canvas);
}