Search in sources :

Example 6 with RemoteTargetHandle

use of com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle in project android_packages_apps_Launcher3 by AOSPA.

the class SwipeUpAnimationLogic method createWindowAnimationToHome.

/**
 * Creates an animation that transforms the current app window into the home app.
 * @param startProgress The progress of {@link #mCurrentShift} to start the window from.
 * @param homeAnimationFactory The home animation factory.
 */
protected RectFSpringAnim[] createWindowAnimationToHome(float startProgress, HomeAnimationFactory homeAnimationFactory) {
    // TODO(b/195473584) compute separate end targets for different staged split
    final RectF targetRect = homeAnimationFactory.getWindowTargetRect();
    RectFSpringAnim[] out = new RectFSpringAnim[mRemoteTargetHandles.length];
    Matrix[] homeToWindowPositionMap = new Matrix[mRemoteTargetHandles.length];
    RectF[] startRects = updateProgressForStartRect(homeToWindowPositionMap, startProgress);
    for (int i = 0, mRemoteTargetHandlesLength = mRemoteTargetHandles.length; i < mRemoteTargetHandlesLength; i++) {
        RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
        out[i] = getWindowAnimationToHomeInternal(homeAnimationFactory, targetRect, remoteHandle.getTransformParams(), remoteHandle.getTaskViewSimulator(), startRects[i], homeToWindowPositionMap[i]);
    }
    return out;
}
Also used : RectF(android.graphics.RectF) RectFSpringAnim(com.android.quickstep.util.RectFSpringAnim) RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) Matrix(android.graphics.Matrix)

Example 7 with RemoteTargetHandle

use of com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle in project android_packages_apps_Launcher3 by AOSPA.

the class SwipeUpAnimationLogic method updateProgressForStartRect.

/**
 * Update with start progress for window animation to home.
 * @param outMatrix {@link Matrix} to map a rect in Launcher space to window space.
 * @param startProgress The progress of {@link #mCurrentShift} to start thw window from.
 * @return {@link RectF} represents the bounds as starting point in window space.
 */
protected RectF[] updateProgressForStartRect(Matrix[] outMatrix, float startProgress) {
    mCurrentShift.updateValue(startProgress);
    RectF[] startRects = new RectF[mRemoteTargetHandles.length];
    for (int i = 0, mRemoteTargetHandlesLength = mRemoteTargetHandles.length; i < mRemoteTargetHandlesLength; i++) {
        RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
        TaskViewSimulator tvs = remoteHandle.getTaskViewSimulator();
        tvs.apply(remoteHandle.getTransformParams().setProgress(startProgress));
        startRects[i] = new RectF(tvs.getCurrentCropRect());
        outMatrix[i] = new Matrix();
        tvs.applyWindowToHomeRotation(outMatrix[i]);
        tvs.getCurrentMatrix().mapRect(startRects[i]);
    }
    return startRects;
}
Also used : RectF(android.graphics.RectF) RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) Matrix(android.graphics.Matrix) TaskViewSimulator(com.android.quickstep.util.TaskViewSimulator)

Example 8 with RemoteTargetHandle

use of com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle in project android_packages_apps_Launcher3 by ArrowOS.

the class SwipeUpAnimationLogic method updateProgressForStartRect.

/**
 * Update with start progress for window animation to home.
 * @param outMatrix {@link Matrix} to map a rect in Launcher space to window space.
 * @param startProgress The progress of {@link #mCurrentShift} to start thw window from.
 * @return {@link RectF} represents the bounds as starting point in window space.
 */
protected RectF[] updateProgressForStartRect(Matrix[] outMatrix, float startProgress) {
    mCurrentShift.updateValue(startProgress);
    RectF[] startRects = new RectF[mRemoteTargetHandles.length];
    for (int i = 0, mRemoteTargetHandlesLength = mRemoteTargetHandles.length; i < mRemoteTargetHandlesLength; i++) {
        RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
        TaskViewSimulator tvs = remoteHandle.getTaskViewSimulator();
        tvs.apply(remoteHandle.getTransformParams().setProgress(startProgress));
        startRects[i] = new RectF(tvs.getCurrentCropRect());
        outMatrix[i] = new Matrix();
        tvs.applyWindowToHomeRotation(outMatrix[i]);
        tvs.getCurrentMatrix().mapRect(startRects[i]);
    }
    return startRects;
}
Also used : RectF(android.graphics.RectF) RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) Matrix(android.graphics.Matrix) TaskViewSimulator(com.android.quickstep.util.TaskViewSimulator)

Example 9 with RemoteTargetHandle

use of com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle in project android_packages_apps_Launcher3 by ArrowOS.

the class SwipeUpAnimationLogic method createWindowAnimationToHome.

/**
 * Creates an animation that transforms the current app window into the home app.
 * @param startProgress The progress of {@link #mCurrentShift} to start the window from.
 * @param homeAnimationFactory The home animation factory.
 */
protected RectFSpringAnim[] createWindowAnimationToHome(float startProgress, HomeAnimationFactory homeAnimationFactory) {
    // TODO(b/195473584) compute separate end targets for different staged split
    final RectF targetRect = homeAnimationFactory.getWindowTargetRect();
    RectFSpringAnim[] out = new RectFSpringAnim[mRemoteTargetHandles.length];
    Matrix[] homeToWindowPositionMap = new Matrix[mRemoteTargetHandles.length];
    RectF[] startRects = updateProgressForStartRect(homeToWindowPositionMap, startProgress);
    for (int i = 0, mRemoteTargetHandlesLength = mRemoteTargetHandles.length; i < mRemoteTargetHandlesLength; i++) {
        RemoteTargetHandle remoteHandle = mRemoteTargetHandles[i];
        out[i] = getWindowAnimationToHomeInternal(homeAnimationFactory, targetRect, remoteHandle.getTransformParams(), remoteHandle.getTaskViewSimulator(), startRects[i], homeToWindowPositionMap[i]);
    }
    return out;
}
Also used : RectF(android.graphics.RectF) RectFSpringAnim(com.android.quickstep.util.RectFSpringAnim) RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) Matrix(android.graphics.Matrix)

Example 10 with RemoteTargetHandle

use of com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle in project android_packages_apps_Launcher3 by ArrowOS.

the class AbsSwipeUpHandler method applyScrollAndTransform.

/**
 * Applies the transform on the recents animation
 */
protected void applyScrollAndTransform() {
    // No need to apply any transform if there is ongoing swipe-pip-to-home animator since
    // that animator handles the leash solely.
    boolean notSwipingPipToHome = mRecentsAnimationTargets != null && !mIsSwipingPipToHome;
    boolean setRecentsScroll = mRecentsViewScrollLinked && mRecentsView != null;
    for (RemoteTargetHandle remoteHandle : mRemoteTargetHandles) {
        AnimatorControllerWithResistance playbackController = remoteHandle.getPlaybackController();
        if (playbackController != null) {
            playbackController.setProgress(Math.max(mCurrentShift.value, getScaleProgressDueToScroll()), mDragLengthFactor);
        }
        if (notSwipingPipToHome) {
            TaskViewSimulator taskViewSimulator = remoteHandle.getTaskViewSimulator();
            if (setRecentsScroll) {
                taskViewSimulator.setScroll(mRecentsView.getScrollOffset());
            }
            taskViewSimulator.apply(remoteHandle.getTransformParams());
        }
    }
    ProtoTracer.INSTANCE.get(mContext).scheduleFrameUpdate();
}
Also used : RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) TaskViewSimulator(com.android.quickstep.util.TaskViewSimulator) AnimatorControllerWithResistance(com.android.quickstep.util.AnimatorControllerWithResistance)

Aggregations

RemoteTargetHandle (com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle)32 TaskViewSimulator (com.android.quickstep.util.TaskViewSimulator)20 Matrix (android.graphics.Matrix)16 RectF (android.graphics.RectF)16 Animator (android.animation.Animator)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)12 AnimatorSet (android.animation.AnimatorSet)12 ObjectAnimator (android.animation.ObjectAnimator)12 RemoteAnimationTargetCompat (com.android.systemui.shared.system.RemoteAnimationTargetCompat)12 PropertyValuesHolder (android.animation.PropertyValuesHolder)8 ValueAnimator (android.animation.ValueAnimator)8 Context (android.content.Context)8 Point (android.graphics.Point)8 Rect (android.graphics.Rect)8 TextPaint (android.text.TextPaint)8 DeviceProfile (com.android.launcher3.DeviceProfile)8 AnimatorPlaybackController (com.android.launcher3.anim.AnimatorPlaybackController)8 PendingAnimation (com.android.launcher3.anim.PendingAnimation)8 RemoteAnimationTargets (com.android.quickstep.RemoteAnimationTargets)8 SystemUiProxy (com.android.quickstep.SystemUiProxy)8