Merge "Ignore padding for drawing round scrollbars." into nyc-mr1-dev

This commit is contained in:
Agnieszka Madurska
2016-07-27 21:36:53 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {