From 5435a06010fb50dd8b495df6b7f21f15d82a2c0a Mon Sep 17 00:00:00 2001 From: Mattias Petersson Date: Thu, 7 Apr 2011 15:46:56 +0200 Subject: Scolling using arrow keys with padding It was impossible to reach the end of a large test when scrolling down using the arrowkeys when the ScrollView had padding. A common example of this would be an AlertDialog with a text that is too long to fit on the screen. Change-Id: I55464290a0cdeabde83ccccc76fe8d015ae57a8d --- core/java/android/widget/ScrollView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'core/java/android/widget/ScrollView.java') diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index de38d05..b1e1fbc 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -832,7 +832,7 @@ public class ScrollView extends FrameLayout { int count = getChildCount(); if (count > 0) { View view = getChildAt(count - 1); - mTempRect.bottom = view.getBottom(); + mTempRect.bottom = view.getBottom() + mPaddingBottom; mTempRect.top = mTempRect.bottom - height; } } @@ -912,9 +912,7 @@ public class ScrollView extends FrameLayout { } else if (direction == View.FOCUS_DOWN) { if (getChildCount() > 0) { int daBottom = getChildAt(0).getBottom(); - - int screenBottom = getScrollY() + getHeight(); - + int screenBottom = getScrollY() + getHeight() - mPaddingBottom; if (daBottom - screenBottom < maxJump) { scrollDelta = daBottom - screenBottom; } -- cgit v1.1