mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Widget preview improvements
- Make widget preview bitmaps as small as they can be, saving ~0.7-2MB peak memory (5104303) - When adding/dragging a widget, make the drag outline/drag view much more closely match the actual size (5566938) Change-Id: I5b5b7b84fa551d56432a76223b1a9e4de620ff56
This commit is contained in:
@@ -30,6 +30,7 @@ public class PagedViewGridLayout extends GridLayout implements Page {
|
||||
|
||||
private int mCellCountX;
|
||||
private int mCellCountY;
|
||||
private Runnable mOnLayoutListener;
|
||||
|
||||
public PagedViewGridLayout(Context context, int cellCountX, int cellCountY) {
|
||||
super(context, null, 0);
|
||||
@@ -57,6 +58,17 @@ public class PagedViewGridLayout extends GridLayout implements Page {
|
||||
heightMeasureSpec);
|
||||
}
|
||||
|
||||
public void setOnLayoutListener(Runnable r) {
|
||||
mOnLayoutListener = r;
|
||||
}
|
||||
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
if (mOnLayoutListener != null) {
|
||||
mOnLayoutListener.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
boolean result = super.onTouchEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user