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

Commit f6a6c970 authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 5385274 - tabs in browser can't be scrolled

Fix a regression related to optimizing invalidation in scrolling
views.

Change-Id: I6a39075dc830d78436a274935a904a32084defac
parent a53d19dc
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ public class HorizontalScrollView extends FrameLayout {
                    final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS ||
                            (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && range > 0);

                    if (canOverscroll && overScrollBy(deltaX, 0, mScrollX, 0, range, 0,
                    if (overScrollBy(deltaX, 0, mScrollX, 0, range, 0,
                            mOverscrollDistance, 0, true)) {
                        // Break our velocity if we hit a scroll barrier.
                        mVelocityTracker.clear();
@@ -602,16 +602,12 @@ public class HorizontalScrollView extends FrameLayout {
                    velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
                    int initialVelocity = (int) velocityTracker.getXVelocity(mActivePointerId);

                    final int right = getScrollRange();
                    final int overscrollMode = getOverScrollMode();
                    final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS ||
                            (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && right > 0);

                    if (getChildCount() > 0 && canOverscroll) {
                    if (getChildCount() > 0) {
                        if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
                            fling(-initialVelocity);
                        } else {
                            if (mScroller.springBack(mScrollX, mScrollY, 0, right, 0, 0)) {
                            if (mScroller.springBack(mScrollX, mScrollY, 0,
                                    getScrollRange(), 0, 0)) {
                                invalidate();
                            }
                        }
+4 −8
Original line number Diff line number Diff line
@@ -583,7 +583,7 @@ public class ScrollView extends FrameLayout {
                    final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS ||
                            (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && range > 0);

                    if (canOverscroll && overScrollBy(0, deltaY, 0, mScrollY,
                    if (overScrollBy(0, deltaY, 0, mScrollY,
                            0, range, 0, mOverscrollDistance, true)) {
                        // Break our velocity if we hit a scroll barrier.
                        mVelocityTracker.clear();
@@ -616,16 +616,12 @@ public class ScrollView extends FrameLayout {
                    velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
                    int initialVelocity = (int) velocityTracker.getYVelocity(mActivePointerId);

                    final int bottom = getScrollRange();
                    final int overscrollMode = getOverScrollMode();
                    final boolean canOverscroll = overscrollMode == OVER_SCROLL_ALWAYS ||
                            (overscrollMode == OVER_SCROLL_IF_CONTENT_SCROLLS && bottom > 0);

                    if (getChildCount() > 0 && canOverscroll) {
                    if (getChildCount() > 0) {
                        if ((Math.abs(initialVelocity) > mMinimumVelocity)) {
                            fling(-initialVelocity);
                        } else {
                            if (mScroller.springBack(mScrollX, mScrollY, 0, 0, 0, bottom)) {
                            if (mScroller.springBack(mScrollX, mScrollY, 0, 0, 0,
                                    getScrollRange())) {
                                invalidate();
                            }
                        }