Handle taps on the animating bubble

Make the animating bubble touchable and expand the bubble bar when tapping on it.

Demo: http://recall/-/bJtug1HhvXkkeA4MQvIaiP/c4wBVtrT5YIgxL5kVuuoDU

Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT
Bug: 280605846
Test: atest BubbleBarViewAnimatorTest
Change-Id: I09281c2ebc9921750ada42dfc27e95d1ad0bd83b
This commit is contained in:
Liran Binyamin
2024-04-18 11:55:56 -04:00
parent e79120af38
commit a87abece5a
6 changed files with 195 additions and 15 deletions
@@ -139,6 +139,15 @@ public class BubbleBarViewController {
if (bubble == null) {
Log.e(TAG, "bubble click listener, bubble was null");
}
if (mBarView.isAnimatingNewBubble()) {
mBubbleBarViewAnimator.onBubbleClickedWhileAnimating();
mBubbleStashController.showBubbleBarImmediate();
setExpanded(true);
mBubbleBarController.showAndSelectBubble(bubble);
return;
}
final String currentlySelected = mBubbleBarController.getSelectedBubbleKey();
if (mBarView.isExpanded() && Objects.equals(bubble.getKey(), currentlySelected)) {
// Tapping the currently selected bubble while expanded collapses the view.
@@ -214,6 +223,12 @@ public class BubbleBarViewController {
return mBarView.getBubbleBarBounds();
}
/** The bounds of the animating bubble, or {@code null} if no bubble is animating. */
@Nullable
public Rect getAnimatingBubbleBounds() {
return mBarView.getAnimatingBubbleBounds();
}
/** The horizontal margin of the bubble bar from the edge of the screen. */
public int getHorizontalMargin() {
return mBarView.getHorizontalMargin();