diff options
Diffstat (limited to 'java/com/android/dialershared/bubble/Bubble.java')
-rw-r--r-- | java/com/android/dialershared/bubble/Bubble.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/java/com/android/dialershared/bubble/Bubble.java b/java/com/android/dialershared/bubble/Bubble.java index dbb5ea759..b3a49bbd3 100644 --- a/java/com/android/dialershared/bubble/Bubble.java +++ b/java/com/android/dialershared/bubble/Bubble.java @@ -647,7 +647,7 @@ public class Bubble { public static final int CHILD_INDEX_ICON = 0; public static final int CHILD_INDEX_TEXT = 1; - private final MoveHandler moveHandler; + private MoveHandler moveHandler; private final WindowRoot root; private final ViewAnimator primaryButton; private final ImageView primaryIcon; @@ -682,6 +682,13 @@ public class Bubble { } return false; }); + root.setOnConfigurationChangedListener( + (configuration) -> { + // The values in the current MoveHandler may be stale, so replace it. Then ensure the + // Window is in bounds + moveHandler = new MoveHandler(primaryButton, Bubble.this); + moveHandler.snapToBounds(); + }); root.setOnTouchListener( (v, event) -> { if (expanded && event.getActionMasked() == MotionEvent.ACTION_OUTSIDE) { |