Send bubble bar distance to shell
We previously sent the top coordinate of the bubble bar to shell.
However when the screen height changes, launcher takes a bit longer
to update than shell. So instead of calculating the top coordinate
on the launcher side, we now send the amount of space between the
bubble bar and the bottom of the screen to shell, where we can offset
that as needed.
Bug: 392893178
Flag: com.android.wm.shell.enable_bubble_bar
Test: manual
- send some bubbles
- launch app
- expand
- swipe to home
- fold and unfold
Change-Id: I57b96db49dab1e2304fde8dc55a99eaaf85e40f8
This commit is contained in:
@@ -651,13 +651,15 @@ public class BubbleBarView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bubble bar top coordinate on screen when bar is resting
|
||||
*/
|
||||
public int getRestingTopPositionOnScreen() {
|
||||
int displayHeight = mController.getScreenHeight();
|
||||
/** Get the distance between the bubble bar top coordinate and the bottom of the screen */
|
||||
public int getTopToScreenBottom() {
|
||||
// the bottom of the bubble bar is aligned with the bottom of the screen. the distance
|
||||
// between the top of the bubble bar and the bottom of the screen is the height of the
|
||||
// bubble bar minus the y translation. since the bubble bar is always above the bottom of
|
||||
// the screen, the translation is negative and the overall result is a positive value that
|
||||
// represents the distance
|
||||
int bubbleBarHeight = getBubbleBarBounds().height();
|
||||
return displayHeight - bubbleBarHeight + (int) mController.getBubbleBarTranslationY();
|
||||
return bubbleBarHeight - (int) mController.getBubbleBarTranslationY();
|
||||
}
|
||||
|
||||
/** Returns the bounds with translation that may have been applied. */
|
||||
@@ -1646,9 +1648,6 @@ public class BubbleBarView extends FrameLayout {
|
||||
/** Interface for BubbleBarView to communicate with its controller. */
|
||||
public interface Controller {
|
||||
|
||||
/** Returns the screen height. */
|
||||
int getScreenHeight();
|
||||
|
||||
/** Returns the translation Y that the bubble bar should have. */
|
||||
float getBubbleBarTranslationY();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user