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

Commit c2835072 authored by Aga Madurska's avatar Aga Madurska
Browse files

Ignore padding for drawing round scrollbars.

This change is needed to correctly cope eg. with list views
which introduce header and footer view through additional
list view padding.

See ag/1221005 for details.

Bug:30420573
Change-Id: I7c9c0ce2b5ba85429b7921c42e4f97e139814e17
parent 993b4b23
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -14778,26 +14778,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    }
    private void getRoundVerticalScrollBarBounds(Rect bounds) {
        final int inside = (mViewFlags & SCROLLBARS_OUTSIDE_MASK) == 0 ? ~0 : 0;
        int verticalScrollbarPosition = mVerticalScrollbarPosition;
        if (verticalScrollbarPosition == SCROLLBAR_POSITION_DEFAULT) {
            verticalScrollbarPosition = isLayoutRtl() ?
                    SCROLLBAR_POSITION_LEFT : SCROLLBAR_POSITION_RIGHT;
        }
        final int width = mRight - mLeft;
        final int height = mBottom - mTop;
        switch (verticalScrollbarPosition) {
            default:
            case SCROLLBAR_POSITION_RIGHT:
                bounds.left = mScrollX - (mUserPaddingRight & inside);
                break;
            case SCROLLBAR_POSITION_LEFT:
                bounds.left = mScrollX + (mUserPaddingLeft & inside);
                break;
        }
        bounds.top = mScrollY + (mPaddingTop & inside);
        // Do not take padding into account as we always want the scrollbars
        // to hug the screen for round wearable devices.
        bounds.left = mScrollX;
        bounds.top = mScrollY;
        bounds.right = bounds.left + width;
        bounds.bottom = mScrollY + height - (mUserPaddingBottom & inside);
        bounds.bottom = mScrollY + height;
    }
    private void getStraightVerticalScrollBarBounds(Rect bounds) {