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

Commit f1d4cb92 authored by mpodolian's avatar mpodolian
Browse files

Fixed expand bubble stack position after the device is unfolded

This change fixes issue with expanded bubbles stack view misplaced on
foldable device unfolded. Added logic that check if stack is being
displayed on different screen - stack is redrawn.

Fixes: 337164787
Test: Visual
Flag: N/A
Change-Id: I024e6078e132c55b7887da7e6a4161e31d7d65c7
parent f0694c53
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -474,11 +474,16 @@ public class BubbleController implements ConfigurationChangeListener,


        mDisplayController.addDisplayChangingController(
        mDisplayController.addDisplayChangingController(
                (displayId, fromRotation, toRotation, newDisplayAreaInfo, t) -> {
                (displayId, fromRotation, toRotation, newDisplayAreaInfo, t) -> {
                    // This is triggered right before the rotation is applied
                    Rect newScreenBounds = new Rect();
                    if (fromRotation != toRotation) {
                    if (newDisplayAreaInfo != null) {
                        newScreenBounds =
                                newDisplayAreaInfo.configuration.windowConfiguration.getBounds();
                    }
                    // This is triggered right before the rotation or new screen size is applied
                    if (fromRotation != toRotation || !newScreenBounds.equals(mScreenBounds)) {
                        if (mStackView != null) {
                        if (mStackView != null) {
                            // Layout listener set on stackView will update the positioner
                            // Layout listener set on stackView will update the positioner
                            // once the rotation is applied
                            // once the rotation or screen change is applied
                            mStackView.onOrientationChanged();
                            mStackView.onOrientationChanged();
                        }
                        }
                    }
                    }