Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −5 Original line number Diff line number Diff line Loading @@ -1109,9 +1109,8 @@ public class BubbleController implements ConfigurationChangeListener, * <p>This is used by external callers (launcher). */ @VisibleForTesting public void expandStackAndSelectBubbleFromLauncher(String key, int bubbleBarOffsetX, int bubbleBarOffsetY) { mBubblePositioner.setBubbleBarPosition(bubbleBarOffsetX, bubbleBarOffsetY); public void expandStackAndSelectBubbleFromLauncher(String key, Rect bubbleBarBounds) { mBubblePositioner.setBubbleBarPosition(bubbleBarBounds); if (BubbleOverflow.KEY.equals(key)) { mBubbleData.setSelectedBubbleFromLauncher(mBubbleData.getOverflow()); Loading Loading @@ -2172,10 +2171,10 @@ public class BubbleController implements ConfigurationChangeListener, } @Override public void showBubble(String key, int bubbleBarOffsetX, int bubbleBarOffsetY) { public void showBubble(String key, Rect bubbleBarBounds) { mMainExecutor.execute( () -> mController.expandStackAndSelectBubbleFromLauncher( key, bubbleBarOffsetX, bubbleBarOffsetY)); key, bubbleBarBounds)); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +8 −14 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.wm.shell.bubbles; import android.content.Context; import android.content.res.Resources; import android.graphics.Insets; import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; Loading Loading @@ -97,7 +96,7 @@ public class BubblePositioner { private PointF mRestingStackPosition; private boolean mShowingInBubbleBar; private final Point mBubbleBarPosition = new Point(); private final Rect mBubbleBarBounds = new Rect(); public BubblePositioner(Context context, WindowManager windowManager) { mContext = context; Loading Loading @@ -791,15 +790,10 @@ public class BubblePositioner { } /** * Sets the position of the bubble bar in screen coordinates. * * @param offsetX the offset of the bubble bar from the edge of the screen on the X axis * @param offsetY the offset of the bubble bar from the edge of the screen on the Y axis * Sets the position of the bubble bar in display coordinates. */ public void setBubbleBarPosition(int offsetX, int offsetY) { mBubbleBarPosition.set( getAvailableRect().width() - offsetX, getAvailableRect().height() + mInsets.top + mInsets.bottom - offsetY); public void setBubbleBarPosition(Rect bubbleBarBounds) { mBubbleBarBounds.set(bubbleBarBounds); } /** Loading @@ -820,7 +814,7 @@ public class BubblePositioner { /** The bottom position of the expanded view when showing above the bubble bar. */ public int getExpandedViewBottomForBubbleBar() { return mBubbleBarPosition.y - mExpandedViewPadding; return mBubbleBarBounds.top - mExpandedViewPadding; } /** Loading @@ -831,9 +825,9 @@ public class BubblePositioner { } /** * Returns the on screen co-ordinates of the bubble bar. * Returns the display coordinates of the bubble bar. */ public Point getBubbleBarPosition() { return mBubbleBarPosition; public Rect getBubbleBarBounds() { return mBubbleBarBounds; } } libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.bubbles; import android.content.Intent; import android.graphics.Rect; import com.android.wm.shell.bubbles.IBubblesListener; /** Loading @@ -29,7 +30,7 @@ interface IBubbles { oneway void unregisterBubbleListener(in IBubblesListener listener) = 2; oneway void showBubble(in String key, in int bubbleBarOffsetX, in int bubbleBarOffsetY) = 3; oneway void showBubble(in String key, in Rect bubbleBarBounds) = 3; oneway void removeBubble(in String key) = 4; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java +4 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.util.Log; import android.util.Size; import android.view.View; Loading Loading @@ -149,12 +150,12 @@ public class BubbleBarAnimationHelper { bbev.setVisibility(VISIBLE); // Set the pivot point for the scale, so the view animates out from the bubble bar. Point bubbleBarPosition = mPositioner.getBubbleBarPosition(); Rect bubbleBarBounds = mPositioner.getBubbleBarBounds(); mExpandedViewContainerMatrix.setScale( 1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT, 1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT, bubbleBarPosition.x, bubbleBarPosition.y); bubbleBarBounds.centerX(), bubbleBarBounds.top); bbev.setAnimationMatrix(mExpandedViewContainerMatrix); Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -2217,7 +2217,8 @@ public class BubblesTest extends SysuiTestCase { FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener(); mBubbleController.registerBubbleStateListener(bubbleStateListener); mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 500, 1000); mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), new Rect(500, 1000, 600, 1100)); assertThat(mBubbleController.getLayerView().isExpanded()).isTrue(); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −5 Original line number Diff line number Diff line Loading @@ -1109,9 +1109,8 @@ public class BubbleController implements ConfigurationChangeListener, * <p>This is used by external callers (launcher). */ @VisibleForTesting public void expandStackAndSelectBubbleFromLauncher(String key, int bubbleBarOffsetX, int bubbleBarOffsetY) { mBubblePositioner.setBubbleBarPosition(bubbleBarOffsetX, bubbleBarOffsetY); public void expandStackAndSelectBubbleFromLauncher(String key, Rect bubbleBarBounds) { mBubblePositioner.setBubbleBarPosition(bubbleBarBounds); if (BubbleOverflow.KEY.equals(key)) { mBubbleData.setSelectedBubbleFromLauncher(mBubbleData.getOverflow()); Loading Loading @@ -2172,10 +2171,10 @@ public class BubbleController implements ConfigurationChangeListener, } @Override public void showBubble(String key, int bubbleBarOffsetX, int bubbleBarOffsetY) { public void showBubble(String key, Rect bubbleBarBounds) { mMainExecutor.execute( () -> mController.expandStackAndSelectBubbleFromLauncher( key, bubbleBarOffsetX, bubbleBarOffsetY)); key, bubbleBarBounds)); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +8 −14 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ package com.android.wm.shell.bubbles; import android.content.Context; import android.content.res.Resources; import android.graphics.Insets; import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.graphics.RectF; Loading Loading @@ -97,7 +96,7 @@ public class BubblePositioner { private PointF mRestingStackPosition; private boolean mShowingInBubbleBar; private final Point mBubbleBarPosition = new Point(); private final Rect mBubbleBarBounds = new Rect(); public BubblePositioner(Context context, WindowManager windowManager) { mContext = context; Loading Loading @@ -791,15 +790,10 @@ public class BubblePositioner { } /** * Sets the position of the bubble bar in screen coordinates. * * @param offsetX the offset of the bubble bar from the edge of the screen on the X axis * @param offsetY the offset of the bubble bar from the edge of the screen on the Y axis * Sets the position of the bubble bar in display coordinates. */ public void setBubbleBarPosition(int offsetX, int offsetY) { mBubbleBarPosition.set( getAvailableRect().width() - offsetX, getAvailableRect().height() + mInsets.top + mInsets.bottom - offsetY); public void setBubbleBarPosition(Rect bubbleBarBounds) { mBubbleBarBounds.set(bubbleBarBounds); } /** Loading @@ -820,7 +814,7 @@ public class BubblePositioner { /** The bottom position of the expanded view when showing above the bubble bar. */ public int getExpandedViewBottomForBubbleBar() { return mBubbleBarPosition.y - mExpandedViewPadding; return mBubbleBarBounds.top - mExpandedViewPadding; } /** Loading @@ -831,9 +825,9 @@ public class BubblePositioner { } /** * Returns the on screen co-ordinates of the bubble bar. * Returns the display coordinates of the bubble bar. */ public Point getBubbleBarPosition() { return mBubbleBarPosition; public Rect getBubbleBarBounds() { return mBubbleBarBounds; } }
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.bubbles; import android.content.Intent; import android.graphics.Rect; import com.android.wm.shell.bubbles.IBubblesListener; /** Loading @@ -29,7 +30,7 @@ interface IBubbles { oneway void unregisterBubbleListener(in IBubblesListener listener) = 2; oneway void showBubble(in String key, in int bubbleBarOffsetX, in int bubbleBarOffsetY) = 3; oneway void showBubble(in String key, in Rect bubbleBarBounds) = 3; oneway void removeBubble(in String key) = 4; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java +4 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; import android.util.Log; import android.util.Size; import android.view.View; Loading Loading @@ -149,12 +150,12 @@ public class BubbleBarAnimationHelper { bbev.setVisibility(VISIBLE); // Set the pivot point for the scale, so the view animates out from the bubble bar. Point bubbleBarPosition = mPositioner.getBubbleBarPosition(); Rect bubbleBarBounds = mPositioner.getBubbleBarBounds(); mExpandedViewContainerMatrix.setScale( 1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT, 1f - EXPANDED_VIEW_ANIMATE_SCALE_AMOUNT, bubbleBarPosition.x, bubbleBarPosition.y); bubbleBarBounds.centerX(), bubbleBarBounds.top); bbev.setAnimationMatrix(mExpandedViewContainerMatrix); Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -2217,7 +2217,8 @@ public class BubblesTest extends SysuiTestCase { FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener(); mBubbleController.registerBubbleStateListener(bubbleStateListener); mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 500, 1000); mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), new Rect(500, 1000, 600, 1100)); assertThat(mBubbleController.getLayerView().isExpanded()).isTrue(); Loading