diff options
Diffstat (limited to 'java/com/android')
-rw-r--r-- | java/com/android/newbubble/BottomActionViewController.java | 4 | ||||
-rw-r--r-- | java/com/android/newbubble/NewMoveHandler.java | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/java/com/android/newbubble/BottomActionViewController.java b/java/com/android/newbubble/BottomActionViewController.java index 485d04169..04e0e5fe7 100644 --- a/java/com/android/newbubble/BottomActionViewController.java +++ b/java/com/android/newbubble/BottomActionViewController.java @@ -40,8 +40,8 @@ final class BottomActionViewController { private final Context context; private final WindowManager windowManager; private final int gradientHeight; - private final int bottomActionViewTop; private final int textOffsetSize; + private int bottomActionViewTop; private View bottomActionView; private View dismissView; @@ -55,7 +55,6 @@ final class BottomActionViewController { windowManager = context.getSystemService(WindowManager.class); gradientHeight = context.getResources().getDimensionPixelSize(R.dimen.bubble_bottom_action_view_height); - bottomActionViewTop = context.getResources().getDisplayMetrics().heightPixels - gradientHeight; textOffsetSize = context.getResources().getDimensionPixelSize(R.dimen.bubble_bottom_action_text_offset); } @@ -76,6 +75,7 @@ final class BottomActionViewController { // Add the target to the window // TODO(yueg): use TYPE_NAVIGATION_BAR_PANEL to draw over navigation bar + bottomActionViewTop = context.getResources().getDisplayMetrics().heightPixels - gradientHeight; LayoutParams layoutParams = new LayoutParams( LayoutParams.MATCH_PARENT, diff --git a/java/com/android/newbubble/NewMoveHandler.java b/java/com/android/newbubble/NewMoveHandler.java index c00c10729..12e099c3a 100644 --- a/java/com/android/newbubble/NewMoveHandler.java +++ b/java/com/android/newbubble/NewMoveHandler.java @@ -251,6 +251,14 @@ class NewMoveHandler implements OnTouchListener { } } break; + case MotionEvent.ACTION_CANCEL: + if (isMoving) { + snapX(); + isMoving = false; + bubble.onMoveFinish(); + bottomActionViewController.destroyBottomActionView(); + } + break; default: // fall out } return true; |