diff options
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java | 34 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl | 4 |
2 files changed, 31 insertions, 7 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index 98b2431fecd9..9f4389ce7e74 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -1157,12 +1157,29 @@ public class BubbleController implements ConfigurationChangeListener, } /** - * Update expanded state when a single bubble is dragged in Launcher. + * A bubble is being dragged in Launcher. * Will be called only when bubble bar is expanded. - * @param bubbleKey key of the bubble to collapse/expand - * @param isBeingDragged whether the bubble is being dragged + * + * @param bubbleKey key of the bubble being dragged + */ + public void startBubbleDrag(String bubbleKey) { + onBubbleDrag(bubbleKey, true /* isBeingDragged */); + } + + /** + * A bubble is no longer being dragged in Launcher. As was released in given location. + * Will be called only when bubble bar is expanded. + * + * @param bubbleKey key of the bubble being dragged + * @param location location where bubble was released */ - public void onBubbleDrag(String bubbleKey, boolean isBeingDragged) { + public void stopBubbleDrag(String bubbleKey, BubbleBarLocation location) { + mBubblePositioner.setBubbleBarLocation(location); + onBubbleDrag(bubbleKey, false /* isBeingDragged */); + } + + private void onBubbleDrag(String bubbleKey, boolean isBeingDragged) { + // TODO(b/330585402): collapse stack if any bubble is dragged if (mBubbleData.getSelectedBubble() != null && mBubbleData.getSelectedBubble().getKey().equals(bubbleKey)) { // Should collapse/expand only if equals to selected bubble. @@ -2324,8 +2341,13 @@ public class BubbleController implements ConfigurationChangeListener, } @Override - public void onBubbleDrag(String bubbleKey, boolean isBeingDragged) { - mMainExecutor.execute(() -> mController.onBubbleDrag(bubbleKey, isBeingDragged)); + public void startBubbleDrag(String bubbleKey) { + mMainExecutor.execute(() -> mController.startBubbleDrag(bubbleKey)); + } + + @Override + public void stopBubbleDrag(String bubbleKey, BubbleBarLocation location) { + mMainExecutor.execute(() -> mController.stopBubbleDrag(bubbleKey, location)); } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl index c9f0f0d61713..66f77fa6f76d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl @@ -39,11 +39,13 @@ interface IBubbles { oneway void collapseBubbles() = 6; - oneway void onBubbleDrag(in String key, in boolean isBeingDragged) = 7; + oneway void startBubbleDrag(in String key) = 7; oneway void showUserEducation(in int positionX, in int positionY) = 8; oneway void setBubbleBarLocation(in BubbleBarLocation location) = 9; oneway void setBubbleBarBounds(in Rect bubbleBarBounds) = 10; + + oneway void stopBubbleDrag(in String key, in BubbleBarLocation location) = 11; }
\ No newline at end of file |