summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Michael Kwan <mkwan@google.com> 2016-09-15 22:27:52 +0000
committer android-build-merger <android-build-merger@google.com> 2016-09-15 22:27:52 +0000
commite455850fbd6bff2f524a66df9ccc3e8fce3638a7 (patch)
tree73fd837c9944d06d98e8ce755cf9aeebed74caf5
parentbf1849f7620a3d1b9c9d23421d8f29e5db211a80 (diff)
parentb1440bdb17bff2b0b4ac404d52ff67239fd8f8c6 (diff)
Limit translation of bottom panel snapping to not overshoot.
am: b1440bdb17 Change-Id: I5e34ac21774e9c781f3f3aef0b0a37fe81e1f747
-rw-r--r--core/java/com/android/internal/widget/WatchListDecorLayout.java5
1 files 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 538cecaec616..5b49611fa4b0 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());