diff options
author | Mattias Petersson <mattias.petersson@sonyericsson.com> | 2011-04-07 15:46:56 +0200 |
---|---|---|
committer | Johan Redestig <johan.redestig@sonyericsson.com> | 2011-04-07 15:46:56 +0200 |
commit | 5435a06010fb50dd8b495df6b7f21f15d82a2c0a (patch) | |
tree | f6835caa541856dd9f6873a13d4d730412dbd9c8 /core/java/android/widget/ScrollView.java | |
parent | 9907d161584415c81de1099678f160da172fd1a6 (diff) | |
download | frameworks_base-5435a06010fb50dd8b495df6b7f21f15d82a2c0a.zip frameworks_base-5435a06010fb50dd8b495df6b7f21f15d82a2c0a.tar.gz frameworks_base-5435a06010fb50dd8b495df6b7f21f15d82a2c0a.tar.bz2 |
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
Diffstat (limited to 'core/java/android/widget/ScrollView.java')
-rw-r--r-- | core/java/android/widget/ScrollView.java | 6 |
1 files changed, 2 insertions, 4 deletions
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; } |