Search in sources :

Example 31 with RemoteTargetHandle

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

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 32 with RemoteTargetHandle

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

the class RecentsView method createAdjacentPageAnimForTaskLaunch.

/**
 * Animate adjacent tasks off screen while scaling up.
 *
 * If launching one of the adjacent tasks, parallax the center task and other adjacent task
 * to the right.
 */
public AnimatorSet createAdjacentPageAnimForTaskLaunch(TaskView tv) {
    AnimatorSet anim = new AnimatorSet();
    int taskIndex = indexOfChild(tv);
    int centerTaskIndex = getCurrentPage();
    boolean launchingCenterTask = taskIndex == centerTaskIndex;
    float toScale = getMaxScaleForFullScreen();
    RecentsView recentsView = tv.getRecentsView();
    if (launchingCenterTask) {
        anim.play(ObjectAnimator.ofFloat(recentsView, RECENTS_SCALE_PROPERTY, toScale));
        anim.play(ObjectAnimator.ofFloat(recentsView, FULLSCREEN_PROGRESS, 1));
    } else {
        // We are launching an adjacent task, so parallax the center and other adjacent task.
        float displacementX = tv.getWidth() * (toScale - 1f);
        float primaryTranslation = mIsRtl ? -displacementX : displacementX;
        anim.play(ObjectAnimator.ofFloat(getPageAt(centerTaskIndex), mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation));
        int runningTaskIndex = recentsView.getRunningTaskIndex();
        if (ENABLE_QUICKSTEP_LIVE_TILE.get() && runningTaskIndex != -1 && runningTaskIndex != taskIndex) {
            for (RemoteTargetHandle remoteHandle : recentsView.getRemoteTargetHandles()) {
                anim.play(ObjectAnimator.ofFloat(remoteHandle.getTaskViewSimulator().taskPrimaryTranslation, AnimatedFloat.VALUE, primaryTranslation));
            }
        }
        int otherAdjacentTaskIndex = centerTaskIndex + (centerTaskIndex - taskIndex);
        if (otherAdjacentTaskIndex >= 0 && otherAdjacentTaskIndex < getPageCount()) {
            PropertyValuesHolder[] properties = new PropertyValuesHolder[3];
            properties[0] = PropertyValuesHolder.ofFloat(mOrientationHandler.getPrimaryViewTranslate(), primaryTranslation);
            properties[1] = PropertyValuesHolder.ofFloat(View.SCALE_X, 1);
            properties[2] = PropertyValuesHolder.ofFloat(View.SCALE_Y, 1);
            anim.play(ObjectAnimator.ofPropertyValuesHolder(getPageAt(otherAdjacentTaskIndex), properties));
        }
    }
    return anim;
}
Also used : RemoteTargetHandle(com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle) PropertyValuesHolder(android.animation.PropertyValuesHolder) AnimatorSet(android.animation.AnimatorSet) TextPaint(android.text.TextPaint) Point(android.graphics.Point)

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