diff options
author | Adam Cohen <adamcohen@google.com> | 2013-10-09 18:57:02 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2013-10-10 12:51:44 -0700 |
commit | 21cd002fef13ff0b6336f10f97e29738a2b0ecb9 (patch) | |
tree | d36bc94c8b734d5121528c12c46e8da0d0dd9741 /src/com/android/launcher3/Workspace.java | |
parent | 82e5c98446e1f1765aabca1725cba181a56edcb4 (diff) | |
download | android_packages_apps_Trebuchet-21cd002fef13ff0b6336f10f97e29738a2b0ecb9.tar.gz android_packages_apps_Trebuchet-21cd002fef13ff0b6336f10f97e29738a2b0ecb9.tar.bz2 android_packages_apps_Trebuchet-21cd002fef13ff0b6336f10f97e29738a2b0ecb9.zip |
Fix issue where custom content would show up on boot (issue 10713745)
Change-Id: I1c03784970fe1a88e2561f1c5367979cda825973
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 3c9a139fe..7a1647413 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -538,10 +538,14 @@ public class Workspace extends SmoothPagedView // Ensure that the current page and default page are maintained. mDefaultPage = mOriginalDefaultPage + 1; - setCurrentPage(getCurrentPage() + 1); // Update the custom content hint mLauncher.updateCustomContentHintVisibility(); + if (mRestorePage != INVALID_RESTORE_PAGE) { + mRestorePage = mRestorePage + 1; + } else { + setCurrentPage(getCurrentPage() + 1); + } } public void removeCustomContentPage() { @@ -557,10 +561,14 @@ public class Workspace extends SmoothPagedView // Ensure that the current page and default page are maintained. mDefaultPage = mOriginalDefaultPage - 1; - setCurrentPage(getCurrentPage() - 1); // Update the custom content hint mLauncher.updateCustomContentHintVisibility(); + if (mRestorePage != INVALID_RESTORE_PAGE) { + mRestorePage = mRestorePage - 1; + } else { + setCurrentPage(getCurrentPage() - 1); + } } public void addToCustomContentPage(View customContent, CustomContentCallbacks callbacks, @@ -3722,6 +3730,10 @@ public class Workspace extends SmoothPagedView return mDragInfo; } + public int getRestorePage() { + return getNextPage() - numCustomPages(); + } + /** * Calculate the nearest cell where the given object would be dropped. * |