Merge "Adding suport for Private Space QsTile fulfillment." into main
diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
index 5890f14..8c9dc6a 100644
--- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
+++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java
@@ -1087,7 +1087,12 @@
}
backgroundRadiusAnim.addListener(
- AnimatorListeners.forEndCallback(depthController::dispose));
+ AnimatorListeners.forEndCallback(() -> {
+ // reset the depth to match the main depth controller's depth
+ depthController.stateDepth
+ .setValue(mLauncher.getDepthController().stateDepth.getValue());
+ depthController.dispose();
+ }));
return backgroundRadiusAnim;
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java
index 9dac89d..2421c94 100644
--- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchViewController.java
@@ -23,6 +23,7 @@
import android.app.ActivityOptions;
import android.view.KeyEvent;
import android.view.View;
+import android.view.animation.AnimationUtils;
import android.window.RemoteTransition;
import androidx.annotation.NonNull;
@@ -38,6 +39,7 @@
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.ThumbnailData;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.QuickStepContract;
import java.io.PrintWriter;
import java.util.List;
@@ -148,8 +150,13 @@
return -1;
}
+ TaskbarActivityContext context = mControllers.taskbarActivityContext;
RemoteTransition remoteTransition = new RemoteTransition(new SlideInRemoteTransition(
- Utilities.isRtl(mControllers.taskbarActivityContext.getResources())));
+ Utilities.isRtl(mControllers.taskbarActivityContext.getResources()),
+ context.getDeviceProfile().overviewPageSpacing,
+ QuickStepContract.getWindowCornerRadius(context),
+ AnimationUtils.loadInterpolator(
+ context, android.R.interpolator.fast_out_extra_slow_in)));
if (mOnDesktop) {
UI_HELPER_EXECUTOR.execute(() ->
SystemUiProxy.INSTANCE.get(mKeyboardQuickSwitchView.getContext())
diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java
index 8092582..d834935 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepInteractionHandler.java
@@ -16,6 +16,7 @@
package com.android.launcher3.uioverrides;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
+import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SPLIT_WIDGET_ATTEMPT;
import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
@@ -59,6 +60,9 @@
remoteResponse.getLaunchOptions(view));
}
if (mLauncher.isSplitSelectionEnabled()) {
+ // Log metric
+ StatsLogManager.StatsLogger logger = mLauncher.getStatsLogManager().logger();
+ logger.log(LAUNCHER_SPLIT_WIDGET_ATTEMPT);
Toast.makeText(hostView.getContext(), R.string.split_widgets_not_supported,
Toast.LENGTH_SHORT).show();
return true;
diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
index 6651c73..0650f9d 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java
@@ -110,10 +110,13 @@
clampToProgress(LINEAR, 0, 0.33f));
}
+ // We sync the scrim fade with the taskbar animation duration to avoid any flickers for
+ // taskbar icons disappearing before hotseat icons show up.
+ float scrimUpperBoundFromSplit = TASKBAR_TO_HOME_DURATION / (float) config.duration;
config.setInterpolator(ANIM_OVERVIEW_ACTIONS_FADE, clampToProgress(LINEAR, 0, 0.25f));
config.setInterpolator(ANIM_SCRIM_FADE,
fromState == OVERVIEW_SPLIT_SELECT
- ? clampToProgress(LINEAR, 0.33f, 1)
+ ? clampToProgress(LINEAR, 0.33f, scrimUpperBoundFromSplit)
: LINEAR);
config.setInterpolator(ANIM_WORKSPACE_SCALE, DECELERATE);
config.setInterpolator(ANIM_WORKSPACE_FADE, ACCELERATE);
diff --git a/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt b/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
index c1fa2f3..6544ba7 100644
--- a/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
+++ b/quickstep/src/com/android/quickstep/util/SlideInRemoteTransition.kt
@@ -15,6 +15,7 @@
*/
package com.android.quickstep.util
+import android.animation.TimeInterpolator
import android.animation.ValueAnimator
import android.app.WindowConfiguration.ACTIVITY_TYPE_HOME
import android.graphics.Rect
@@ -30,7 +31,13 @@
import com.android.wm.shell.util.TransitionUtil
/** Remote animation which slides the opening targets in and the closing targets out */
-class SlideInRemoteTransition(val isRtl: Boolean) : IRemoteTransition.Stub() {
+class SlideInRemoteTransition(
+ private val isRtl: Boolean,
+ private val pageSpacing: Int,
+ private val cornerRadius: Float,
+ private val interpolator: TimeInterpolator,
+) : IRemoteTransition.Stub() {
+ private val animationDurationMs = 500L
override fun mergeAnimation(
iBinder: IBinder,
@@ -54,6 +61,8 @@
finishCB: IRemoteTransitionFinishedCallback
) {
val anim = ValueAnimator.ofFloat(0f, 1f)
+ anim.interpolator = interpolator
+ anim.duration = animationDurationMs
val closingStartBounds: HashMap<SurfaceControl, Rect> = HashMap()
val openingEndBounds: HashMap<SurfaceControl, Rect> = HashMap()
@@ -67,9 +76,11 @@
}
if (TransitionUtil.isClosingType(chg.mode)) {
closingStartBounds[leash] = chg.startAbsBounds
+ startT.setCrop(leash, chg.startAbsBounds).setCornerRadius(leash, cornerRadius)
}
if (TransitionUtil.isOpeningType(chg.mode)) {
openingEndBounds[leash] = chg.endAbsBounds
+ startT.setCrop(leash, chg.endAbsBounds).setCornerRadius(leash, cornerRadius)
}
}
startT.apply()
@@ -80,7 +91,7 @@
// Translate the surface from its original position on-screen to off-screen on the
// right (or left in RTL)
val startBounds = closingStartBounds[it]
- val targetX = (if (isRtl) -1 else 1) * startBounds!!.right
+ val targetX = (if (isRtl) -1 else 1) * (startBounds!!.right + pageSpacing)
t.setPosition(it, anim.animatedValue as Float * targetX, 0f)
}
openingEndBounds.keys.forEach {
@@ -90,7 +101,7 @@
// Translate the surface from off-screen on the left (or left in RTL) to its final
// position on-screen
val endBounds = openingEndBounds[it]
- val targetX = (if (isRtl) -1 else 1) * endBounds!!.right
+ val targetX = (if (isRtl) -1 else 1) * (endBounds!!.right + pageSpacing)
t.setPosition(it, (1f - anim.animatedValue as Float) * -targetX, 0f)
}
t.apply()
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
index b165876..a71d74a 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsPersistentTaskbar.java
@@ -15,6 +15,8 @@
*/
package com.android.quickstep;
+import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
+import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
import android.graphics.Rect;
@@ -24,6 +26,7 @@
import androidx.test.runner.AndroidJUnit4;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
+import com.android.launcher3.util.rule.TestStabilityRule;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
@@ -48,6 +51,7 @@
}
@Test
+ @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/320490387
@NavigationModeSwitch(mode = NavigationModeSwitchRule.Mode.THREE_BUTTON)
public void testThreeButtonsTaskbarBoundsAfterConfigChangeDuringIme() {
// Start off in light mode.
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 834ba04..e9545c8 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -81,6 +81,9 @@
private static final float MIN_FOLDER_TEXT_SIZE_SP = 16f;
private static final float MIN_WIDGET_PADDING_DP = 6f;
+ // Minimum aspect ratio beyond which an extra top padding may be applied to a bottom sheet.
+ private static final float MIN_ASPECT_RATIO_FOR_EXTRA_TOP_PADDING = 1.5f;
+
public static final PointF DEFAULT_SCALE = new PointF(1.0f, 1.0f);
public static final ViewScaleProvider DEFAULT_PROVIDER = itemInfo -> DEFAULT_SCALE;
public static final Consumer<DeviceProfile> DEFAULT_DIMENSION_PROVIDER = dp -> {
@@ -414,8 +417,14 @@
gridVisualizationPaddingY = res.getDimensionPixelSize(
R.dimen.grid_visualization_vertical_cell_spacing);
+ // Tablet portrait mode uses a single pane widget picker and extra padding may be applied on
+ // top to avoid making it look too elongated.
+ final boolean applyExtraTopPadding = isTablet
+ && !isLandscape
+ && (aspectRatio > MIN_ASPECT_RATIO_FOR_EXTRA_TOP_PADDING);
bottomSheetTopPadding = mInsets.top // statusbar height
- + res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
+ + (applyExtraTopPadding ? res.getDimensionPixelSize(
+ R.dimen.bottom_sheet_extra_top_padding) : 0)
+ (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding
bottomSheetOpenDuration = res.getInteger(R.integer.config_bottomSheetOpenDuration);
bottomSheetCloseDuration = res.getInteger(R.integer.config_bottomSheetCloseDuration);
diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java
index 0dc0d02..7cc33cf 100644
--- a/src/com/android/launcher3/logging/StatsLogManager.java
+++ b/src/com/android/launcher3/logging/StatsLogManager.java
@@ -704,6 +704,9 @@
@UiEvent(doc = "User tapped on install to private space system shortcut.")
LAUNCHER_PRIVATE_SPACE_INSTALL_SYSTEM_SHORTCUT_TAP(1565),
+ @UiEvent(doc = "User attempted to create split screen with a widget")
+ LAUNCHER_SPLIT_WIDGET_ATTEMPT(1604)
+
// ADD MORE
;
diff --git a/tests/tapl/com/android/launcher3/tapl/AppIcon.java b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
index 867a1a8..156568b 100644
--- a/tests/tapl/com/android/launcher3/tapl/AppIcon.java
+++ b/tests/tapl/com/android/launcher3/tapl/AppIcon.java
@@ -42,7 +42,8 @@
* @param appName app icon to look for
*/
static BySelector getAppIconSelector(String appName) {
- return By.clazz(TextView.class).text(makeMultilinePattern(appName));
+ // focusable=true to avoid matching folder labels
+ return By.clazz(TextView.class).text(makeMultilinePattern(appName)).focusable(true);
}
/**
diff --git a/tests/tapl/com/android/launcher3/tapl/Launchable.java b/tests/tapl/com/android/launcher3/tapl/Launchable.java
index 28e2590..ed47334 100644
--- a/tests/tapl/com/android/launcher3/tapl/Launchable.java
+++ b/tests/tapl/com/android/launcher3/tapl/Launchable.java
@@ -56,8 +56,8 @@
*/
public LaunchedAppState launch(String expectedPackageName) {
try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
- try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
- "want to launch an app from " + launchableType())) {
+ try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(String.format(
+ "want to launch an app (%s) from %s", expectedPackageName, launchableType()))) {
LauncherInstrumentation.log("Launchable.launch before click "
+ mObject.getVisibleCenter() + " in "
+ mLauncher.getVisibleBounds(mObject));