Merge "Adding All Apps action even when launcher is not in foreground" into ub-launcher3-rvc-dev
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
index b3b0b02..1bd0333 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
@@ -782,10 +782,6 @@
}
}
- if (endTarget == NEW_TASK) {
- SystemUiProxy.INSTANCE.get(mContext).onQuickSwitchToNewTask();
- }
-
if (endTarget == RECENTS || endTarget == HOME) {
// Since we're now done quickStepping, we want to only listen for touch events
// for the main orientation's nav bar, instead of multiple
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
index f957c37..270714b 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java
@@ -531,7 +531,7 @@
GestureState gestureState = new GestureState(mOverviewComponentObserver,
ActiveGestureLog.INSTANCE.generateAndSetLogId());
gestureState.updateRunningTask(TraceHelper.whitelistIpcs("getRunningTask.0",
- () -> mAM.getRunningTask(0)));
+ () -> mAM.getRunningTask(false /* filterOnlyVisibleRecents */)));
return gestureState;
}
@@ -636,7 +636,7 @@
// In the case where we are in the excluded assistant state, ignore it and treat the
// running activity as the task behind the assistant
gestureState.updateRunningTask(TraceHelper.whitelistIpcs("getRunningTask.assistant",
- () -> mAM.getRunningTask(ACTIVITY_TYPE_ASSISTANT /* ignoreActivityType */)));
+ () -> mAM.getRunningTask(true /* filterOnlyVisibleRecents */)));
ComponentName homeComponent = mOverviewComponentObserver.getHomeIntent().getComponent();
ComponentName runningComponent =
gestureState.getRunningTask().baseIntent.getComponent();
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
index 9193efb..470b720 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
@@ -268,8 +268,7 @@
}
// Sets animations for modal UI. We will remove the margins to zoom in the snapshot.
- float topMargin =
- getResources().getDimension(R.dimen.task_thumbnail_top_margin_with_actions);
+ float topMargin = getResources().getDimension(R.dimen.task_thumbnail_top_margin);
float bottomMargin =
getResources().getDimension(R.dimen.task_thumbnail_bottom_margin_with_actions);
float newHeight = mSnapshotView.getHeight() + topMargin + bottomMargin;
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 7f1a8bf..6d8d54f 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -17,8 +17,7 @@
<resources>
<dimen name="task_thumbnail_top_margin">24dp</dimen>
- <dimen name="task_thumbnail_top_margin_with_actions">60dp</dimen>
- <dimen name="task_thumbnail_bottom_margin_with_actions">76dp</dimen>
+ <dimen name="task_thumbnail_bottom_margin_with_actions">44dp</dimen>
<dimen name="task_thumbnail_half_top_margin">12dp</dimen>
<dimen name="task_thumbnail_icon_size">48dp</dimen>
<!-- For screens without rounded corners -->
diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java
index 0210a81..f5aaf1d 100644
--- a/quickstep/src/com/android/quickstep/SystemUiProxy.java
+++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java
@@ -334,14 +334,13 @@
}
}
- public void onQuickSwitchToNewTask() {
- //TODO(b/150250451) add back in after big CL goes through
-// if (mSystemUiProxy != null) {
-// try {
-// mSystemUiProxy.onQuickSwitchToNewTask();
-// } catch (RemoteException e) {
-// Log.w(TAG, "Failed call onQuickstepStarted", e);
-// }
-// }
+ public void onQuickSwitchToNewTask(int rotation) {
+ if (mSystemUiProxy != null) {
+ try {
+ mSystemUiProxy.onQuickSwitchToNewTask(rotation);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed call onQuickSwitchToNewTask with arg: " + rotation, e);
+ }
+ }
}
}
diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
index f71bcfb..1f1a999 100644
--- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java
+++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
@@ -122,9 +122,7 @@
paddingHorz = res.getDimension(paddingResId);
}
- float topIconMargin = overviewActionsEnabled
- ? res.getDimension(R.dimen.task_thumbnail_top_margin_with_actions)
- : res.getDimension(R.dimen.task_thumbnail_top_margin);
+ float topIconMargin = res.getDimension(R.dimen.task_thumbnail_top_margin);
float bottomMargin = thumbnailBottomMargin(context);
float paddingVert = overviewActionsEnabled && removeShelfFromOverview(context)
diff --git a/src/com/android/launcher3/widget/WidgetsFullSheet.java b/src/com/android/launcher3/widget/WidgetsFullSheet.java
index b3e9734..37a30af 100644
--- a/src/com/android/launcher3/widget/WidgetsFullSheet.java
+++ b/src/com/android/launcher3/widget/WidgetsFullSheet.java
@@ -193,6 +193,7 @@
.setDuration(DEFAULT_OPEN_DURATION)
.setInterpolator(AnimationUtils.loadInterpolator(
getContext(), android.R.interpolator.linear_out_slow_in));
+ mRecyclerView.setLayoutFrozen(true);
mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -202,7 +203,6 @@
}
});
post(() -> {
- mRecyclerView.setLayoutFrozen(true);
mOpenCloseAnimator.start();
mContent.animate().alpha(1).setDuration(FADE_IN_DURATION);
});
diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java
index 5be57c6..39ac645 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widgets.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java
@@ -16,6 +16,8 @@
package com.android.launcher3.tapl;
+import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS;
+
import android.graphics.Point;
import android.graphics.Rect;
@@ -23,6 +25,7 @@
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.Direction;
import androidx.test.uiautomator.UiObject2;
+import androidx.test.uiautomator.Until;
import com.android.launcher3.tapl.LauncherInstrumentation.GestureScope;
@@ -88,9 +91,12 @@
}
public Widget getWidget(String labelText) {
- try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
- "getting widget " + labelText + " in widgets list")) {
+ try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
+ LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
+ "getting widget " + labelText + " in widgets list")) {
final UiObject2 widgetsContainer = verifyActiveContainer();
+ mLauncher.assertTrue("Widgets container didn't become scrollable",
+ widgetsContainer.wait(Until.scrollable(true), WAIT_TIME_MS));
final Point displaySize = mLauncher.getRealDisplaySize();
final BySelector labelSelector = By.clazz("android.widget.TextView").text(labelText);
@@ -114,17 +120,17 @@
maxWidth = Math.max(mLauncher.getVisibleBounds(sibling).width(), maxWidth);
}
- int visibleDelta = maxWidth - mLauncher.getVisibleBounds(widget).width();
- if (visibleDelta > 0) {
- Rect parentBounds = mLauncher.getVisibleBounds(cell);
- mLauncher.linearGesture(parentBounds.centerX() + visibleDelta
- + mLauncher.getTouchSlop(),
- parentBounds.centerY(), parentBounds.centerX(),
- parentBounds.centerY(), 10, true, GestureScope.INSIDE);
- }
-
if (mLauncher.getVisibleBounds(widget).bottom
<= displaySize.y - mLauncher.getBottomGestureSize()) {
+ int visibleDelta = maxWidth - mLauncher.getVisibleBounds(widget).width();
+ if (visibleDelta > 0) {
+ Rect parentBounds = mLauncher.getVisibleBounds(cell);
+ mLauncher.linearGesture(parentBounds.centerX() + visibleDelta
+ + mLauncher.getTouchSlop(),
+ parentBounds.centerY(), parentBounds.centerX(),
+ parentBounds.centerY(), 10, true, GestureScope.INSIDE);
+ }
+
return new Widget(mLauncher, widget);
}
}