mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Add hard clip for overscrolled children to not be visible above QSB.
We lose the RecyclerView fading edge, but this is the simplest/less risky solution. Change-Id: I7aa39a33678ed8a9b9cf9f17c9ad8c14707b0299
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user