Merge "Don't offset TaskView when it is not in the bounds of parent." into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2023-01-05 23:08:31 +00:00
committed by Android (Google) Code Review

View File

@@ -224,16 +224,6 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
mObscuredTouchRegion = obscuredRegion; mObscuredTouchRegion = obscuredRegion;
} }
private void onLocationChanged(WindowContainerTransaction wct) {
// Update based on the screen bounds
getBoundsOnScreen(mTmpRect);
getRootView().getBoundsOnScreen(mTmpRootRect);
if (!mTmpRootRect.contains(mTmpRect)) {
mTmpRect.offsetTo(0, 0);
}
wct.setBounds(mTaskToken, mTmpRect);
}
/** /**
* Call when view position or size has changed. Do not call when animating. * Call when view position or size has changed. Do not call when animating.
*/ */
@@ -246,10 +236,15 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
if (isUsingShellTransitions() && mTaskViewTransitions.hasPending()) return; if (isUsingShellTransitions() && mTaskViewTransitions.hasPending()) return;
WindowContainerTransaction wct = new WindowContainerTransaction(); WindowContainerTransaction wct = new WindowContainerTransaction();
onLocationChanged(wct); updateWindowBounds(wct);
mSyncQueue.queue(wct); mSyncQueue.queue(wct);
} }
private void updateWindowBounds(WindowContainerTransaction wct) {
getBoundsOnScreen(mTmpRect);
wct.setBounds(mTaskToken, mTmpRect);
}
/** /**
* Release this container if it is initialized. * Release this container if it is initialized.
*/ */
@@ -573,7 +568,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
.apply(); .apply();
// TODO: determine if this is really necessary or not // TODO: determine if this is really necessary or not
onLocationChanged(wct); updateWindowBounds(wct);
} else { } else {
// The surface has already been destroyed before the task has appeared, // The surface has already been destroyed before the task has appeared,
// so go ahead and hide the task entirely // so go ahead and hide the task entirely