From 87acb4806bc921297384183a5d69eec28cd35f6e Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 23 Aug 2011 17:28:05 -0700 Subject: [PATCH] Fixing issue where rotating device while in widgets pane fails to load. - Removed some unnecessary code related to dialogs. Change-Id: I5abfc7851c78e6597fd49cc96db5b26bd0976c1c --- src/com/android/launcher2/AppsCustomizePagedView.java | 8 ++++++-- src/com/android/launcher2/Launcher.java | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 949d872664..0e442eaebf 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -315,7 +315,11 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen private boolean testDataReady() { // We only do this test once, and we default to the Applications page, so we only really // have to wait for there to be apps. - return !mApps.isEmpty(); + if (mContentType == AppsCustomizePagedView.ContentType.Widgets) { + return !mApps.isEmpty() && !mWidgets.isEmpty(); + } else { + return !mApps.isEmpty(); + } } /** Restores the page for an item at the specified index */ @@ -574,7 +578,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen public void setContentType(ContentType type) { mContentType = type; - invalidatePageData(0, true); + invalidatePageData(0, (type != ContentType.Applications)); } public boolean isContentType(ContentType type) { diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 44dbc15523..055577aa4d 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1060,6 +1060,8 @@ public final class Launcher extends Activity void closeSystemDialogs() { getWindow().closeAllPanels(); + /** + * We should remove this code when we remove all the dialog code. try { dismissDialog(DIALOG_CREATE_SHORTCUT); // Unlock the workspace if the dialog was showing @@ -1073,6 +1075,7 @@ public final class Launcher extends Activity } catch (Exception e) { // An exception is thrown if the dialog is not visible, which is fine } + */ // Whatever we were doing is hereby canceled. mWaitingForResult = false;