mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
Updating how widget previews look
Also fixing issue where some widget previews would be way too large when picked up Bug: 6472013 Change-Id: Iebfc33b1070da591a9d1d32d7c8e65a3fb057a7e
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
package com.android.launcher2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Insets;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@@ -34,4 +36,22 @@ class PagedViewWidgetImageView extends ImageView {
|
||||
super.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
|
||||
Insets insets = Insets.NONE;
|
||||
if (getBackground() != null) {
|
||||
insets = getBackground().getLayoutInsets();
|
||||
}
|
||||
canvas.save();
|
||||
canvas.clipRect(getScrollX() + getPaddingLeft() + insets.left,
|
||||
getScrollY() + getPaddingTop() + insets.top,
|
||||
getScrollX() + getRight() - getLeft() - getPaddingRight() - insets.right,
|
||||
getScrollY() + getBottom() - getTop() - getPaddingBottom() - insets.bottom);
|
||||
|
||||
super.onDraw(canvas);
|
||||
canvas.restore();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user