Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c3e0fc8 authored by Adam Powell's avatar Adam Powell
Browse files

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
parent 751073ac
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3646,7 +3646,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        int count = 0;

        if (down) {
            final int top = listPadding.top - incrementalDeltaY;
            int top = -incrementalDeltaY;
            if ((mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK) {
                top += listPadding.top;
            }
            for (int i = 0; i < childCount; i++) {
                final View child = getChildAt(i);
                if (child.getBottom() >= top) {
@@ -3666,7 +3669,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                }
            }
        } else {
            final int bottom = getHeight() - listPadding.bottom - incrementalDeltaY;
            int bottom = getHeight() - incrementalDeltaY;
            if ((mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK) {
                bottom -= listPadding.bottom;
            }
            for (int i = childCount - 1; i >= 0; i--) {
                final View child = getChildAt(i);
                if (child.getTop() <= bottom) {
+18 −4
Original line number Diff line number Diff line
@@ -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) {

+18 −4
Original line number Diff line number Diff line
@@ -595,13 +595,21 @@ public class ListView extends AbsListView {
    void fillGap(boolean down) {
        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() + mDividerHeight :
                    getListPaddingTop();
                    paddingTop;
            fillDown(mFirstPosition + count, startOffset);
            correctTooHigh(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() - mDividerHeight :
                    getHeight() - getListPaddingBottom();
                    getHeight() - paddingBottom;
            fillUp(mFirstPosition - 1, startOffset);
            correctTooLow(getChildCount());
        }
@@ -621,7 +629,10 @@ public class ListView extends AbsListView {
    private View fillDown(int pos, int nextTop) {
        View selectedView = null;

        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) {
            // is this the selected item?
@@ -651,7 +662,10 @@ public class ListView extends AbsListView {
    private View fillUp(int pos, int nextBottom) {
        View selectedView = null;

        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) {
            // is this the selected item?