Loading core/java/android/view/View.java +15 −10 Original line number Diff line number Diff line Loading @@ -6119,14 +6119,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } x += getScrollX(); y += getScrollY(); if (isVerticalScrollBarEnabled() && !isVerticalScrollBarHidden()) { final boolean canScrollVertically = computeVerticalScrollRange() > computeVerticalScrollExtent(); if (isVerticalScrollBarEnabled() && !isVerticalScrollBarHidden() && canScrollVertically) { final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getVerticalScrollBarBounds(null, touchBounds); if (touchBounds.contains((int) x, (int) y)) { return true; } } if (isHorizontalScrollBarEnabled()) { final boolean canScrollHorizontally = computeHorizontalScrollRange() > computeHorizontalScrollExtent(); if (isHorizontalScrollBarEnabled() && canScrollHorizontally) { final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getHorizontalScrollBarBounds(null, touchBounds); if (touchBounds.contains((int) x, (int) y)) { Loading @@ -6141,18 +6145,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private boolean isOnVerticalScrollbarThumb(float x, float y) { if (mScrollCache == null) { if (mScrollCache == null || !isVerticalScrollBarEnabled() || isVerticalScrollBarHidden()) { return false; } if (isVerticalScrollBarEnabled() && !isVerticalScrollBarHidden()) { final int range = computeVerticalScrollRange(); final int extent = computeVerticalScrollExtent(); if (range > extent) { x += getScrollX(); y += getScrollY(); final Rect bounds = mScrollCache.mScrollBarBounds; final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getVerticalScrollBarBounds(bounds, touchBounds); final int range = computeVerticalScrollRange(); final int offset = computeVerticalScrollOffset(); final int extent = computeVerticalScrollExtent(); final int thumbLength = ScrollBarUtils.getThumbLength(bounds.height(), bounds.width(), extent, range); final int thumbOffset = ScrollBarUtils.getThumbOffset(bounds.height(), thumbLength, Loading @@ -6168,18 +6172,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private boolean isOnHorizontalScrollbarThumb(float x, float y) { if (mScrollCache == null) { if (mScrollCache == null || !isHorizontalScrollBarEnabled()) { return false; } if (isHorizontalScrollBarEnabled()) { final int range = computeHorizontalScrollRange(); final int extent = computeHorizontalScrollExtent(); if (range > extent) { x += getScrollX(); y += getScrollY(); final Rect bounds = mScrollCache.mScrollBarBounds; final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getHorizontalScrollBarBounds(bounds, touchBounds); final int range = computeHorizontalScrollRange(); final int offset = computeHorizontalScrollOffset(); final int extent = computeHorizontalScrollExtent(); final int thumbLength = ScrollBarUtils.getThumbLength(bounds.width(), bounds.height(), extent, range); final int thumbOffset = ScrollBarUtils.getThumbOffset(bounds.width(), thumbLength, Loading
core/java/android/view/View.java +15 −10 Original line number Diff line number Diff line Loading @@ -6119,14 +6119,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } x += getScrollX(); y += getScrollY(); if (isVerticalScrollBarEnabled() && !isVerticalScrollBarHidden()) { final boolean canScrollVertically = computeVerticalScrollRange() > computeVerticalScrollExtent(); if (isVerticalScrollBarEnabled() && !isVerticalScrollBarHidden() && canScrollVertically) { final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getVerticalScrollBarBounds(null, touchBounds); if (touchBounds.contains((int) x, (int) y)) { return true; } } if (isHorizontalScrollBarEnabled()) { final boolean canScrollHorizontally = computeHorizontalScrollRange() > computeHorizontalScrollExtent(); if (isHorizontalScrollBarEnabled() && canScrollHorizontally) { final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getHorizontalScrollBarBounds(null, touchBounds); if (touchBounds.contains((int) x, (int) y)) { Loading @@ -6141,18 +6145,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private boolean isOnVerticalScrollbarThumb(float x, float y) { if (mScrollCache == null) { if (mScrollCache == null || !isVerticalScrollBarEnabled() || isVerticalScrollBarHidden()) { return false; } if (isVerticalScrollBarEnabled() && !isVerticalScrollBarHidden()) { final int range = computeVerticalScrollRange(); final int extent = computeVerticalScrollExtent(); if (range > extent) { x += getScrollX(); y += getScrollY(); final Rect bounds = mScrollCache.mScrollBarBounds; final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getVerticalScrollBarBounds(bounds, touchBounds); final int range = computeVerticalScrollRange(); final int offset = computeVerticalScrollOffset(); final int extent = computeVerticalScrollExtent(); final int thumbLength = ScrollBarUtils.getThumbLength(bounds.height(), bounds.width(), extent, range); final int thumbOffset = ScrollBarUtils.getThumbOffset(bounds.height(), thumbLength, Loading @@ -6168,18 +6172,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } private boolean isOnHorizontalScrollbarThumb(float x, float y) { if (mScrollCache == null) { if (mScrollCache == null || !isHorizontalScrollBarEnabled()) { return false; } if (isHorizontalScrollBarEnabled()) { final int range = computeHorizontalScrollRange(); final int extent = computeHorizontalScrollExtent(); if (range > extent) { x += getScrollX(); y += getScrollY(); final Rect bounds = mScrollCache.mScrollBarBounds; final Rect touchBounds = mScrollCache.mScrollBarTouchBounds; getHorizontalScrollBarBounds(bounds, touchBounds); final int range = computeHorizontalScrollRange(); final int offset = computeHorizontalScrollOffset(); final int extent = computeHorizontalScrollExtent(); final int thumbLength = ScrollBarUtils.getThumbLength(bounds.width(), bounds.height(), extent, range); final int thumbOffset = ScrollBarUtils.getThumbOffset(bounds.width(), thumbLength,