OSDN Git Service

Don't recreate pages every time you go to All Apps
authorMichael Jurka <mikejurka@google.com>
Wed, 23 Oct 2013 13:38:48 +0000 (15:38 +0200)
committerMichael Jurka <mikejurka@google.com>
Wed, 23 Oct 2013 13:41:49 +0000 (15:41 +0200)
Bug: 11300025

Change-Id: I16ddcf1b435621bb0c0199ca7ac119b9e7ca7214

src/com/android/launcher3/AppsCustomizePagedView.java

index 9b35bb5..0d806bc 100644 (file)
@@ -935,12 +935,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
     }
 
     public void setContentType(ContentType type) {
-        int page = getCurrentPage();
-        if (mContentType != type) {
-            page = 0;
+        // Widgets appear to be cleared every time you leave, always force invalidate for them
+        if (mContentType != type || type == ContentType.Widgets) {
+            int page = (mContentType != type) ? 0 : getCurrentPage();
+            mContentType = type;
+            invalidatePageData(page, true);
         }
-        mContentType = type;
-        invalidatePageData(page, true);
     }
 
     public ContentType getContentType() {