Merge "Draw the workspace scrim in the LauncherRootView instead of DragLayer" into sc-dev

This commit is contained in:
Adam Cohen authored and Android (Google) Code Review committed 2021-02-10 23:33:06 +00:00
commit 12e547f2a8
8 files changed
+165 -58

No files matched your search

+18 -1
View File
@@ -81,6 +81,7 @@ import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.folder.PreviewBackground;
import com.android.launcher3.graphics.DragPreviewProvider;
import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.graphics.WorkspaceDragScrim;
import com.android.launcher3.icons.BitmapRenderer;
import com.android.launcher3.logger.LauncherAtom;
import com.android.launcher3.logging.StatsLogManager;
@@ -199,6 +200,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
private boolean mStripScreensOnPageStopMoving = false;
private DragPreviewProvider mOutlineProvider = null;
private WorkspaceDragScrim mWorkspaceDragScrim;
private boolean mWorkspaceFadeInAdjacentScreens;
final WallpaperOffsetInterpolator mWallpaperOffset;
@@ -1161,6 +1165,19 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
}
}
public void setWorkspaceDragScrim(WorkspaceDragScrim workspaceDragScrim) {
mWorkspaceDragScrim = workspaceDragScrim;
}
@Override
public void invalidate() {
// The workspace scrim may need to be re-rendered based on the workspace scroll
if (mWorkspaceDragScrim != null) {
mWorkspaceDragScrim.invalidate();
}
super.invalidate();
}
@Override
public void computeScroll() {
super.computeScroll();
@@ -2027,7 +2044,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
}
// Invalidating the scrim will also force this CellLayout
// to be invalidated so that it is highlighted if necessary.
mLauncher.getDragLayer().getScrim().invalidate();
mLauncher.getDragLayer().getWorkspaceDragScrim().invalidate();
}
public CellLayout getCurrentDragOverlappingLayout() {