Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28a94594 authored by Gaurav Bhola's avatar Gaurav Bhola Committed by Android (Google) Code Review
Browse files

Merge "Don't offset TaskView when it is not in the bounds of parent."

parents 75370397 06b8e04c
Loading
Loading
Loading
Loading
+7 −12
Original line number Diff line number Diff line
@@ -223,16 +223,6 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
        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.
     */
@@ -245,10 +235,15 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
        if (isUsingShellTransitions() && mTaskViewTransitions.hasPending()) return;

        WindowContainerTransaction wct = new WindowContainerTransaction();
        onLocationChanged(wct);
        updateWindowBounds(wct);
        mSyncQueue.queue(wct);
    }

    private void updateWindowBounds(WindowContainerTransaction wct) {
        getBoundsOnScreen(mTmpRect);
        wct.setBounds(mTaskToken, mTmpRect);
    }

    /**
     * Release this container if it is initialized.
     */
@@ -572,7 +567,7 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
                    .apply();

            // TODO: determine if this is really necessary or not
            onLocationChanged(wct);
            updateWindowBounds(wct);
        } else {
            // The surface has already been destroyed before the task has appeared,
            // so go ahead and hide the task entirely