Merge "Remove keepWindowOpaque and have the window always fade out." into sc-v2-dev

This commit is contained in:
TreeHugger Robot 2021-12-03 18:06:24 +00:00 committed by Android (Google) Code Review
commit dff64072ff
2 changed files with 1 additions and 26 deletions

View File

@ -115,8 +115,6 @@ public class LauncherSwipeHandlerV2 extends
} }
private HomeAnimationFactory createIconHomeAnimationFactory(View workspaceView) { private HomeAnimationFactory createIconHomeAnimationFactory(View workspaceView) {
final ResourceProvider rp = DynamicResource.provider(mActivity);
final float transY = dpToPx(rp.getFloat(R.dimen.swipe_up_trans_y_dp));
RectF iconLocation = new RectF(); RectF iconLocation = new RectF();
FloatingIconView floatingIconView = getFloatingIconView(mActivity, workspaceView, FloatingIconView floatingIconView = getFloatingIconView(mActivity, workspaceView,
true /* hideOriginal */, iconLocation, false /* isOpening */); true /* hideOriginal */, iconLocation, false /* isOpening */);
@ -127,19 +125,15 @@ public class LauncherSwipeHandlerV2 extends
return new FloatingViewHomeAnimationFactory(floatingIconView) { return new FloatingViewHomeAnimationFactory(floatingIconView) {
// There is a delay in loading the icon, so we need to keep the window
// opaque until it is ready.
private boolean mIsFloatingIconReady = false;
@Nullable @Nullable
@Override @Override
protected View getViewIgnoredInWorkspaceRevealAnimation() { protected View getViewIgnoredInWorkspaceRevealAnimation() {
return workspaceView; return workspaceView;
} }
@NonNull
@Override @Override
public RectF getWindowTargetRect() { public RectF getWindowTargetRect() {
super.getWindowTargetRect();
return iconLocation; return iconLocation;
} }
@ -151,15 +145,6 @@ public class LauncherSwipeHandlerV2 extends
floatingIconView.setFastFinishRunnable(anim::end); floatingIconView.setFastFinishRunnable(anim::end);
} }
@Override
public boolean keepWindowOpaque() {
if (mIsFloatingIconReady || floatingIconView.isVisibleToUser()) {
mIsFloatingIconReady = true;
return false;
}
return true;
}
@Override @Override
public void update(RectF currentRect, float progress, float radius) { public void update(RectF currentRect, float progress, float radius) {
super.update(currentRect, progress, radius); super.update(currentRect, progress, radius);
@ -214,11 +199,6 @@ public class LauncherSwipeHandlerV2 extends
floatingWidgetView.setFastFinishRunnable(anim::end); floatingWidgetView.setFastFinishRunnable(anim::end);
} }
@Override
public boolean keepWindowOpaque() {
return false;
}
@Override @Override
public void update(RectF currentRect, float progress, float radius) { public void update(RectF currentRect, float progress, float radius) {
super.update(currentRect, progress, radius); super.update(currentRect, progress, radius);

View File

@ -183,8 +183,6 @@ public abstract class SwipeUpAnimationLogic implements
public void setAnimation(RectFSpringAnim anim) { } public void setAnimation(RectFSpringAnim anim) { }
public boolean keepWindowOpaque() { return false; }
public void update(RectF currentRect, float progress, float radius) { } public void update(RectF currentRect, float progress, float radius) { }
public void onCancel() { } public void onCancel() { }
@ -338,9 +336,6 @@ public abstract class SwipeUpAnimationLogic implements
mMatrix.setRectToRect(mCropRectF, mWindowCurrentRect, ScaleToFit.FILL); mMatrix.setRectToRect(mCropRectF, mWindowCurrentRect, ScaleToFit.FILL);
float cornerRadius = Utilities.mapRange(progress, mStartRadius, mEndRadius); float cornerRadius = Utilities.mapRange(progress, mStartRadius, mEndRadius);
float alpha = mAnimationFactory.getWindowAlpha(progress); float alpha = mAnimationFactory.getWindowAlpha(progress);
if (mAnimationFactory.keepWindowOpaque()) {
alpha = 1f;
}
mLocalTransformParams mLocalTransformParams
.setTargetAlpha(alpha) .setTargetAlpha(alpha)
.setCornerRadius(cornerRadius); .setCornerRadius(cornerRadius);