From a9ecc3d1bd4781efe6fbd972acdfe1b595e87404 Mon Sep 17 00:00:00 2001 From: Andras Kloczl Date: Thu, 21 Jul 2022 07:29:13 +0000 Subject: [PATCH 1/3] Fix flaky two panel TAPL tests v2 Cuttlefish emulators are getting slower and slower and some of the two panel related TAPL tests were failing due to multiple page changes instead of single ones, so we need to increase the page change hover time in the tests. Test: atest -c NexusLauncherTests:com.android.launcher3.ui.workspace.TwoPanelWorkspaceTest Bug: 236136463 Change-Id: I8007a73a17089a7f7a639ce615af52695b55002c --- .../android/launcher3/dragndrop/SpringLoadedDragController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java b/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java index 08e50dd96d..c58ca42cd2 100644 --- a/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java +++ b/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java @@ -26,7 +26,7 @@ import com.android.launcher3.Workspace; public class SpringLoadedDragController implements OnAlarmListener { // how long the user must hover over a mini-screen before it unshrinks private static final long ENTER_SPRING_LOAD_HOVER_TIME = 500; - private static final long ENTER_SPRING_LOAD_HOVER_TIME_IN_TEST = 1500; + private static final long ENTER_SPRING_LOAD_HOVER_TIME_IN_TEST = 2000; private static final long ENTER_SPRING_LOAD_CANCEL_HOVER_TIME = 950; Alarm mAlarm; From e5829075ab7d68233d44991592f0f3074a7d9384 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 5 Aug 2022 17:29:22 +0100 Subject: [PATCH 2/3] Update hotseat QSB alpha after isQsbInline changes Fix: 238578584 Test: Repeat steps in bug for portrait/landscape Change-Id: I1bb9724f3e32bfc148ac75df3d1211c71c99875c --- .../TaskbarLauncherStateController.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 85e76b26d4..0bda3cd324 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -32,6 +32,7 @@ import androidx.annotation.Nullable; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseQuickstepLauncher; +import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherState; import com.android.launcher3.QuickstepTransitionManager; import com.android.launcher3.Utilities; @@ -48,6 +49,7 @@ import com.android.systemui.shared.recents.model.ThumbnailData; import java.io.PrintWriter; import java.util.HashMap; import java.util.StringJoiner; +import java.util.function.Consumer; import java.util.function.Supplier; /** @@ -92,6 +94,15 @@ import java.util.function.Supplier; // We skip any view synchronizations during init/destroy. private boolean mCanSyncViews; + private final Consumer mIconAlphaForHomeConsumer = alpha -> { + mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1); + mLauncher.getHotseat().setQsbAlpha( + mLauncher.getDeviceProfile().isQsbInline && alpha > 0 ? 0 : 1); + }; + + private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener = + dp -> mIconAlphaForHomeConsumer.accept(mIconAlphaForHome.getValue()); + private final StateManager.StateListener mStateListener = new StateManager.StateListener() { @@ -131,13 +142,7 @@ import java.util.function.Supplier; .getTaskbarBackgroundAlpha(); MultiValueAlpha taskbarIconAlpha = mControllers.taskbarViewController.getTaskbarIconAlpha(); mIconAlphaForHome = taskbarIconAlpha.getProperty(ALPHA_INDEX_HOME); - mIconAlphaForHome.setConsumer( - alpha -> { - mLauncher.getHotseat().setIconsAlpha(alpha > 0 ? 0 : 1); - if (mLauncher.getDeviceProfile().isQsbInline) { - mLauncher.getHotseat().setQsbAlpha(alpha > 0 ? 0 : 1); - } - }); + mIconAlphaForHome.setConsumer(mIconAlphaForHomeConsumer); mIconAlignmentForResumedState.finishAnimation(); onIconAlignmentRatioChangedForAppAndHomeTransition(); @@ -150,6 +155,7 @@ import java.util.function.Supplier; applyState(0); mCanSyncViews = true; + mLauncher.addOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener); } public void onDestroy() { @@ -164,6 +170,7 @@ import java.util.function.Supplier; mLauncher.getStateManager().removeStateListener(mStateListener); mCanSyncViews = true; + mLauncher.removeOnDeviceProfileChangeListener(mOnDeviceProfileChangeListener); } public Animator createAnimToLauncher(@NonNull LauncherState toState, From da8c0f9926c98ae22bd7582079e78a851a756db4 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Fri, 5 Aug 2022 15:43:48 -0700 Subject: [PATCH 3/3] Make windows transform into icons quicker for certain devices. Bug: 240671690 Test: manual Change-Id: Ie36a68c1e92443ca453778df6b8f7549d6e1f7e1 --- .../android/launcher3/QuickstepTransitionManager.java | 2 +- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 3 ++- .../interaction/SwipeUpGestureTutorialController.java | 2 +- .../com/android/quickstep/util/RectFSpringAnim.java | 10 ++++++++-- res/values/config.xml | 1 + 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index c089d1bcd4..c1803f9afe 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -1433,7 +1433,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener animation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { - anim.start(mLauncher, velocityPxPerS); + anim.start(mLauncher, mDeviceProfile, velocityPxPerS); } }); return anim; diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 8f1872b11e..8dee10aa53 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1330,7 +1330,8 @@ public abstract class AbsSwipeUpHandler, if (windowAnimation == null) { continue; } - windowAnimation.start(mContext, velocityPxPerMs); + DeviceProfile dp = mActivity == null ? null : mActivity.getDeviceProfile(); + windowAnimation.start(mContext, dp, velocityPxPerMs); mRunningWindowAnim[i] = RunningWindowAnim.wrap(windowAnimation); } homeAnimFactory.setSwipeVelocity(velocityPxPerMs.y); diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java index b70c411196..fa7bc04b30 100644 --- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java @@ -358,7 +358,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { }; RectFSpringAnim windowAnim = createWindowAnimationToHome(startShift, homeAnimFactory)[0]; - windowAnim.start(mContext, velocityPxPerMs); + windowAnim.start(mContext, mDp, velocityPxPerMs); return windowAnim; } } diff --git a/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java b/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java index c4909de510..68739ba458 100644 --- a/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java +++ b/quickstep/src/com/android/quickstep/util/RectFSpringAnim.java @@ -214,7 +214,7 @@ public class RectFSpringAnim extends ReleaseCheck { * @param context The activity context. * @param velocityPxPerMs Velocity of swipe in px/ms. */ - public void start(Context context, PointF velocityPxPerMs) { + public void start(Context context, @Nullable DeviceProfile profile, PointF velocityPxPerMs) { // Only tell caller that we ended if both x and y animations have ended. OnAnimationEndListener onXEndListener = ((animation, canceled, centerX, velocityX) -> { mRectXAnimEnded = true; @@ -252,7 +252,13 @@ public class RectFSpringAnim extends ReleaseCheck { float minVisibleChange = Math.abs(1f / mStartRect.height()); ResourceProvider rp = DynamicResource.provider(context); float damping = rp.getFloat(R.dimen.swipe_up_rect_scale_damping_ratio); - float stiffness = rp.getFloat(R.dimen.swipe_up_rect_scale_stiffness); + + // Increase the stiffness for devices where we want the window size to transform quicker. + boolean shouldUseHigherStiffness = profile != null + && (profile.isLandscape || profile.isTablet); + float stiffness = shouldUseHigherStiffness + ? rp.getFloat(R.dimen.swipe_up_rect_scale_higher_stiffness) + : rp.getFloat(R.dimen.swipe_up_rect_scale_stiffness); mRectScaleAnim = new SpringAnimation(this, RECT_SCALE_PROGRESS) .setSpring(new SpringForce(1f) diff --git a/res/values/config.xml b/res/values/config.xml index 3f94c34ad8..1415ed0c48 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -156,6 +156,7 @@ 0.75 200 + 400 1.5