Merge "[Live Tile] App surface is above launcher even after reaching Overview" into sc-v2-dev am: d25ee3294c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15158868 Change-Id: Ic6dfce00e0b80adaa26da23b05363578ada8689a
This commit is contained in:
@@ -17,7 +17,6 @@ package com.android.quickstep.util;
|
||||
|
||||
import static com.android.launcher3.states.RotationHelper.deltaRotation;
|
||||
import static com.android.launcher3.touch.PagedOrientationHandler.MATRIX_POST_TRANSLATE;
|
||||
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
|
||||
import static com.android.quickstep.util.RecentsOrientedState.postDisplayRotation;
|
||||
import static com.android.quickstep.util.RecentsOrientedState.preDisplayRotation;
|
||||
import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN;
|
||||
@@ -62,7 +61,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
private final boolean mIsRecentsRtl;
|
||||
|
||||
private final Rect mTaskRect = new Rect();
|
||||
private boolean mDrawsBelowRecents;
|
||||
private final PointF mPivot = new PointF();
|
||||
private DeviceProfile mDp;
|
||||
|
||||
@@ -163,10 +161,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
recentsViewScroll.value = scroll;
|
||||
}
|
||||
|
||||
public void setDrawsBelowRecents(boolean drawsBelowRecents) {
|
||||
mDrawsBelowRecents = drawsBelowRecents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds animation for all the components corresponding to transition from an app to overview.
|
||||
*/
|
||||
@@ -301,12 +295,6 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
builder.withMatrix(mMatrix)
|
||||
.withWindowCrop(mTmpCropRect)
|
||||
.withCornerRadius(getCurrentCornerRadius());
|
||||
|
||||
if (LIVE_TILE.get() && params.getRecentsSurface() != null) {
|
||||
// When relativeLayer = 0, it reverts the surfaces back to the original order.
|
||||
builder.withRelativeLayerTo(params.getRecentsSurface(),
|
||||
mDrawsBelowRecents ? Integer.MIN_VALUE : 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -638,7 +638,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mLiveTileTaskViewSimulator = new TaskViewSimulator(getContext(), getSizeStrategy());
|
||||
mLiveTileTaskViewSimulator.recentsViewScale.value = 1;
|
||||
mLiveTileTaskViewSimulator.setOrientationState(mOrientationState);
|
||||
mLiveTileTaskViewSimulator.setDrawsBelowRecents(true);
|
||||
|
||||
mTintingColor = getForegroundScrimDimColor(context);
|
||||
}
|
||||
@@ -1206,6 +1205,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mLiveTileTaskViewSimulator.taskSecondaryTranslation.value = 0;
|
||||
mLiveTileTaskViewSimulator.fullScreenProgress.value = 0;
|
||||
mLiveTileTaskViewSimulator.recentsViewScale.value = 1;
|
||||
|
||||
mLiveTileParams.setTargetAlpha(1);
|
||||
}
|
||||
if (mRunningTaskTileHidden) {
|
||||
setRunningTaskHidden(mRunningTaskTileHidden);
|
||||
@@ -1591,7 +1592,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
setEnableDrawingLiveTile(false);
|
||||
mLiveTileParams.setTargetSet(null);
|
||||
mLiveTileTaskViewSimulator.setDrawsBelowRecents(true);
|
||||
|
||||
// These are relatively expensive and don't need to be done this frame (RecentsView isn't
|
||||
// visible anyway), so defer by a frame to get off the critical path, e.g. app to home.
|
||||
@@ -2173,6 +2173,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
// Use setFloat instead of setViewAlpha as we want to keep the view visible even when it's
|
||||
// alpha is set to 0 so that it can be recycled in the view pool properly
|
||||
anim.setFloat(taskView, VIEW_ALPHA, 0, clampToProgress(ACCEL, 0, 0.5f));
|
||||
if (LIVE_TILE.get() && taskView.isRunningTask()) {
|
||||
anim.setFloat(mLiveTileParams, TransformParams.TARGET_ALPHA, 0,
|
||||
clampToProgress(ACCEL, 0, 0.5f));
|
||||
}
|
||||
SplitSelectStateController splitController = mSplitPlaceholderView.getSplitController();
|
||||
|
||||
ResourceProvider rp = DynamicResource.provider(mActivity);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
|
||||
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -219,17 +218,7 @@ public class TaskMenuView extends AbstractFloatingView implements OnScrollChange
|
||||
menuOptionView, mActivity.getDeviceProfile());
|
||||
menuOptionView.setEnabled(menuOption.isEnabled());
|
||||
menuOptionView.setAlpha(menuOption.isEnabled() ? 1 : 0.5f);
|
||||
menuOptionView.setOnClickListener(view -> {
|
||||
if (LIVE_TILE.get()) {
|
||||
RecentsView recentsView = mTaskView.getRecentsView();
|
||||
recentsView.switchToScreenshot(null,
|
||||
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
||||
false /* shouldPip */,
|
||||
() -> menuOption.onClick(view)));
|
||||
} else {
|
||||
menuOption.onClick(view);
|
||||
}
|
||||
});
|
||||
menuOptionView.setOnClickListener(menuOption::onClick);
|
||||
mOptionLayout.addView(menuOptionView);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
|
||||
private TaskOverlay mOverlay;
|
||||
private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
private final Paint mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
private final Paint mClearPaint = new Paint();
|
||||
private final Paint mDimmingPaintAfterClearing = new Paint();
|
||||
private final int mDimColor;
|
||||
|
||||
@@ -115,7 +114,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
|
||||
super(context, attrs, defStyleAttr);
|
||||
mPaint.setFilterBitmap(true);
|
||||
mBackgroundPaint.setColor(Color.WHITE);
|
||||
mClearPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
|
||||
mActivity = BaseActivity.fromContext(context);
|
||||
// Initialize with placeholder value. It is overridden later by TaskView
|
||||
mFullscreenParams = TEMP_PARAMS.get(context);
|
||||
@@ -308,7 +306,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
|
||||
float cornerRadius) {
|
||||
if (LIVE_TILE.get()) {
|
||||
if (mTask != null && getTaskView().isRunningTask() && !getTaskView().showScreenshot()) {
|
||||
canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mClearPaint);
|
||||
canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius,
|
||||
mDimmingPaintAfterClearing);
|
||||
return;
|
||||
|
||||
@@ -560,14 +560,8 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
mActivity.getStateManager(), recentsView,
|
||||
recentsView.getDepthController());
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animator) {
|
||||
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(true);
|
||||
mIsClickableAsLiveTile = true;
|
||||
}
|
||||
});
|
||||
@@ -731,7 +725,16 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
private void setIcon(Drawable icon) {
|
||||
if (icon != null) {
|
||||
mIconView.setDrawable(icon);
|
||||
mIconView.setOnClickListener(v -> showTaskMenu());
|
||||
mIconView.setOnClickListener(v -> {
|
||||
if (LIVE_TILE.get() && isRunningTask()) {
|
||||
RecentsView recentsView = getRecentsView();
|
||||
recentsView.switchToScreenshot(
|
||||
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
||||
this::showTaskMenu));
|
||||
} else {
|
||||
showTaskMenu();
|
||||
}
|
||||
});
|
||||
mIconView.setOnLongClickListener(v -> {
|
||||
requestDisallowInterceptTouchEvent(true);
|
||||
return showTaskMenu();
|
||||
|
||||
Reference in New Issue
Block a user