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

Commit b21fd9cb authored by Sergey Serokurov's avatar Sergey Serokurov Committed by Mady Mellor
Browse files

Take into account cutout when hiding bubble stack in immersive mode

Bug: 215662432
Test: manual, https://drive.google.com/file/d/1bsokIRzrA1g7wn7qrd198UrpVY4_7-7k/view?usp=sharing
Test: atest SystemUITests
Change-Id: Ic70c334e18e6fdf6d9a97e2f23b7e4ac92055249
parent e2f5e4ac
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1049,10 +1049,17 @@ public class BubbleStackView extends FrameLayout

    private final Runnable mAnimateTemporarilyInvisibleImmediate = () -> {
        if (mTemporarilyInvisible && mFlyout.getVisibility() != View.VISIBLE) {
            // To calculate a distance, bubble stack needs to be moved to become hidden,
            // we need to take into account that the bubble stack is positioned on the edge
            // of the available screen rect, which can be offset by system bars and cutouts.
            if (mStackAnimationController.isStackOnLeftSide()) {
                animate().translationX(-mBubbleSize).start();
                int availableRectOffsetX =
                        mPositioner.getAvailableRect().left - mPositioner.getScreenRect().left;
                animate().translationX(-(mBubbleSize + availableRectOffsetX)).start();
            } else {
                animate().translationX(mBubbleSize).start();
                int availableRectOffsetX =
                        mPositioner.getAvailableRect().right - mPositioner.getScreenRect().right;
                animate().translationX(mBubbleSize - availableRectOffsetX).start();
            }
        } else {
            animate().translationX(0).start();