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

Commit 4de0974c authored by Adam Cohen's avatar Adam Cohen
Browse files

Fix NPE from feedback (issue 12106858)

Change-Id: I63f7f73b85d4c1652d1e722f94c51b567a83cc6b
parent ae4409de
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -1152,6 +1152,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc

    @Override
    protected void dispatchDraw(Canvas canvas) {
        // Find out which screens are visible; as an optimization we only call draw on them
        final int pageCount = getChildCount();
        if (pageCount > 0) {
            int halfScreenSize = getViewportWidth() / 2;
            // mOverScrollX is equal to getScrollX() when we're within the normal scroll range.
            // Otherwise it is equal to the scaled overscroll position.
@@ -1165,9 +1168,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
                mLastScreenCenter = screenCenter;
            }

        // Find out which screens are visible; as an optimization we only call draw on them
        final int pageCount = getChildCount();
        if (pageCount > 0) {
            getVisiblePages(mTempVisiblePagesRange);
            final int leftScreen = mTempVisiblePagesRange[0];
            final int rightScreen = mTempVisiblePagesRange[1];
+1 −1
Original line number Diff line number Diff line
@@ -1666,7 +1666,7 @@ public class Workspace extends SmoothPagedView
                cl.setOverscrollTransformsDirty(true);
            }
        } else {
            if (mOverscrollTransformsSet) {
            if (mOverscrollTransformsSet && getChildCount() > 0) {
                mOverscrollTransformsSet = false;
                ((CellLayout) getChildAt(0)).resetOverscrollTransforms();
                ((CellLayout) getChildAt(getChildCount() - 1)).resetOverscrollTransforms();