mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Shrink-wrapped folders
Change-Id: Ida1b5d0bd4d39eabfde9f8a5bee0d4b6e9b33627
This commit is contained in:
@@ -42,6 +42,8 @@ public class DragLayer extends FrameLayout {
|
||||
new ArrayList<AppWidgetResizeFrame>();
|
||||
private AppWidgetResizeFrame mCurrentResizeFrame;
|
||||
private int mXDown, mYDown;
|
||||
private Folder mCurrentFolder = null;
|
||||
private Launcher mLauncher;
|
||||
|
||||
/**
|
||||
* Used to create a new DragLayer from XML.
|
||||
@@ -82,6 +84,18 @@ public class DragLayer extends FrameLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mCurrentFolder != null) {
|
||||
mCurrentFolder.getHitRect(hitRect);
|
||||
int[] screenPos = new int[2];
|
||||
View parent = (View) mCurrentFolder.getParent();
|
||||
if (parent != null) {
|
||||
parent.getLocationOnScreen(screenPos);
|
||||
hitRect.offset(screenPos[0], screenPos[1]);
|
||||
if (!hitRect.contains(x, y)) {
|
||||
mLauncher.closeFolder();
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -237,4 +251,12 @@ public class DragLayer extends FrameLayout {
|
||||
|
||||
resizeFrame.snapToWidget(false);
|
||||
}
|
||||
|
||||
public void setLauncher(Launcher l) {
|
||||
mLauncher = l;
|
||||
}
|
||||
|
||||
public void setCurrentFolder(Folder f) {
|
||||
mCurrentFolder = f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user