Initial changes to support a fixed all-apps layout.

- Dynamically update padding and background depending on fixed bounds and searchbar
- Fixes issue with drag layer bg getting clobbered when rotating launcher
- Tapping outside the bounds of all apps should close all apps
- Fixing typo causing widgets to not show in sw720dp devices

Bug: 20127840

Change-Id: I29c3f905bdee940f938ffe054f58434887073092
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
index e92bfb0..57bd5b2 100644
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -174,7 +174,7 @@
             }
         };
         startAnimationToOverlay(Workspace.State.NORMAL_HIDDEN, toView, toView.getContentView(),
-                toView.getRevealView(), null, animated, cb);
+                toView.getRevealView(), animated, false /* hideSearchBar */, cb);
     }
 
     /**
@@ -198,7 +198,7 @@
             }
         };
         startAnimationToOverlay(Workspace.State.OVERVIEW_HIDDEN, toView, toView.getContentView(),
-                toView.getRevealView(), null, animated, cb);
+                toView.getRevealView(), animated, true /* hideSearchBar */, cb);
     }
 
     /**
@@ -226,8 +226,8 @@
      * Creates and starts a new animation to a particular overlay view.
      */
     private void startAnimationToOverlay(final Workspace.State toWorkspaceState, final View toView,
-             final View contentView, final View revealView, final View pageIndicatorsView,
-             final boolean animated, final PrivateTransitionCallbacks pCb) {
+             final View contentView, final View revealView, final boolean animated,
+             final boolean hideSearchBar, final PrivateTransitionCallbacks pCb) {
         final Resources res = mLauncher.getResources();
         final boolean material = Utilities.isLmpOrAbove();
         final int revealDuration = res.getInteger(R.integer.config_appsCustomizeRevealTime);
@@ -293,15 +293,6 @@
             layerViews.put(revealView, BUILD_AND_SET_LAYER);
             mStateAnimation.play(panelAlphaAndDrift);
 
-            // Setup the animation for the page indicators
-            if (pageIndicatorsView != null) {
-                pageIndicatorsView.setAlpha(0.01f);
-                ObjectAnimator indicatorsAlpha =
-                        ObjectAnimator.ofFloat(pageIndicatorsView, "alpha", 1f);
-                indicatorsAlpha.setDuration(revealDuration);
-                mStateAnimation.play(indicatorsAlpha);
-            }
-
             // Setup the animation for the content view
             contentView.setVisibility(View.VISIBLE);
             contentView.setAlpha(0f);
@@ -354,8 +345,9 @@
                         }
                     }
 
-                    // Hide the search bar
-                    mCb.onStateTransitionHideSearchBar();
+                    if (hideSearchBar) {
+                        mCb.onStateTransitionHideSearchBar();
+                    }
 
                     // This can hold unnecessary references to views.
                     mStateAnimation = null;
@@ -414,8 +406,9 @@
             // Show the content view
             contentView.setVisibility(View.VISIBLE);
 
-            // Hide the search bar
-            mCb.onStateTransitionHideSearchBar();
+            if (hideSearchBar) {
+                mCb.onStateTransitionHideSearchBar();
+            }
 
             dispatchOnLauncherTransitionPrepare(fromView, animated, false);
             dispatchOnLauncherTransitionStart(fromView, animated, false);
@@ -484,8 +477,7 @@
             }
         };
         startAnimationToWorkspaceFromOverlay(toWorkspaceState, appsView, appsView.getContentView(),
-                appsView.getRevealView(), null /* pageIndicatorsView */, animated,
-                onCompleteRunnable, cb);
+                appsView.getRevealView(), animated, onCompleteRunnable, cb);
     }
 
     /**
@@ -516,8 +508,8 @@
             }
         };
         startAnimationToWorkspaceFromOverlay(toWorkspaceState, widgetsView,
-                widgetsView.getContentView(), widgetsView.getRevealView(),
-                null, animated, onCompleteRunnable, cb);
+                widgetsView.getContentView(), widgetsView.getRevealView(), animated,
+                onCompleteRunnable, cb);
     }
 
     /**
@@ -525,8 +517,8 @@
      */
     private void startAnimationToWorkspaceFromOverlay(final Workspace.State toWorkspaceState,
               final View fromView, final View contentView, final View revealView,
-              final View pageIndicatorsView, final boolean animated,
-              final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) {
+              final boolean animated, final Runnable onCompleteRunnable,
+              final PrivateTransitionCallbacks pCb) {
         final Resources res = mLauncher.getResources();
         final boolean material = Utilities.isLmpOrAbove();
         final int revealDuration = res.getInteger(R.integer.config_appsCustomizeRevealTime);
@@ -631,16 +623,6 @@
                 itemsAlpha.setInterpolator(decelerateInterpolator);
                 mStateAnimation.play(itemsAlpha);
 
-                // Setup the page indicators animation
-                if (pageIndicatorsView != null) {
-                    pageIndicatorsView.setAlpha(1f);
-                    ObjectAnimator indicatorsAlpha =
-                            LauncherAnimUtils.ofFloat(pageIndicatorsView, "alpha", 0f);
-                    indicatorsAlpha.setDuration(revealDuration);
-                    indicatorsAlpha.setInterpolator(new DecelerateInterpolator(1.5f));
-                    mStateAnimation.play(indicatorsAlpha);
-                }
-
                 if (material) {
                     // Animate the all apps button
                     float finalRadius = pCb.getMaterialRevealViewStartFinalRadius();