Bubble v2 dismiss.
Drag and drop bubble to bottom to hide or end call. Flinging to bottom does not trigger the actions. Color/text is not final. Navigation bar is not hiden and the change will be in a following CL.
Bug: 67605985
Test: NewBubbleTest
PiperOrigin-RevId: 180608133
Change-Id: Iff4cb32226d8fbf0f8e5319f6876a1d74c336b4a
diff --git a/java/com/android/newbubble/NewMoveHandler.java b/java/com/android/newbubble/NewMoveHandler.java
index 9e6d955..c00c107 100644
--- a/java/com/android/newbubble/NewMoveHandler.java
+++ b/java/com/android/newbubble/NewMoveHandler.java
@@ -51,6 +51,7 @@
private final int bubbleShadowPaddingHorizontal;
private final int bubbleExpandedViewWidth;
private final float touchSlopSquared;
+ private final BottomActionViewController bottomActionViewController;
private boolean clickable = true;
private boolean isMoving;
@@ -156,6 +157,8 @@
// efficient than needing to take a square root.
touchSlopSquared = (float) Math.pow(ViewConfiguration.get(context).getScaledTouchSlop(), 2);
+ bottomActionViewController = new BottomActionViewController(context);
+
targetView.setOnTouchListener(this);
}
@@ -200,7 +203,9 @@
if (!isMoving) {
isMoving = true;
bubble.onMoveStart();
+ bottomActionViewController.createAndShowBottomActionView();
}
+ bottomActionViewController.highlightIfHover(eventX, eventY);
ensureSprings();
@@ -229,11 +234,16 @@
moveXAnimation.animateToFinalPosition(target.x);
moveYAnimation.animateToFinalPosition(target.y);
+ } else if (bottomActionViewController.isDismissHighlighted()) {
+ bubble.bottomActionDismiss();
+ } else if (bottomActionViewController.isEndCallHighlighted()) {
+ bubble.bottomActionEndCall();
} else {
snapX();
}
isMoving = false;
bubble.onMoveFinish();
+ bottomActionViewController.destroyBottomActionView();
} else {
v.performClick();
if (clickable) {