diff options
Diffstat (limited to 'src/com/android/launcher3/Folder.java')
-rw-r--r-- | src/com/android/launcher3/Folder.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index ca82bd1a7..a9134e105 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -146,7 +146,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList Resources res = getResources(); mMaxCountX = (int) grid.numColumns; // Allow scrolling folders when DISABLE_ALL_APPS is true. - if (AppsCustomizePagedView.DISABLE_ALL_APPS) { + if (LauncherAppState.isDisableAllApps()) { mMaxCountY = mMaxNumItems = Integer.MAX_VALUE; } else { mMaxCountY = (int) grid.numRows; @@ -238,7 +238,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList return false; } - mLauncher.dismissFolderCling(null); + mLauncher.getLauncherClings().dismissFolderCling(null); mLauncher.getWorkspace().onDragStartedWithItem(v); mLauncher.getWorkspace().beginDragShared(v, this); @@ -466,7 +466,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList public void onAnimationEnd(Animator animation) { mState = STATE_OPEN; setLayerType(LAYER_TYPE_NONE, null); - Cling cling = mLauncher.showFirstRunFoldersCling(); + Cling cling = mLauncher.getLauncherClings().showFoldersCling(); if (cling != null) { cling.bringScrimToFront(); bringToFront(); @@ -773,7 +773,11 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList } completeDragExit(); } - } else { + } + + // This is kind of hacky, but in general, dropping on the workspace handles removing + // the extra screen, but dropping elsewhere (back to self, or onto delete) doesn't. + if (target != mLauncher.getWorkspace()) { mLauncher.getWorkspace().removeExtraEmptyScreen(true, null); } @@ -1014,7 +1018,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList int contentAreaHeightSpec = MeasureSpec.makeMeasureSpec(getContentAreaHeight(), MeasureSpec.EXACTLY); - if (AppsCustomizePagedView.DISABLE_ALL_APPS) { + if (LauncherAppState.isDisableAllApps()) { // Don't cap the height of the content to allow scrolling. mContent.setFixedSize(getContentAreaWidth(), mContent.getDesiredHeight()); } else { @@ -1103,7 +1107,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList if (getItemCount() <= 1) { // Remove the folder LauncherModel.deleteItemFromDatabase(mLauncher, mInfo); - cellLayout.removeView(mFolderIcon); + if (cellLayout != null) { + // b/12446428 -- sometimes the cell layout has already gone away? + cellLayout.removeView(mFolderIcon); + } if (mFolderIcon instanceof DropTarget) { mDragController.removeDropTarget((DropTarget) mFolderIcon); } |