summaryrefslogtreecommitdiff
path: root/java/com/android/newbubble/NewMoveHandler.java
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2018-01-02 16:23:14 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-02 16:47:06 -0800
commitf473e1d0988bb13874a0774db9cbcd66777f9150 (patch)
tree0bdad6c3221ca608439b5b518d746ccce89cb120 /java/com/android/newbubble/NewMoveHandler.java
parent31586c7946fdc1a238d64bba07fbab9b0c4ea872 (diff)
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
Diffstat (limited to 'java/com/android/newbubble/NewMoveHandler.java')
-rw-r--r--java/com/android/newbubble/NewMoveHandler.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/com/android/newbubble/NewMoveHandler.java b/java/com/android/newbubble/NewMoveHandler.java
index 9e6d95553..c00c10729 100644
--- a/java/com/android/newbubble/NewMoveHandler.java
+++ b/java/com/android/newbubble/NewMoveHandler.java
@@ -51,6 +51,7 @@ class NewMoveHandler implements OnTouchListener {
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 @@ class NewMoveHandler implements OnTouchListener {
// 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 @@ class NewMoveHandler implements OnTouchListener {
if (!isMoving) {
isMoving = true;
bubble.onMoveStart();
+ bottomActionViewController.createAndShowBottomActionView();
}
+ bottomActionViewController.highlightIfHover(eventX, eventY);
ensureSprings();
@@ -229,11 +234,16 @@ class NewMoveHandler implements OnTouchListener {
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) {