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