Polish work for work profile

Bug: 191478900 Work profile toggle specs
Bug: 187761192 Fix issue where Installing app scrolling apps to top
Bug: 191121890	Fix issue where top of AllApps becomes empty when returning to AllApps
Bug: 191477329 String change for work profile paused state
Test: local
Change-Id: Idbaab333566b54afa3dc879f5bea98e1f77c44fc
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c5d280d..11ddafb 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -1079,7 +1079,7 @@
         if (ALL_APPS.equals(mPrevLauncherState) && !ALL_APPS.equals(state)
                 // Making sure mAllAppsSessionLogId is not null to avoid double logging.
                 && mAllAppsSessionLogId != null) {
-            getAppsView().getSearchUiManager().resetSearch();
+            getAppsView().reset(false);
             getStatsLogManager().logger()
                     .withContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
                             .setWorkspace(
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 67f2a9e..1010148 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -255,7 +255,6 @@
             mWorkModeSwitch.updateCurrentState(isEnabled);
         }
         mWorkAdapterProvider.updateCurrentState(isEnabled);
-        mAH[AdapterHolder.WORK].applyPadding();
     }
 
     private void hideInput() {
@@ -509,7 +508,10 @@
                     R.layout.work_mode_fab, this, false);
             this.addView(mWorkModeSwitch);
             mWorkModeSwitch.setInsets(mInsets);
-            mWorkModeSwitch.post(this::resetWorkProfile);
+            mWorkModeSwitch.post(() -> {
+                mAH[AdapterHolder.WORK].applyPadding();
+                resetWorkProfile();
+            });
         }
     }
 
@@ -633,6 +635,7 @@
             mSearchModeWhileUsingTabs = true;
             rebindAdapters(false); // hide tabs
         }
+        mHeader.setCollapsed(true);
     }
 
     public void onClearSearchResult() {
@@ -715,7 +718,7 @@
         if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
             int bottom = mUsingTabs && mHeader.mHeaderCollapsed ? mHeader.getVisibleBottomBound()
                     : mSearchContainer.getBottom();
-            canvas.drawRect(0, 0, getWidth(), bottom + getTranslationY(),
+            canvas.drawRect(0, 0, canvas.getWidth(), bottom + getTranslationY(),
                     mHeaderPaint);
         }
     }
@@ -783,7 +786,6 @@
                 int bottomOffset = mWorkModeSwitch != null && mIsWork ? switchH : 0;
                 recyclerView.setPadding(padding.left, padding.top, padding.right,
                         padding.bottom + bottomOffset);
-                recyclerView.scrollToTop();
             }
         }
 
diff --git a/src/com/android/launcher3/views/SpringRelativeLayout.java b/src/com/android/launcher3/views/SpringRelativeLayout.java
index 8f814a1..923eb19 100644
--- a/src/com/android/launcher3/views/SpringRelativeLayout.java
+++ b/src/com/android/launcher3/views/SpringRelativeLayout.java
@@ -105,9 +105,8 @@
 
         @NonNull @Override
         protected EdgeEffect createEdgeEffect(RecyclerView view, int direction) {
-            switch (direction) {
-                case DIRECTION_TOP:
-                    return new EdgeEffectProxy(getContext(), mEdgeGlowTop);
+            if (direction == DIRECTION_TOP) {
+                return new EdgeEffectProxy(getContext(), mEdgeGlowTop);
             }
             return super.createEdgeEffect(view, direction);
         }