Loading quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -783,7 +783,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener final FloatingWidgetView floatingView = FloatingWidgetView.getFloatingWidgetView(mLauncher, v, widgetBackgroundBounds, new Size(windowTargetBounds.width(), windowTargetBounds.height()), finalWindowRadius); finalWindowRadius, appTargetsAreTranslucent); final float initialWindowRadius = supportsRoundedCornersOnWindows(mLauncher.getResources()) ? floatingView.getInitialCornerRadius() : 0; Loading quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +4 −2 Original line number Diff line number Diff line Loading @@ -1047,7 +1047,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, } protected abstract HomeAnimationFactory createHomeAnimationFactory( ArrayList<IBinder> launchCookies, long duration); ArrayList<IBinder> launchCookies, long duration, boolean isTargetTranslucent); private final TaskStackChangeListener mActivityRestartListener = new TaskStackChangeListener() { @Override Loading Loading @@ -1091,7 +1091,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, final ArrayList<IBinder> cookies = runningTaskTarget != null ? runningTaskTarget.taskInfo.launchCookies : new ArrayList<>(); HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration); boolean isTranslucent = runningTaskTarget != null && runningTaskTarget.isTranslucent; HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration, isTranslucent); mIsSwipingPipToHome = homeAnimFactory.supportSwipePipToHome() && runningTaskTarget != null && runningTaskTarget.taskInfo.pictureInPictureParams != null Loading quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public class FallbackSwipeHandler extends @Override protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies, long duration) { long duration, boolean isTargetTranslucent) { mActiveAnimationFactory = new FallbackHomeAnimationFactory(duration); ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); Intent intent = new Intent(mGestureState.getHomeIntent()); Loading quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +5 −4 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ public class LauncherSwipeHandlerV2 extends @Override protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies, long duration) { long duration, boolean isTargetTranslucent) { if (mActivity == null) { mStateCallback.addChangeListener(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED, isPresent -> mRecentsView.startHome()); Loading @@ -103,7 +103,8 @@ public class LauncherSwipeHandlerV2 extends return new LauncherHomeAnimationFactory(); } if (workspaceView instanceof LauncherAppWidgetHostView) { return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView); return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView, isTargetTranslucent); } return createIconHomeAnimationFactory(workspaceView); } Loading Loading @@ -235,7 +236,7 @@ public class LauncherSwipeHandlerV2 extends } private HomeAnimationFactory createWidgetHomeAnimationFactory( LauncherAppWidgetHostView hostView) { LauncherAppWidgetHostView hostView, boolean isTargetTranslucent) { RectF backgroundLocation = new RectF(); Rect crop = new Rect(); Loading @@ -243,7 +244,7 @@ public class LauncherSwipeHandlerV2 extends Size windowSize = new Size(crop.width(), crop.height()); FloatingWidgetView floatingWidgetView = FloatingWidgetView.getFloatingWidgetView(mActivity, hostView, backgroundLocation, windowSize, mTaskViewSimulator.getCurrentCornerRadius()); mTaskViewSimulator.getCurrentCornerRadius(), isTargetTranslucent); return new LauncherHomeAnimationFactory() { Loading quickstep/src/com/android/quickstep/views/FloatingWidgetView.java +24 −16 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, private Runnable mEndRunnable; private Runnable mFastFinishRunnable; private Runnable mOnTargetChangeRunnable; private boolean mAppTargetIsTranslucent; public FloatingWidgetView(Context context) { this(context, null); Loading Loading @@ -142,10 +143,12 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, } private void init(DragLayer dragLayer, LauncherAppWidgetHostView originalView, RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius) { RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius, boolean appTargetIsTranslucent) { mAppWidgetView = originalView; mAppWidgetView.beginDeferringUpdates(); mBackgroundPosition = widgetBackgroundPosition; mAppTargetIsTranslucent = appTargetIsTranslucent; mEndRunnable = () -> finish(dragLayer); mAppWidgetBackgroundView = RoundedCornerEnforcement.findBackground(mAppWidgetView); Loading @@ -155,11 +158,13 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, getRelativePosition(mAppWidgetBackgroundView, dragLayer, mBackgroundPosition); getRelativePosition(mAppWidgetBackgroundView, mAppWidgetView, mBackgroundOffset); if (!mAppTargetIsTranslucent) { mBackgroundView.init(mAppWidgetView, mAppWidgetBackgroundView, windowCornerRadius); // Layout call before GhostView creation so that the overlaid view isn't clipped layout(0, 0, windowSize.getWidth(), windowSize.getHeight()); mForegroundOverlayView = GhostView.addGhost(mAppWidgetView, this); positionViews(); } mListenerView.setListener(this::fastFinish); dragLayer.addView(mListenerView); Loading @@ -179,7 +184,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, */ public void update(RectF backgroundPosition, float floatingWidgetAlpha, float foregroundAlpha, float fallbackBackgroundAlpha, float cornerRadiusProgress) { if (isUninitialized()) return; if (isUninitialized() || mAppTargetIsTranslucent) return; setAlpha(floatingWidgetAlpha); mBackgroundView.update(cornerRadiusProgress, fallbackBackgroundAlpha); mAppWidgetView.setAlpha(foregroundAlpha); Loading @@ -203,14 +208,17 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, backgroundParams.height = (int) mBackgroundPosition.height(); mBackgroundView.setLayoutParams(backgroundParams); if (mForegroundOverlayView != null) { sTmpMatrix.reset(); float foregroundScale = mBackgroundPosition.width() / mAppWidgetBackgroundView.getWidth(); float foregroundScale = mBackgroundPosition.width() / mAppWidgetBackgroundView.getWidth(); sTmpMatrix.setTranslate(-mBackgroundOffset.left - mAppWidgetView.getLeft(), -mBackgroundOffset.top - mAppWidgetView.getTop()); sTmpMatrix.postScale(foregroundScale, foregroundScale); sTmpMatrix.postTranslate(mBackgroundPosition.left, mBackgroundPosition.top); mForegroundOverlayView.setMatrix(sTmpMatrix); } } private void finish(DragLayer dragLayer) { mAppWidgetView.setAlpha(1f); Loading Loading @@ -254,7 +262,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, */ public static FloatingWidgetView getFloatingWidgetView(Launcher launcher, LauncherAppWidgetHostView originalView, RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius) { Size windowSize, float windowCornerRadius, boolean appTargetsAreTranslucent) { final DragLayer dragLayer = launcher.getDragLayer(); ViewGroup parent = (ViewGroup) dragLayer.getParent(); FloatingWidgetView floatingView = Loading @@ -262,7 +270,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, floatingView.recycle(); floatingView.init(dragLayer, originalView, widgetBackgroundPosition, windowSize, windowCornerRadius); windowCornerRadius, appTargetsAreTranslucent); parent.addView(floatingView); return floatingView; } Loading Loading
quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -783,7 +783,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener final FloatingWidgetView floatingView = FloatingWidgetView.getFloatingWidgetView(mLauncher, v, widgetBackgroundBounds, new Size(windowTargetBounds.width(), windowTargetBounds.height()), finalWindowRadius); finalWindowRadius, appTargetsAreTranslucent); final float initialWindowRadius = supportsRoundedCornersOnWindows(mLauncher.getResources()) ? floatingView.getInitialCornerRadius() : 0; Loading
quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +4 −2 Original line number Diff line number Diff line Loading @@ -1047,7 +1047,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, } protected abstract HomeAnimationFactory createHomeAnimationFactory( ArrayList<IBinder> launchCookies, long duration); ArrayList<IBinder> launchCookies, long duration, boolean isTargetTranslucent); private final TaskStackChangeListener mActivityRestartListener = new TaskStackChangeListener() { @Override Loading Loading @@ -1091,7 +1091,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, final ArrayList<IBinder> cookies = runningTaskTarget != null ? runningTaskTarget.taskInfo.launchCookies : new ArrayList<>(); HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration); boolean isTranslucent = runningTaskTarget != null && runningTaskTarget.isTranslucent; HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration, isTranslucent); mIsSwipingPipToHome = homeAnimFactory.supportSwipePipToHome() && runningTaskTarget != null && runningTaskTarget.taskInfo.pictureInPictureParams != null Loading
quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public class FallbackSwipeHandler extends @Override protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies, long duration) { long duration, boolean isTargetTranslucent) { mActiveAnimationFactory = new FallbackHomeAnimationFactory(duration); ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); Intent intent = new Intent(mGestureState.getHomeIntent()); Loading
quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +5 −4 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ public class LauncherSwipeHandlerV2 extends @Override protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies, long duration) { long duration, boolean isTargetTranslucent) { if (mActivity == null) { mStateCallback.addChangeListener(STATE_LAUNCHER_PRESENT | STATE_HANDLER_INVALIDATED, isPresent -> mRecentsView.startHome()); Loading @@ -103,7 +103,8 @@ public class LauncherSwipeHandlerV2 extends return new LauncherHomeAnimationFactory(); } if (workspaceView instanceof LauncherAppWidgetHostView) { return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView); return createWidgetHomeAnimationFactory((LauncherAppWidgetHostView) workspaceView, isTargetTranslucent); } return createIconHomeAnimationFactory(workspaceView); } Loading Loading @@ -235,7 +236,7 @@ public class LauncherSwipeHandlerV2 extends } private HomeAnimationFactory createWidgetHomeAnimationFactory( LauncherAppWidgetHostView hostView) { LauncherAppWidgetHostView hostView, boolean isTargetTranslucent) { RectF backgroundLocation = new RectF(); Rect crop = new Rect(); Loading @@ -243,7 +244,7 @@ public class LauncherSwipeHandlerV2 extends Size windowSize = new Size(crop.width(), crop.height()); FloatingWidgetView floatingWidgetView = FloatingWidgetView.getFloatingWidgetView(mActivity, hostView, backgroundLocation, windowSize, mTaskViewSimulator.getCurrentCornerRadius()); mTaskViewSimulator.getCurrentCornerRadius(), isTargetTranslucent); return new LauncherHomeAnimationFactory() { Loading
quickstep/src/com/android/quickstep/views/FloatingWidgetView.java +24 −16 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, private Runnable mEndRunnable; private Runnable mFastFinishRunnable; private Runnable mOnTargetChangeRunnable; private boolean mAppTargetIsTranslucent; public FloatingWidgetView(Context context) { this(context, null); Loading Loading @@ -142,10 +143,12 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, } private void init(DragLayer dragLayer, LauncherAppWidgetHostView originalView, RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius) { RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius, boolean appTargetIsTranslucent) { mAppWidgetView = originalView; mAppWidgetView.beginDeferringUpdates(); mBackgroundPosition = widgetBackgroundPosition; mAppTargetIsTranslucent = appTargetIsTranslucent; mEndRunnable = () -> finish(dragLayer); mAppWidgetBackgroundView = RoundedCornerEnforcement.findBackground(mAppWidgetView); Loading @@ -155,11 +158,13 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, getRelativePosition(mAppWidgetBackgroundView, dragLayer, mBackgroundPosition); getRelativePosition(mAppWidgetBackgroundView, mAppWidgetView, mBackgroundOffset); if (!mAppTargetIsTranslucent) { mBackgroundView.init(mAppWidgetView, mAppWidgetBackgroundView, windowCornerRadius); // Layout call before GhostView creation so that the overlaid view isn't clipped layout(0, 0, windowSize.getWidth(), windowSize.getHeight()); mForegroundOverlayView = GhostView.addGhost(mAppWidgetView, this); positionViews(); } mListenerView.setListener(this::fastFinish); dragLayer.addView(mListenerView); Loading @@ -179,7 +184,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, */ public void update(RectF backgroundPosition, float floatingWidgetAlpha, float foregroundAlpha, float fallbackBackgroundAlpha, float cornerRadiusProgress) { if (isUninitialized()) return; if (isUninitialized() || mAppTargetIsTranslucent) return; setAlpha(floatingWidgetAlpha); mBackgroundView.update(cornerRadiusProgress, fallbackBackgroundAlpha); mAppWidgetView.setAlpha(foregroundAlpha); Loading @@ -203,14 +208,17 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, backgroundParams.height = (int) mBackgroundPosition.height(); mBackgroundView.setLayoutParams(backgroundParams); if (mForegroundOverlayView != null) { sTmpMatrix.reset(); float foregroundScale = mBackgroundPosition.width() / mAppWidgetBackgroundView.getWidth(); float foregroundScale = mBackgroundPosition.width() / mAppWidgetBackgroundView.getWidth(); sTmpMatrix.setTranslate(-mBackgroundOffset.left - mAppWidgetView.getLeft(), -mBackgroundOffset.top - mAppWidgetView.getTop()); sTmpMatrix.postScale(foregroundScale, foregroundScale); sTmpMatrix.postTranslate(mBackgroundPosition.left, mBackgroundPosition.top); mForegroundOverlayView.setMatrix(sTmpMatrix); } } private void finish(DragLayer dragLayer) { mAppWidgetView.setAlpha(1f); Loading Loading @@ -254,7 +262,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, */ public static FloatingWidgetView getFloatingWidgetView(Launcher launcher, LauncherAppWidgetHostView originalView, RectF widgetBackgroundPosition, Size windowSize, float windowCornerRadius) { Size windowSize, float windowCornerRadius, boolean appTargetsAreTranslucent) { final DragLayer dragLayer = launcher.getDragLayer(); ViewGroup parent = (ViewGroup) dragLayer.getParent(); FloatingWidgetView floatingView = Loading @@ -262,7 +270,7 @@ public class FloatingWidgetView extends FrameLayout implements AnimatorListener, floatingView.recycle(); floatingView.init(dragLayer, originalView, widgetBackgroundPosition, windowSize, windowCornerRadius); windowCornerRadius, appTargetsAreTranslucent); parent.addView(floatingView); return floatingView; } Loading