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;
}
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;
}
Aggregations