From b1440bdb17bff2b0b4ac404d52ff67239fd8f8c6 Mon Sep 17 00:00:00 2001 From: Michael Kwan Date: Mon, 12 Sep 2016 22:48:34 -0700 Subject: [PATCH] Limit translation of bottom panel snapping to not overshoot. Bug: 31444693 Change-Id: I84ff0d90eb67c6672dbf81985057bdf844c50cee --- .../com/android/internal/widget/WatchListDecorLayout.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/widget/WatchListDecorLayout.java b/core/java/com/android/internal/widget/WatchListDecorLayout.java index 538cecaec6167..5b49611fa4b09 100644 --- a/core/java/com/android/internal/widget/WatchListDecorLayout.java +++ b/core/java/com/android/internal/widget/WatchListDecorLayout.java @@ -306,8 +306,9 @@ public class WatchListDecorLayout extends FrameLayout if (mListView.getChildCount() > 0) { if (mListView.getLastVisiblePosition() >= mListView.getCount() - 1) { View lastChild = mListView.getChildAt(mListView.getChildCount() - 1); - setScrolling(mBottomPanel, - lastChild.getY() + lastChild.getHeight() - mBottomPanel.getTop()); + setScrolling(mBottomPanel, Math.max( + 0, + lastChild.getY() + lastChild.getHeight() - mBottomPanel.getTop())); } else { // shift to hide the frame, last child is not the last position setScrolling(mBottomPanel, mBottomPanel.getHeight());