diff --git a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java index 15f89adff0..f653906d05 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java +++ b/quickstep/src/com/android/launcher3/uioverrides/plugins/PluginManagerWrapper.java @@ -53,7 +53,7 @@ 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(), c.getMainExecutor(), MODEL_EXECUTOR, pluginInitializer); mPluginManager = new PluginManagerImpl(c, instanceManagerFactory, pluginInitializer.isDebuggable(), diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 3aed7cc630..538e61e83e 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -125,6 +125,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; @@ -2087,23 +2088,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. @@ -2677,9 +2706,44 @@ public abstract class RecentsView= screenEnd - mPageSpacing; + } + + if (shouldRebalance) { + updateGridProperties(/*isTaskDismissal=*/ true, + highestVisibleTaskIndex); + updateScrollSynchronously(); + } + } + setCurrentPage(pageToSnapTo); dispatchScrollChanged(); } @@ -2691,6 +2755,52 @@ public abstract class RecentsView ActivityManagerWrapper.getInstance().removeTask(dismissedTaskId), 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); } diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index e5e560a91c..177d7441f6 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -158,12 +158,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @NavigationModeSwitch @PortraitLandscape 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(); 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 @@ - + + + + + + + + + + + + + +