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

Commit ae7c6d12 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add hard clip for overscrolled children to not be visible above QSB."...

Merge "Add hard clip for overscrolled children to not be visible above QSB." into ub-launcher3-edmonton-polish
parents 3871e726 b8ca1aa7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -312,6 +312,11 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
        }
    }

    @Override
    public int getCanvasClipTopForOverscroll() {
        return mHeader.getTop();
    }

    private void rebindAdapters(boolean showTabs) {
        rebindAdapters(showTabs, false /* force */);
    }
+13 −1
Original line number Diff line number Diff line
@@ -85,12 +85,24 @@ public class SpringRelativeLayout extends RelativeLayout {
        invalidate();
    }

    /**
     * Used to clip the canvas when drawing child views during overscroll.
     */
    public int getCanvasClipTopForOverscroll() {
        return 0;
    }

    @Override
    protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
        if (mDampedScrollShift != 0 && mSpringViews.get(child.getId())) {
            int saveCount = canvas.save();

            canvas.clipRect(0, getCanvasClipTopForOverscroll(), getWidth(), getHeight());
            canvas.translate(0, mDampedScrollShift);
            boolean result = super.drawChild(canvas, child, drawingTime);
            canvas.translate(0, -mDampedScrollShift);

            canvas.restoreToCount(saveCount);

            return result;
        }
        return super.drawChild(canvas, child, drawingTime);