Fix issue where custom content would show up on boot (issue 10713745)

Change-Id: I1c03784970fe1a88e2561f1c5367979cda825973
This commit is contained in:
Adam Cohen
2013-10-09 18:57:02 -07:00
parent 82e5c98446
commit 21cd002fef
3 changed files with 25 additions and 9 deletions

View File

@@ -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.
*