Bubbles: improve how rotation is listened for
Previously we relied on ConfigurationListener for
rotation, however, this relies on portrait / landscape
rather than the actual rotation of the device (e.g. 90
vs 270) so if the device was rotated from 90 to 270
(both 'landscape') we wouldn't be notified to update the
position of the bubble.
Fix is to use onDisplayChangingListener to get the exact
rotation. This is notified *before* the layout has
happened for the new config so updates to the positioner
have moved into BubbleStackView where there's a layout
listener in response to the orientation.
Fixes: 182172825
Fixes: 172530640
Test: - Have a bubble
- Put device in landscape
- Rotate it to be landscape again but on the other
side
- Rotate back to portrait
=> Note that the bubble is always along the edge
of the phone & never goes off screen or is in
the middle of the screen
=> Also expand the stack in each of these steps to
ensure the bubbles are at the top in portrait
and at the sides in landscape
Test: - Have a bubble, expand it
- Rotate the device several times, make sure the
position of the bubbles & expanded view are
correct
Test: - Have bubbles on left edge
- Change the screen size
=> Notice that the bubbles are placed correctly
Change-Id: I76e97529d991102e5b052176bff29e1063537273
7 files changed