Fix bubble bar arrow visibility during animation
Bubble bar pointer arrow was being drawn outside of BubbleBarView bounds. This caused issues when alpha was applied to the BubbleBarView. With alpha, BubbleBarView draw was clipped to its bounds and arrow was no longer visible. This led to the arrow flickering during move animations. Move animation updates alpha. Move the pointer arrow inside the bounds of the bar view. Update the bar height to include the arrow. Update callers who rely on bubble bar content height to take into account extra height for the arrow. Bug: 313661121 Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT Test: move bubble bar left and right, observe arrow is visible Change-Id: I05866b5c944361b2f10437c3641527ed3c594047
This commit is contained in:
1 parent
77b6225d91
commit
4186cf1b96
6 files changed
+41
-11
No files matched your search
@@ -110,6 +110,7 @@ public class BubbleBarView extends FrameLayout {
|
||||
private final float mIconSize;
|
||||
// The elevation of the bubbles within the bar
|
||||
private final float mBubbleElevation;
|
||||
private final int mPointerSize;
|
||||
|
||||
// Whether the bar is expanded (i.e. the bubble activity is being displayed).
|
||||
private boolean mIsBarExpanded = false;
|
||||
@@ -166,6 +167,8 @@ public class BubbleBarView extends FrameLayout {
|
||||
mIconSpacing = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_spacing);
|
||||
mIconSize = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_size);
|
||||
mBubbleElevation = getResources().getDimensionPixelSize(R.dimen.bubblebar_icon_elevation);
|
||||
mPointerSize = getResources().getDimensionPixelSize(R.dimen.bubblebar_pointer_size);
|
||||
|
||||
setClipToPadding(false);
|
||||
|
||||
mBubbleBarBackground = new BubbleBarBackground(activityContext,
|
||||
@@ -214,7 +217,7 @@ public class BubbleBarView extends FrameLayout {
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
mBubbleBarBounds.left = left;
|
||||
mBubbleBarBounds.top = top;
|
||||
mBubbleBarBounds.top = top + mPointerSize;
|
||||
mBubbleBarBounds.right = right;
|
||||
mBubbleBarBounds.bottom = bottom;
|
||||
|
||||
@@ -272,6 +275,7 @@ public class BubbleBarView extends FrameLayout {
|
||||
if (bubbleBarLocation != mBubbleBarLocation) {
|
||||
mBubbleBarLocation = bubbleBarLocation;
|
||||
onBubbleBarLocationChanged();
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +348,7 @@ public class BubbleBarView extends FrameLayout {
|
||||
* Updates the bounds with translation that may have been applied and returns the result.
|
||||
*/
|
||||
public Rect getBubbleBarBounds() {
|
||||
mBubbleBarBounds.top = getTop() + (int) getTranslationY();
|
||||
mBubbleBarBounds.top = getTop() + (int) getTranslationY() + mPointerSize;
|
||||
mBubbleBarBounds.bottom = getBottom() + (int) getTranslationY();
|
||||
return mBubbleBarBounds;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user