From f473e1d0988bb13874a0774db9cbcd66777f9150 Mon Sep 17 00:00:00 2001 From: yueg Date: Tue, 2 Jan 2018 16:23:14 -0800 Subject: 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 --- java/com/android/newbubble/NewMoveHandler.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'java/com/android/newbubble/NewMoveHandler.java') 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) { -- cgit v1.2.3