OSDN Git Service

Fixing a couple issues with bad AllApps state
authorAdam Cohen <adamcohen@google.com>
Mon, 8 Sep 2014 17:45:43 +0000 (19:45 +0200)
committerAdam Cohen <adamcohen@google.com>
Tue, 9 Sep 2014 14:25:10 +0000 (16:25 +0200)
Bug 17388923

Change-Id: I8f8a0163c0172d6f286a55d89793b843b092a3ca

src/com/android/launcher3/Launcher.java

index 5c6261d..1b95c2b 100644 (file)
@@ -3469,6 +3469,15 @@ public class Launcher extends Activity
                     fromView.findViewById(R.id.apps_customize_pane_content);
 
             final View page = content.getPageAt(content.getNextPage());
+
+            // We need to hide side pages of the Apps / Widget tray to avoid some ugly edge cases
+            int count = content.getChildCount();
+            for (int i = 0; i < count; i++) {
+                View child = content.getChildAt(i);
+                if (child != page) {
+                    child.setVisibility(View.INVISIBLE);
+                }
+            }
             final View revealView = fromView.findViewById(R.id.fake_page);
 
             // hideAppsCustomizeHelper is called in some cases when it is already hidden
@@ -3615,6 +3624,19 @@ public class Launcher extends Activity
                         page.setLayerType(View.LAYER_TYPE_NONE, null);
                     }
                     content.setPageBackgroundsVisible(true);
+                    // Unhide side pages
+                    int count = content.getChildCount();
+                    for (int i = 0; i < count; i++) {
+                        View child = content.getChildAt(i);
+                        child.setVisibility(View.VISIBLE);
+                    }
+
+                    // Reset page transforms
+                    page.setTranslationX(0);
+                    page.setTranslationY(0);
+                    page.setAlpha(1);
+                    content.setCurrentPage(content.getNextPage());
+
                     mAppsCustomizeContent.updateCurrentPageScroll();
                 }
             });