Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +14 −5 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class BubbleStackView extends FrameLayout { private int mBubbleSize; private int mBubblePadding; private int mExpandedViewPadding; private int mExpandedAnimateXDistance; private int mExpandedAnimateYDistance; private int mStatusBarHeight; Loading Loading @@ -317,11 +318,12 @@ public class BubbleStackView extends FrameLayout { mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); int padding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding); mExpandedViewPadding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding); int elevation = res.getDimensionPixelSize(R.dimen.bubble_elevation); mStackAnimationController = new StackAnimationController(); mExpandedAnimationController = new ExpandedAnimationController(mDisplaySize); mExpandedAnimationController = new ExpandedAnimationController( mDisplaySize, mExpandedViewPadding); mSurfaceSynchronizer = synchronizer != null ? synchronizer : DEFAULT_SURFACE_SYNCHRONIZER; mBubbleContainer = new PhysicsAnimationLayout(context); Loading @@ -334,7 +336,8 @@ public class BubbleStackView extends FrameLayout { mExpandedViewContainer = new FrameLayout(context); mExpandedViewContainer.setElevation(elevation); mExpandedViewContainer.setPadding(padding, padding, padding, padding); mExpandedViewContainer.setPadding(mExpandedViewPadding, mExpandedViewPadding, mExpandedViewPadding, mExpandedViewPadding); mExpandedViewContainer.setClipChildren(false); addView(mExpandedViewContainer); Loading Loading @@ -1522,8 +1525,14 @@ public class BubbleStackView extends FrameLayout { Bubble expandedBubble = getExpandedBubble(); if (expandedBubble != null) { BubbleView iconView = expandedBubble.iconView; float pointerPosition = iconView.getTranslationX() + (iconView.getWidth() / 2f); expandedBubble.expandedView.setPointerPosition((int) pointerPosition); float bubbleLeft = iconView.getTranslationX(); float halfBubbleWidth = (iconView.getWidth() / 2f); // Bubbles live in expanded view container (x includes expanded view padding). // Pointer lives in expanded view, which has padding (x does not include padding). // Remove padding when deriving pointer location from bubbles. float pointerX = bubbleLeft - mExpandedViewPadding + halfBubbleWidth; expandedBubble.expandedView.setPointerPosition((int) pointerX); } } Loading packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java +5 −2 Original line number Diff line number Diff line Loading @@ -78,8 +78,11 @@ public class ExpandedAnimationController */ private boolean mSpringingBubbleToTouch = false; public ExpandedAnimationController(Point displaySize) { private int mExpandedViewPadding; public ExpandedAnimationController(Point displaySize, int expandedViewPadding) { mDisplaySize = displaySize; mExpandedViewPadding = expandedViewPadding; } /** Loading Loading @@ -122,7 +125,7 @@ public class ExpandedAnimationController new ChildAnimationConfigurator() { // How much to translate the next bubble, so that it is not overlapping the // previous one. float mTranslateNextBubbleXBy = mBubblePaddingPx; float mTranslateNextBubbleXBy = mExpandedViewPadding + mBubblePaddingPx; @Override public void configureAnimationForChildAtIndex( Loading packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/ExpandedAnimationControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ public class ExpandedAnimationControllerTest extends PhysicsAnimationLayoutTestC @Spy private ExpandedAnimationController mExpandedController = new ExpandedAnimationController(new Point(500, 1000) /* displaySize */); new ExpandedAnimationController( new Point(500, 1000) /* displaySize */, 0 /* expandedViewPadding */); private int mStackOffset; private float mBubblePadding; private float mBubbleSize; Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +14 −5 Original line number Diff line number Diff line Loading @@ -173,6 +173,7 @@ public class BubbleStackView extends FrameLayout { private int mBubbleSize; private int mBubblePadding; private int mExpandedViewPadding; private int mExpandedAnimateXDistance; private int mExpandedAnimateYDistance; private int mStatusBarHeight; Loading Loading @@ -317,11 +318,12 @@ public class BubbleStackView extends FrameLayout { mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); int padding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding); mExpandedViewPadding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding); int elevation = res.getDimensionPixelSize(R.dimen.bubble_elevation); mStackAnimationController = new StackAnimationController(); mExpandedAnimationController = new ExpandedAnimationController(mDisplaySize); mExpandedAnimationController = new ExpandedAnimationController( mDisplaySize, mExpandedViewPadding); mSurfaceSynchronizer = synchronizer != null ? synchronizer : DEFAULT_SURFACE_SYNCHRONIZER; mBubbleContainer = new PhysicsAnimationLayout(context); Loading @@ -334,7 +336,8 @@ public class BubbleStackView extends FrameLayout { mExpandedViewContainer = new FrameLayout(context); mExpandedViewContainer.setElevation(elevation); mExpandedViewContainer.setPadding(padding, padding, padding, padding); mExpandedViewContainer.setPadding(mExpandedViewPadding, mExpandedViewPadding, mExpandedViewPadding, mExpandedViewPadding); mExpandedViewContainer.setClipChildren(false); addView(mExpandedViewContainer); Loading Loading @@ -1522,8 +1525,14 @@ public class BubbleStackView extends FrameLayout { Bubble expandedBubble = getExpandedBubble(); if (expandedBubble != null) { BubbleView iconView = expandedBubble.iconView; float pointerPosition = iconView.getTranslationX() + (iconView.getWidth() / 2f); expandedBubble.expandedView.setPointerPosition((int) pointerPosition); float bubbleLeft = iconView.getTranslationX(); float halfBubbleWidth = (iconView.getWidth() / 2f); // Bubbles live in expanded view container (x includes expanded view padding). // Pointer lives in expanded view, which has padding (x does not include padding). // Remove padding when deriving pointer location from bubbles. float pointerX = bubbleLeft - mExpandedViewPadding + halfBubbleWidth; expandedBubble.expandedView.setPointerPosition((int) pointerX); } } Loading
packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java +5 −2 Original line number Diff line number Diff line Loading @@ -78,8 +78,11 @@ public class ExpandedAnimationController */ private boolean mSpringingBubbleToTouch = false; public ExpandedAnimationController(Point displaySize) { private int mExpandedViewPadding; public ExpandedAnimationController(Point displaySize, int expandedViewPadding) { mDisplaySize = displaySize; mExpandedViewPadding = expandedViewPadding; } /** Loading Loading @@ -122,7 +125,7 @@ public class ExpandedAnimationController new ChildAnimationConfigurator() { // How much to translate the next bubble, so that it is not overlapping the // previous one. float mTranslateNextBubbleXBy = mBubblePaddingPx; float mTranslateNextBubbleXBy = mExpandedViewPadding + mBubblePaddingPx; @Override public void configureAnimationForChildAtIndex( Loading
packages/SystemUI/tests/src/com/android/systemui/bubbles/animation/ExpandedAnimationControllerTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,8 @@ public class ExpandedAnimationControllerTest extends PhysicsAnimationLayoutTestC @Spy private ExpandedAnimationController mExpandedController = new ExpandedAnimationController(new Point(500, 1000) /* displaySize */); new ExpandedAnimationController( new Point(500, 1000) /* displaySize */, 0 /* expandedViewPadding */); private int mStackOffset; private float mBubblePadding; private float mBubbleSize; Loading