Loading quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +1 −2 Original line number Diff line number Diff line Loading @@ -1273,8 +1273,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration, isTranslucent, appCanEnterPip, runningTaskTarget); mIsSwipingPipToHome = !mIsSwipeForStagedSplit && homeAnimFactory.supportSwipePipToHome() && appCanEnterPip; mIsSwipingPipToHome = !mIsSwipeForStagedSplit && appCanEnterPip; final RectFSpringAnim[] windowAnim; if (mIsSwipingPipToHome) { mSwipePipToHomeAnimator = createWindowAnimationToPip( Loading quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +40 −3 Original line number Diff line number Diff line Loading @@ -50,12 +50,14 @@ import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.SpringAnimationBuilder; import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.util.DisplayController; import com.android.quickstep.fallback.FallbackRecentsView; import com.android.quickstep.fallback.RecentsState; Loading Loading @@ -93,6 +95,8 @@ public class FallbackSwipeHandler extends private final Matrix mTmpMatrix = new Matrix(); private float mMaxLauncherScale = 1; private boolean mAppCanEnterPip; public FallbackSwipeHandler(Context context, RecentsAnimationDeviceState deviceState, TaskAnimationManager taskAnimationManager, GestureState gestureState, long touchTimeMs, boolean continuingLastGesture, InputConsumerController inputConsumer) { Loading Loading @@ -135,16 +139,27 @@ public class FallbackSwipeHandler extends protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies, long duration, boolean isTargetTranslucent, boolean appCanEnterPip, RemoteAnimationTargetCompat runningTaskTarget) { mAppCanEnterPip = appCanEnterPip; if (appCanEnterPip) { return new FallbackPipToHomeAnimationFactory(); } mActiveAnimationFactory = new FallbackHomeAnimationFactory(duration); startHomeIntent(mActiveAnimationFactory); return mActiveAnimationFactory; } private void startHomeIntent( @Nullable FallbackHomeAnimationFactory gestureContractAnimationFactory) { ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); Intent intent = new Intent(mGestureState.getHomeIntent()); mActiveAnimationFactory.addGestureContract(intent); if (gestureContractAnimationFactory != null) { gestureContractAnimationFactory.addGestureContract(intent); } try { mContext.startActivity(intent, options.toBundle()); } catch (NullPointerException | ActivityNotFoundException | SecurityException e) { mContext.startActivity(createHomeIntent()); } return mActiveAnimationFactory; } @Override Loading @@ -160,8 +175,19 @@ public class FallbackSwipeHandler extends @Override protected void finishRecentsControllerToHome(Runnable callback) { final Runnable recentsCallback; if (mAppCanEnterPip) { // Make sure Launcher is resumed after auto-enter-pip transition to actually trigger // the PiP task appearing. recentsCallback = () -> { callback.run(); startHomeIntent(null /* gestureContractAnimationFactory */); }; } else { recentsCallback = callback; } mRecentsAnimationController.finish( false /* toRecents */, callback, true /* sendUserLeaveHint */); mAppCanEnterPip /* toRecents */, recentsCallback, true /* sendUserLeaveHint */); } @Override Loading @@ -186,6 +212,17 @@ public class FallbackSwipeHandler extends } } private class FallbackPipToHomeAnimationFactory extends HomeAnimationFactory { @NonNull @Override public AnimatorPlaybackController createActivityAnimationToHome() { // copied from {@link LauncherSwipeHandlerV2.LauncherHomeAnimationFactory} long accuracy = 2 * Math.max(mDp.widthPx, mDp.heightPx); return mActivity.getStateManager().createAnimationToNewWorkspace( RecentsState.HOME, accuracy, StateAnimationConfig.SKIP_ALL_ANIMATIONS); } } private class FallbackHomeAnimationFactory extends HomeAnimationFactory { private final Rect mTempRect = new Rect(); private final TransformParams mHomeAlphaParams = new TransformParams(); Loading quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +0 −5 Original line number Diff line number Diff line Loading @@ -284,10 +284,5 @@ public class LauncherSwipeHandlerV2 extends getViewIgnoredInWorkspaceRevealAnimation()) .start(); } @Override public boolean supportSwipePipToHome() { return true; } } } quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +0 −8 Original line number Diff line number Diff line Loading @@ -183,14 +183,6 @@ public abstract class SwipeUpAnimationLogic implements public void onCancel() { } /** * @return {@code true} if this factory supports animating an Activity to PiP window on * swiping up to home. */ public boolean supportSwipePipToHome() { return false; } /** * @param progress The progress of the animation to the home screen. * @return The current alpha to set on the animating app window. Loading Loading
quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +1 −2 Original line number Diff line number Diff line Loading @@ -1273,8 +1273,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>, HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration, isTranslucent, appCanEnterPip, runningTaskTarget); mIsSwipingPipToHome = !mIsSwipeForStagedSplit && homeAnimFactory.supportSwipePipToHome() && appCanEnterPip; mIsSwipingPipToHome = !mIsSwipeForStagedSplit && appCanEnterPip; final RectFSpringAnim[] windowAnim; if (mIsSwipingPipToHome) { mSwipePipToHomeAnimator = createWindowAnimationToPip( Loading
quickstep/src/com/android/quickstep/FallbackSwipeHandler.java +40 −3 Original line number Diff line number Diff line Loading @@ -50,12 +50,14 @@ import android.view.SurfaceControl; import android.view.SurfaceControl.Transaction; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.SpringAnimationBuilder; import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.util.DisplayController; import com.android.quickstep.fallback.FallbackRecentsView; import com.android.quickstep.fallback.RecentsState; Loading Loading @@ -93,6 +95,8 @@ public class FallbackSwipeHandler extends private final Matrix mTmpMatrix = new Matrix(); private float mMaxLauncherScale = 1; private boolean mAppCanEnterPip; public FallbackSwipeHandler(Context context, RecentsAnimationDeviceState deviceState, TaskAnimationManager taskAnimationManager, GestureState gestureState, long touchTimeMs, boolean continuingLastGesture, InputConsumerController inputConsumer) { Loading Loading @@ -135,16 +139,27 @@ public class FallbackSwipeHandler extends protected HomeAnimationFactory createHomeAnimationFactory(ArrayList<IBinder> launchCookies, long duration, boolean isTargetTranslucent, boolean appCanEnterPip, RemoteAnimationTargetCompat runningTaskTarget) { mAppCanEnterPip = appCanEnterPip; if (appCanEnterPip) { return new FallbackPipToHomeAnimationFactory(); } mActiveAnimationFactory = new FallbackHomeAnimationFactory(duration); startHomeIntent(mActiveAnimationFactory); return mActiveAnimationFactory; } private void startHomeIntent( @Nullable FallbackHomeAnimationFactory gestureContractAnimationFactory) { ActivityOptions options = ActivityOptions.makeCustomAnimation(mContext, 0, 0); Intent intent = new Intent(mGestureState.getHomeIntent()); mActiveAnimationFactory.addGestureContract(intent); if (gestureContractAnimationFactory != null) { gestureContractAnimationFactory.addGestureContract(intent); } try { mContext.startActivity(intent, options.toBundle()); } catch (NullPointerException | ActivityNotFoundException | SecurityException e) { mContext.startActivity(createHomeIntent()); } return mActiveAnimationFactory; } @Override Loading @@ -160,8 +175,19 @@ public class FallbackSwipeHandler extends @Override protected void finishRecentsControllerToHome(Runnable callback) { final Runnable recentsCallback; if (mAppCanEnterPip) { // Make sure Launcher is resumed after auto-enter-pip transition to actually trigger // the PiP task appearing. recentsCallback = () -> { callback.run(); startHomeIntent(null /* gestureContractAnimationFactory */); }; } else { recentsCallback = callback; } mRecentsAnimationController.finish( false /* toRecents */, callback, true /* sendUserLeaveHint */); mAppCanEnterPip /* toRecents */, recentsCallback, true /* sendUserLeaveHint */); } @Override Loading @@ -186,6 +212,17 @@ public class FallbackSwipeHandler extends } } private class FallbackPipToHomeAnimationFactory extends HomeAnimationFactory { @NonNull @Override public AnimatorPlaybackController createActivityAnimationToHome() { // copied from {@link LauncherSwipeHandlerV2.LauncherHomeAnimationFactory} long accuracy = 2 * Math.max(mDp.widthPx, mDp.heightPx); return mActivity.getStateManager().createAnimationToNewWorkspace( RecentsState.HOME, accuracy, StateAnimationConfig.SKIP_ALL_ANIMATIONS); } } private class FallbackHomeAnimationFactory extends HomeAnimationFactory { private final Rect mTempRect = new Rect(); private final TransformParams mHomeAlphaParams = new TransformParams(); Loading
quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +0 −5 Original line number Diff line number Diff line Loading @@ -284,10 +284,5 @@ public class LauncherSwipeHandlerV2 extends getViewIgnoredInWorkspaceRevealAnimation()) .start(); } @Override public boolean supportSwipePipToHome() { return true; } } }
quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +0 −8 Original line number Diff line number Diff line Loading @@ -183,14 +183,6 @@ public abstract class SwipeUpAnimationLogic implements public void onCancel() { } /** * @return {@code true} if this factory supports animating an Activity to PiP window on * swiping up to home. */ public boolean supportSwipePipToHome() { return false; } /** * @param progress The progress of the animation to the home screen. * @return The current alpha to set on the animating app window. Loading