mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Draw folder leave-behind when opening folder in taskbar
Previously there was only support for CellLayout to draw the leave-behind. Added FolderIconParent interface so any parent can draw the leave-behind, and implement that by TaskbarView. Test: Open folder in Taskber, ensure leave-behind draws Bug: 171917176 Change-Id: I08d1d939a34f971f893994fe05cac972d165ef53
This commit is contained in:
@@ -26,10 +26,11 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.launcher3.CellLayout.ContainerType;
|
||||
import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.widget.LauncherAppWidgetHostView;
|
||||
|
||||
public class ShortcutAndWidgetContainer extends ViewGroup {
|
||||
public class ShortcutAndWidgetContainer extends ViewGroup implements FolderIcon.FolderIconParent {
|
||||
static final String TAG = "ShortcutAndWidgetContainer";
|
||||
|
||||
// These are temporary variables to prevent having to allocate a new object just to
|
||||
@@ -228,4 +229,24 @@ public class ShortcutAndWidgetContainer extends ViewGroup {
|
||||
child.cancelLongPress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFolderLeaveBehindForIcon(FolderIcon child) {
|
||||
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
|
||||
// While the folder is open, the position of the icon cannot change.
|
||||
lp.canReorder = false;
|
||||
if (mContainerType == CellLayout.HOTSEAT) {
|
||||
CellLayout cl = (CellLayout) getParent();
|
||||
cl.setFolderLeaveBehindCell(lp.cellX, lp.cellY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFolderLeaveBehind(FolderIcon child) {
|
||||
((CellLayout.LayoutParams) child.getLayoutParams()).canReorder = true;
|
||||
if (mContainerType == CellLayout.HOTSEAT) {
|
||||
CellLayout cl = (CellLayout) getParent();
|
||||
cl.clearFolderLeaveBehind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user