summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 7fc7033fc..ce4a78c3f 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2537,14 +2537,16 @@ public class Launcher extends Activity
boolean allowLongPress = isHotseatLayout(v) || mWorkspace.allowLongPress();
if (allowLongPress && !mDragController.isDragging()) {
if (itemUnderLongClick == null) {
- // User long pressed on empty space
- mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
- HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
- // Disabling reordering until we sort out some issues.
- if (mWorkspace.isInOverviewMode()) {
- mWorkspace.startReordering(v);
- } else {
- mWorkspace.enterOverviewMode();
+ if (mWorkspace.hasNonCustomEmptyScreens()) {
+ // User long pressed on empty space
+ mWorkspace.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+ HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+ // Disabling reordering until we sort out some issues.
+ if (mWorkspace.isInOverviewMode()) {
+ mWorkspace.startReordering(v);
+ } else {
+ mWorkspace.enterOverviewMode();
+ }
}
} else {
if (!(itemUnderLongClick instanceof Folder)) {
@@ -3502,7 +3504,15 @@ public class Launcher extends Activity
@Override
public void bindScreens(ArrayList<Long> orderedScreenIds) {
bindAddScreens(orderedScreenIds);
+
+ // Create the new empty page
mWorkspace.addExtraEmptyScreen();
+
+ // Create the custom content page (this call updates mDefaultScreen which calls
+ // setCurrentPage() so ensure that all pages are added before calling this)
+ if (!mWorkspace.hasCustomContent() && hasCustomContentToLeft()) {
+ mWorkspace.createCustomContentPage();
+ }
}
@Override
@@ -3744,11 +3754,6 @@ public class Launcher extends Activity
mSavedState = null;
}
- // Create the custom content page here before onLayout to prevent flashing
- if (!mWorkspace.hasCustomContent() && hasCustomContentToLeft()) {
- mWorkspace.createCustomContentPage();
- }
-
mWorkspace.restoreInstanceStateForRemainingPages();
// If we received the result of any pending adds while the loader was running (e.g. the