Merge "Show splash screen in quickswitch if thumbnail wrong aspect/orientation." into tm-qpr-dev

This commit is contained in:
Pat Manning authored and Android (Google) Code Review committed 2022-07-13 13:56:34 +00:00
commit de5be15650
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;
@@ -333,6 +334,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;
@@ -392,7 +394,6 @@ public class TaskView extends FrameLayout implements Reusable {
private boolean mIsClickableAsLiveTile = true;
public TaskView(Context context) {
this(context, null);
}
@@ -660,6 +661,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)) {
@@ -1060,6 +1064,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();