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