diff options
| author | Adam Powell <adamp@google.com> | 2010-11-17 15:13:51 -0800 |
|---|---|---|
| committer | Adam Powell <adamp@google.com> | 2010-11-17 16:01:37 -0800 |
| commit | 8c3e0fc84f69e9fe704dc20dd6c2bab1ce43fe93 (patch) | |
| tree | 7e02ae2d0fdbcb32e65b19ed9fbc8fda53c4a6d2 /core/java/android/widget/GridView.java | |
| parent | 751073ac2d3d8971b7fd3d48b1c0a7ef34ad740c (diff) | |
Fix bug 3207067 - adjust AbsListView content pop-in when clipToPadding=false
Known issue: Dividers are not drawn on top. This should be handled
once overscroll is merged in.
Change-Id: I778703601183f919e7c4345cfc4af6036b4ada4e
Diffstat (limited to 'core/java/android/widget/GridView.java')
| -rw-r--r-- | core/java/android/widget/GridView.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index b963536076e3..114ae81a05b9 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -196,8 +196,12 @@ public class GridView extends AbsListView { final int count = getChildCount(); if (down) { + int paddingTop = 0; + if ((mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK) { + paddingTop = getListPaddingTop(); + } final int startOffset = count > 0 ? - getChildAt(count - 1).getBottom() + verticalSpacing : getListPaddingTop(); + getChildAt(count - 1).getBottom() + verticalSpacing : paddingTop; int position = mFirstPosition + count; if (mStackFromBottom) { position += numColumns - 1; @@ -205,8 +209,12 @@ public class GridView extends AbsListView { fillDown(position, startOffset); correctTooHigh(numColumns, verticalSpacing, getChildCount()); } else { + int paddingBottom = 0; + if ((mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK) { + paddingBottom = getListPaddingBottom(); + } final int startOffset = count > 0 ? - getChildAt(0).getTop() - verticalSpacing : getHeight() - getListPaddingBottom(); + getChildAt(0).getTop() - verticalSpacing : getHeight() - paddingBottom; int position = mFirstPosition; if (!mStackFromBottom) { position -= numColumns; @@ -232,7 +240,10 @@ public class GridView extends AbsListView { private View fillDown(int pos, int nextTop) { View selectedView = null; - final int end = (mBottom - mTop) - mListPadding.bottom; + int end = (mBottom - mTop); + if ((mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK) { + end -= mListPadding.bottom; + } while (nextTop < end && pos < mItemCount) { View temp = makeRow(pos, nextTop, true); @@ -316,7 +327,10 @@ public class GridView extends AbsListView { private View fillUp(int pos, int nextBottom) { View selectedView = null; - final int end = mListPadding.top; + int end = 0; + if ((mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK) { + end = mListPadding.top; + } while (nextBottom > end && pos >= 0) { |
