From 4381c3a343ebf6038defa59aa04f389df75a2819 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 11 Aug 2021 14:24:06 -0700 Subject: [PATCH 1/7] Removing unnecessary logging Test: presubmit Bug: 190748682 Change-Id: I3a280b4f351098cf256d276baced6e13eb771eb3 --- .../android/launcher3/tapl/LauncherInstrumentation.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 8b9ae6964c..b036049865 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -1335,13 +1335,6 @@ public final class LauncherInstrumentation { } final MotionEvent event = getMotionEvent(downTime, currentTime, action, point.x, point.y); - // b/190748682 - switch (action) { - case MotionEvent.ACTION_DOWN: - case MotionEvent.ACTION_UP: - log("b/190748682: injecting " + event); - break; - } assertTrue("injectInputEvent failed", mInstrumentation.getUiAutomation().injectInputEvent(event, true, false)); event.recycle(); From c353b1adb280f986c20b55953b90c32c12df7076 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 11 Aug 2021 14:47:05 -0700 Subject: [PATCH 2/7] Removing old workaround Bug: 139137636 Test: presubmit Change-Id: Iaa307c3d58f76ab7ee3b0a4a4a364b2b97d0efb7 --- .../android/quickstep/NavigationModeSwitchRule.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java index 67840d1a9e..bc8602c940 100644 --- a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java +++ b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java @@ -49,6 +49,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; /** * Test rule that allows executing a test with Quickstep on and then Quickstep off. @@ -182,17 +183,12 @@ public class NavigationModeSwitchRule implements TestRule { }; targetContext.getMainExecutor().execute(() -> SYS_UI_NAVIGATION_MODE.addModeChangeListener(listener)); - // b/139137636 -// latch.await(60, TimeUnit.SECONDS); + latch.await(60, TimeUnit.SECONDS); targetContext.getMainExecutor().execute(() -> SYS_UI_NAVIGATION_MODE.removeModeChangeListener(listener)); - Wait.atMost(() -> "Navigation mode didn't change to " + expectedMode, - () -> currentSysUiNavigationMode() == expectedMode, WAIT_TIME_MS, - launcher); - // b/139137636 -// assertTrue(launcher, "Navigation mode didn't change to " + expectedMode, -// currentSysUiNavigationMode() == expectedMode, description); + assertTrue(launcher, "Navigation mode didn't change to " + expectedMode, + currentSysUiNavigationMode() == expectedMode, description); } From 714d071f76c219231ab4aa0f969a6bea46a6ab56 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 11 Aug 2021 15:44:39 -0700 Subject: [PATCH 3/7] Removing old workaround Test: presubmit Bug: 165029151 Change-Id: I5a64c6e381c0bbbf849658648bd5b75a1e660381 --- .../tests/src/com/android/quickstep/TaplTestsQuickstep.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 164e755fd1..dfbc331ea3 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -160,12 +160,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @PortraitLandscape @ScreenRecord //b/193125090 public void testOverviewActions() throws Exception { - // Experimenting for b/165029151: - final Overview overview = mLauncher.pressHome().switchToOverview(); - if (overview.hasTasks()) overview.dismissAllTasks(); - mLauncher.pressHome(); - // - startTestAppsWithCheck(); OverviewActions actionsView = mLauncher.pressHome().switchToOverview().getOverviewActions(); From 1d5e1dc8d14cc37b652cd425e6aa86bba32d84a6 Mon Sep 17 00:00:00 2001 From: Dave Mankoff Date: Fri, 13 Aug 2021 10:16:09 -0400 Subject: [PATCH 4/7] Pass Executor to to PluginInstanceManager.Factory. Bug: 194781951 Test: manual Change-Id: I6dc699869d041aab8f5d1e7a128b4f67adfd78dc --- .../launcher3/uioverrides/plugins/PluginManagerWrapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java index 15f89adff0..c604defe8f 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java +++ b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java @@ -53,7 +53,8 @@ public class PluginManagerWrapper { PluginInitializerImpl pluginInitializer = new PluginInitializerImpl(); mPluginEnabler = new PluginEnablerImpl(c); PluginInstanceManager.Factory instanceManagerFactory = new PluginInstanceManager.Factory( - c, c.getPackageManager(), MODEL_EXECUTOR.getLooper(), pluginInitializer); + c, c.getPackageManager(), MODEL_EXECUTOR, MODEL_EXECUTOR.getLooper(), + pluginInitializer); mPluginManager = new PluginManagerImpl(c, instanceManagerFactory, pluginInitializer.isDebuggable(), From 630ae94833842b5f80ed76228e644f252d0096c5 Mon Sep 17 00:00:00 2001 From: Dave Mankoff Date: Fri, 13 Aug 2021 10:18:01 -0400 Subject: [PATCH 5/7] Pass main executor to PluginInstanceManager.Factory. Bug: 194781951 Test: manual Change-Id: I1667023887e0c8d1dc86fce1717a3032b6721684 --- .../launcher3/uioverrides/plugins/PluginManagerWrapper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java index c604defe8f..f653906d05 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java +++ b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java @@ -53,8 +53,7 @@ public class PluginManagerWrapper { PluginInitializerImpl pluginInitializer = new PluginInitializerImpl(); mPluginEnabler = new PluginEnablerImpl(c); PluginInstanceManager.Factory instanceManagerFactory = new PluginInstanceManager.Factory( - c, c.getPackageManager(), MODEL_EXECUTOR, MODEL_EXECUTOR.getLooper(), - pluginInitializer); + c, c.getPackageManager(), c.getMainExecutor(), MODEL_EXECUTOR, pluginInitializer); mPluginManager = new PluginManagerImpl(c, instanceManagerFactory, pluginInitializer.isDebuggable(), From 4a08ce60dc0873cbdf71149536528444953b0bb0 Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Tue, 3 Aug 2021 11:56:51 +0100 Subject: [PATCH 6/7] overview: rebalance hidden tasks in grid The tasks that are not showing in the screen will be rearranged. This doesn't change anything for tasks before the dismissed task because the grid is already balanced there. Fixes: 194189955 Test: manual with 10 tasks, normal and RTL mode Change-Id: I07ddbb752110339751bd1ed6056fe9f645b5497f --- .../android/quickstep/views/RecentsView.java | 124 +++++++++++++++++- 1 file changed, 117 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index b077ca6741..224220693f 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -123,6 +123,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.touch.OverScroll; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.DynamicResource; +import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntSet; import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.ResourceBasedOverride.Overrides; @@ -2054,23 +2055,39 @@ public abstract class RecentsView startRebalanceAfter) { + mTopRowIdSet.remove(taskViewId); + isTopRow = topRowWidth <= bottomRowWidth; + } else { + isTopRow = mTopRowIdSet.contains(taskViewId); + } + } else { + isTopRow = topRowWidth <= bottomRowWidth; + } + if (isTopRow) { if (homeTaskView != null && nextFocusedTaskView == null) { // TaskView will be focused when swipe up, don't count towards row width. @@ -2644,9 +2673,44 @@ public abstract class RecentsView= screenEnd - mPageSpacing; + } + + if (shouldRebalance) { + updateGridProperties(/*isTaskDismissal=*/ true, + highestVisibleTaskIndex); + updateScrollSynchronously(); + } + } + setCurrentPage(pageToSnapTo); dispatchScrollChanged(); } @@ -2658,6 +2722,52 @@ public abstract class RecentsView ActivityManagerWrapper.getInstance().removeTask(dismissedTaskId), From 77acf1290502010bd6c025e592916abdb4ea2798 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 12 Aug 2021 17:19:16 -0700 Subject: [PATCH 7/7] Fixing header jump Linking header position to an empty entry in the recyclerView, instead of calculating the vertical scroll position. This allows the header to be in sync with the recyclerView scroll and item animations Other simplifications: > Moving top collapse handle out of header view (it doesn't scroll) > Removing background clipping logic from full-sheet > Moving tab bar inside the header view Bug: 196464142 Test: Verified on device Change-Id: Iae5a0ae9af7ce258e1b391b8e85c5c270fe56197 --- .../bg_widgets_full_sheet.xml} | 15 +- res/drawable/bg_widgets_picker_handle.xml | 29 -- .../widgets_bottom_sheet_background.xml | 26 -- res/layout/widgets_bottom_sheet_content.xml | 2 +- res/layout/widgets_full_sheet.xml | 18 +- res/layout/widgets_full_sheet_paged_view.xml | 83 +++- .../widgets_full_sheet_recyclerview.xml | 58 ++- ..._full_sheet_search_and_recommendations.xml | 61 --- res/layout/widgets_personal_work_tabs.xml | 53 --- res/values/dimens.xml | 5 +- res/values/id.xml | 1 + .../widget/picker/WidgetsListAdapterTest.java | 2 +- ...WidgetsListHeaderViewHolderBinderTest.java | 13 +- ...sListSearchHeaderViewHolderBinderTest.java | 13 +- .../WidgetsListTableViewHolderBinderTest.java | 9 +- .../recyclerview/ViewHolderBinder.java | 15 +- .../launcher3/views/AbstractSlideInView.java | 3 +- .../views/RecyclerViewFastScroller.java | 23 - .../launcher3/views/TopRoundedCornerView.java | 61 --- .../widget/model/WidgetListSpaceEntry.java | 37 ++ .../widget/model/WidgetsListBaseEntry.java | 10 +- ...rchAndRecommendationsScrollController.java | 426 ++++++------------ .../widget/picker/WidgetsFullSheet.java | 139 ++---- .../widget/picker/WidgetsListAdapter.java | 46 +- .../WidgetsListHeaderViewHolderBinder.java | 11 +- .../picker/WidgetsListLayoutManager.java | 51 --- ...dgetsListSearchHeaderViewHolderBinder.java | 11 +- .../WidgetsListTableViewHolderBinder.java | 11 +- .../WidgetsRecommendationTableLayout.java | 7 - .../widget/picker/WidgetsRecyclerView.java | 27 +- .../picker/WidgetsSpaceViewHolderBinder.java | 113 +++++ 31 files changed, 570 insertions(+), 809 deletions(-) rename res/{drawable-v28/widgets_bottom_sheet_background.xml => drawable/bg_widgets_full_sheet.xml} (65%) delete mode 100644 res/drawable/bg_widgets_picker_handle.xml delete mode 100644 res/drawable/widgets_bottom_sheet_background.xml delete mode 100644 res/layout/widgets_full_sheet_search_and_recommendations.xml delete mode 100644 res/layout/widgets_personal_work_tabs.xml delete mode 100644 src/com/android/launcher3/views/TopRoundedCornerView.java create mode 100644 src/com/android/launcher3/widget/model/WidgetListSpaceEntry.java delete mode 100644 src/com/android/launcher3/widget/picker/WidgetsListLayoutManager.java create mode 100644 src/com/android/launcher3/widget/picker/WidgetsSpaceViewHolderBinder.java diff --git a/res/drawable-v28/widgets_bottom_sheet_background.xml b/res/drawable/bg_widgets_full_sheet.xml similarity index 65% rename from res/drawable-v28/widgets_bottom_sheet_background.xml rename to res/drawable/bg_widgets_full_sheet.xml index 7fb8681301..dfcd354ce7 100644 --- a/res/drawable-v28/widgets_bottom_sheet_background.xml +++ b/res/drawable/bg_widgets_full_sheet.xml @@ -1,6 +1,5 @@ - + - + android:shape="rectangle" > + + android:topLeftRadius="@dimen/dialogCornerRadius" + android:topRightRadius="@dimen/dialogCornerRadius" /> \ No newline at end of file diff --git a/res/drawable/bg_widgets_picker_handle.xml b/res/drawable/bg_widgets_picker_handle.xml deleted file mode 100644 index 68681a684d..0000000000 --- a/res/drawable/bg_widgets_picker_handle.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/res/drawable/widgets_bottom_sheet_background.xml b/res/drawable/widgets_bottom_sheet_background.xml deleted file mode 100644 index b877546656..0000000000 --- a/res/drawable/widgets_bottom_sheet_background.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/res/layout/widgets_bottom_sheet_content.xml b/res/layout/widgets_bottom_sheet_content.xml index 3d330dce85..1a2cfc6f93 100644 --- a/res/layout/widgets_bottom_sheet_content.xml +++ b/res/layout/widgets_bottom_sheet_content.xml @@ -18,7 +18,7 @@ android:id="@+id/widgets_bottom_sheet" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/widgets_bottom_sheet_background" + android:background="@drawable/bg_rounded_corner_bottom_sheet" android:paddingTop="16dp" android:orientation="vertical"> + android:theme="?attr/widgetsTheme"> - + android:background="@drawable/bg_widgets_full_sheet"> + + @@ -57,9 +66,10 @@ android:id="@+id/search_widgets_list_view" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_below="@id/collapse_handle" android:layout_marginHorizontal="@dimen/widget_list_horizontal_margin" android:visibility="gone" android:clipToPadding="false" /> - + \ No newline at end of file diff --git a/res/layout/widgets_full_sheet_paged_view.xml b/res/layout/widgets_full_sheet_paged_view.xml index fefad19ae3..85f14cda4f 100644 --- a/res/layout/widgets_full_sheet_paged_view.xml +++ b/res/layout/widgets_full_sheet_paged_view.xml @@ -22,7 +22,7 @@ android:layout_height="match_parent" android:layout_marginHorizontal="@dimen/widget_list_horizontal_margin" android:clipToPadding="false" - android:paddingTop="@dimen/widget_picker_view_pager_top_padding" + android:layout_below="@id/collapse_handle" android:descendantFocusability="afterDescendants" launcher:pageIndicator="@+id/tabs"> @@ -40,5 +40,84 @@ - + + + + + + + + + + + + + +