Show splash screen in quickswitch if thumbnail wrong aspect/orientation.

Test: manual
Bug: 202826469
Change-Id: I8337876ba26bf82d4f65697a86e6727be713ad53
This commit is contained in:
Pat Manning committed 2022-07-12 18:21:06 +01:00
1 parent 8693d0a52f
commit 0041ae3543
8 files changed
+195 -4

No files matched your search

@@ -18,6 +18,7 @@ package com.android.quickstep.views;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.widget.Toast.LENGTH_SHORT;
import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR;
import static com.android.launcher3.Utilities.comp;
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
@@ -361,6 +362,7 @@ public class TaskView extends FrameLayout implements Reusable {
protected final DigitalWellBeingToast mDigitalWellBeingToast;
private float mFullscreenProgress;
private float mGridProgress;
protected float mOverviewProgress;
private float mNonGridScale = 1;
private float mDismissScale = 1;
protected final FullscreenDrawParams mCurrentFullscreenParams;
@@ -420,7 +422,6 @@ public class TaskView extends FrameLayout implements Reusable {
private boolean mIsClickableAsLiveTile = true;
public TaskView(Context context) {
this(context, null);
}
@@ -688,6 +689,9 @@ public class TaskView extends FrameLayout implements Reusable {
if (freezeTaskList) {
ActivityOptionsCompat.setFreezeRecentTasksList(opts);
}
// TODO(b/202826469): Replace setSplashScreenStyle with setDisableStartingWindow.
opts.setSplashScreenStyle(mSnapshotView.shouldShowSplashView()
? SPLASH_SCREEN_STYLE_SOLID_COLOR : opts.getSplashScreenStyle());
Task.TaskKey key = mTask.key;
UI_HELPER_EXECUTOR.execute(() -> {
if (!ActivityManagerWrapper.getInstance().startActivityFromRecents(key, opts)) {
@@ -1088,6 +1092,21 @@ public class TaskView extends FrameLayout implements Reusable {
return scale;
}
/**
* Updates progress of task view for entering/exiting overview on swipe up/down.
*
* <p>Updates the alpha of any splash screen over the thumbnail if it exists.
*/
public void setOverviewProgress(float overviewProgress) {
mOverviewProgress = overviewProgress;
applyThumbnailSplashAlpha();
}
protected void applyThumbnailSplashAlpha() {
mSnapshotView.setSplashAlpha(
Utilities.mapToRange(mOverviewProgress, 0f, 1f, 1f, 0f, LINEAR));
}
private void setSplitSelectTranslationX(float x) {
mSplitSelectTranslationX = x;
applyTranslationX();