Add personal / work tabs for work profile widgets

Video: https://drive.google.com/file/d/1TORRNcvVM7fIvNd_WZaajLbI7D9z4VFA/view?usp=sharing


Test: Main profile only: run AddConfigWidgetTest.
      With work profile: manually launch the full widgets sheet.
      Go to the personal tab: only personal widgets are shown.
      Go to the work tab: only work widgets are shown
      Successfully add personal / work widgets from the full widgets
      sheet.

Bug: 179797520

Change-Id: Iad8b90c2af35e0580319d7a05510ec88e4f8b86c
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index ada297f..af2d94a 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -96,6 +96,8 @@
     private static final int MIN_FLING_VELOCITY = 250;
 
     private boolean mFreeScroll = false;
+    /** If {@code false}, disable swipe gesture to switch between pages. */
+    private boolean mSwipeGestureEnabled = true;
 
     protected final int mFlingThresholdVelocity;
     protected final int mEasyFlingThresholdVelocity;
@@ -858,6 +860,14 @@
     }
 
     /**
+     * If {@code enableSwipeGesture} is {@code true}, enables swipe gesture to navigate between
+     * pages. Otherwise, disables the navigation gesture.
+     */
+    public void setSwipeGestureEnabled(boolean swipeGestureEnabled) {
+        mSwipeGestureEnabled = swipeGestureEnabled;
+    }
+
+    /**
      * {@inheritDoc}
      */
     @Override
@@ -879,6 +889,8 @@
          * scrolling there.
          */
 
+        if (!mSwipeGestureEnabled) return false;
+
         // Skip touch handling if there are no pages to swipe
         if (getChildCount() <= 0) return false;