From a72c2168297f9252865cd4b0b185fc03a14c02db Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Fri, 19 May 2023 13:52:42 -0700 Subject: [PATCH 01/20] Clip folder chidren during folder open/close animation Test: close folder and verify app icons are not clipped Fix: 283527491 Change-Id: Ia2aed207d07fc210cd04f05fd2e319f393209396 --- src/com/android/launcher3/folder/FolderAnimationManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java index 2ce6c785c2..dd82ecfb95 100644 --- a/src/com/android/launcher3/folder/FolderAnimationManager.java +++ b/src/com/android/launcher3/folder/FolderAnimationManager.java @@ -273,6 +273,8 @@ public class FolderAnimationManager { // {@link #onAnimationEnd} before B reads new UI state from {@link #onAnimationStart}. a.addListener(new AnimatorListenerAdapter() { private CellLayout mCellLayout; + + private boolean mFolderClipChildren; private boolean mFolderClipToPadding; private boolean mContentClipChildren; private boolean mContentClipToPadding; @@ -283,12 +285,14 @@ public class FolderAnimationManager { public void onAnimationStart(Animator animator) { super.onAnimationStart(animator); mCellLayout = mContent.getCurrentCellLayout(); + mFolderClipChildren = mFolder.getClipChildren(); mFolderClipToPadding = mFolder.getClipToPadding(); mContentClipChildren = mContent.getClipChildren(); mContentClipToPadding = mContent.getClipToPadding(); mCellLayoutClipChildren = mCellLayout.getClipChildren(); mCellLayoutClipPadding = mCellLayout.getClipToPadding(); + mFolder.setClipChildren(false); mFolder.setClipToPadding(false); mContent.setClipChildren(false); mContent.setClipToPadding(false); @@ -309,6 +313,7 @@ public class FolderAnimationManager { mFolder.mFooter.setTranslationX(0f); mFolder.mFolderName.setAlpha(1f); + mFolder.setClipChildren(mFolderClipChildren); mFolder.setClipToPadding(mFolderClipToPadding); mContent.setClipChildren(mContentClipChildren); mContent.setClipToPadding(mContentClipToPadding); From 57de6565a0e5f29e189497b985ad14e60a5be9ca Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 16 May 2023 13:40:29 -0700 Subject: [PATCH 02/20] Resize mRemoteTargetHandles when RecentsAnimationStarts * TopTaskTracker gets updated too late after we've exited split screen so we can't use that to determine how many RemoteTargetHandles to use * We default to 2, and then scale it down to 1. Because we modify the array holding the handles directly, it should also get updated in AbsSwipeUpHandler * Temporary solution to stop setting up RecentsView if we detect that TopTaskTracker has incorrect data and re-setup when we get onRecentsAnimationStart() Test: Tested quickswitch in gestural and recents button double tap in button nav. Bug: 236226779 Flag: none Change-Id: I1bae7aed1f8712ddd1bf496acfcb851c0e32a115 --- .../android/quickstep/AbsSwipeUpHandler.java | 14 ++++++++++ .../android/quickstep/RemoteTargetGluer.java | 27 +++++++++++++++++-- .../quickstep/SwipeUpAnimationLogic.java | 7 ++++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 928910d3ab..4131cf955c 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -147,6 +147,7 @@ import com.android.wm.shell.startingsurface.SplashScreenExitAnimationUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.Objects; import java.util.Optional; import java.util.function.Consumer; @@ -662,6 +663,14 @@ public abstract class AbsSwipeUpHandler, } else { runningTasks = mGestureState.getRunningTask().getPlaceholderTasks(); } + + // Safeguard against any null tasks being sent to recents view, happens when quickswitching + // very quickly w/ split tasks because TopTaskTracker provides stale information compared to + // actual running tasks in the recents animation. + // TODO(b/236226779), Proper fix (ag/22237143) + if (Arrays.stream(runningTasks).anyMatch(Objects::isNull)) { + return; + } mRecentsView.onGestureAnimationStart(runningTasks, mDeviceState.getRotationTouchHelper()); } @@ -915,7 +924,12 @@ public abstract class AbsSwipeUpHandler, if (DesktopTaskView.DESKTOP_MODE_SUPPORTED && targets.hasDesktopTasks()) { mRemoteTargetHandles = mTargetGluer.assignTargetsForDesktop(targets); } else { + int untrimmedAppCount = mRemoteTargetHandles.length; mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(targets); + if (mRemoteTargetHandles.length < untrimmedAppCount && mIsSwipeForSplit) { + updateIsGestureForSplit(mRemoteTargetHandles.length); + setupRecentsViewUi(); + } } mRecentsAnimationController = controller; mRecentsAnimationTargets = targets; diff --git a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java index d9c269a914..84b90b9b78 100644 --- a/quickstep/src/com/android/quickstep/RemoteTargetGluer.java +++ b/quickstep/src/com/android/quickstep/RemoteTargetGluer.java @@ -29,12 +29,15 @@ import com.android.quickstep.util.TransformParams; import com.android.quickstep.views.DesktopTaskView; import java.util.ArrayList; +import java.util.Arrays; /** * Glues together the necessary components to animate a remote target using a * {@link TaskViewSimulator} */ public class RemoteTargetGluer { + private static final int DEFAULT_NUM_HANDLES = 2; + private RemoteTargetHandle[] mRemoteTargetHandles; private SplitBounds mSplitBounds; @@ -62,8 +65,9 @@ public class RemoteTargetGluer { } } - int[] splitIds = TopTaskTracker.INSTANCE.get(context).getRunningSplitTaskIds(); - init(context, sizingStrategy, splitIds.length == 2 ? 2 : 1, false /* forDesktop */); + // Assume 2 handles needed for split, scale down as needed later on when we actually + // get remote targets + init(context, sizingStrategy, DEFAULT_NUM_HANDLES, false /* forDesktop */); } private void init(Context context, BaseActivityInterface sizingStrategy, int numHandles, @@ -108,6 +112,17 @@ public class RemoteTargetGluer { * the left/top task, index 1 right/bottom. */ public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets) { + // Resize the mRemoteTargetHandles array since we started assuming split screen, but + // targets.apps is the ultimate source of truth here + long appCount = Arrays.stream(targets.apps) + .filter(app -> app.mode == targets.targetMode) + .count(); + if (appCount < mRemoteTargetHandles.length) { + RemoteTargetHandle[] newHandles = new RemoteTargetHandle[(int) appCount]; + System.arraycopy(mRemoteTargetHandles, 0/*src*/, newHandles, 0/*dst*/, (int) appCount); + mRemoteTargetHandles = newHandles; + } + if (mRemoteTargetHandles.length == 1) { // If we're not in split screen, the splitIds count doesn't really matter since we // should always hit this case. @@ -233,6 +248,14 @@ public class RemoteTargetGluer { targets.targetMode); } + /** + * The object returned by this is may be modified in + * {@link #assignTargetsForSplitScreen(RemoteAnimationTargets)}, specifically the length of the + * array may be shortened based on the number of RemoteAnimationTargets present. + *

+ * This can be accessed at any time, however the count will be more accurate if accessed after + * calling one of the respective assignTargets*() methods + */ public RemoteTargetHandle[] getRemoteTargetHandles() { return mRemoteTargetHandles; } diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 1b4fdc4a8f..25ac47a45f 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -82,7 +82,8 @@ public abstract class SwipeUpAnimationLogic implements mContext = context; mDeviceState = deviceState; mGestureState = gestureState; - mIsSwipeForSplit = TopTaskTracker.INSTANCE.get(context).getRunningSplitTaskIds().length > 1; + updateIsGestureForSplit(TopTaskTracker.INSTANCE.get(context) + .getRunningSplitTaskIds().length); mTargetGluer = new RemoteTargetGluer(mContext, mGestureState.getActivityInterface()); mRemoteTargetHandles = mTargetGluer.getRemoteTargetHandles(); @@ -280,6 +281,10 @@ public abstract class SwipeUpAnimationLogic implements return out; } + protected void updateIsGestureForSplit(int targetCount) { + mIsSwipeForSplit = targetCount > 1; + } + private RectFSpringAnim getWindowAnimationToHomeInternal( HomeAnimationFactory homeAnimationFactory, RectF targetRect, TransformParams transformParams, TaskViewSimulator taskViewSimulator, From aac286af4f748915f3b93991ccfb0d916f1cae4f Mon Sep 17 00:00:00 2001 From: Jordan Silva Date: Thu, 25 May 2023 02:25:19 +0100 Subject: [PATCH 03/20] Add Portrait/Landscape support for NexusLauncher screenshot tests Updating @PortraitLandscape annotation to be public to allow its usage by modules implementing Launcher3 and AbstractLauncherUiTest and interop with Kotlin. Bug: 283751050 Flag: N/A Test: atest HomeScreenEditStateImageTest Change-Id: I84e1210c0476a3b3f9b40bbb6ee6b46a44b752ff --- .../com/android/quickstep/TaplTestsQuickstep.java | 1 + .../android/quickstep/TaplTestsSplitscreen.java | 2 ++ .../com/android/quickstep/TaplTestsTaskbar.java | 1 + .../launcher3/ui/AbstractLauncherUiTest.java | 10 ---------- .../launcher3/ui/PortraitLandscapeRunner.java | 15 +++++++++++++-- .../android/launcher3/ui/TaplTestsLauncher3.java | 1 + .../launcher3/ui/widget/AddConfigWidgetTest.java | 1 + .../launcher3/ui/widget/AddWidgetTest.java | 1 + .../ui/workspace/TwoPanelWorkspaceTest.java | 1 + 9 files changed, 21 insertions(+), 12 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 88cac9728e..ab3643afc5 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -41,6 +41,7 @@ import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewTask; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java index e8cadabe72..3317ce1473 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java @@ -15,6 +15,7 @@ */ package com.android.quickstep; + import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; @@ -22,6 +23,7 @@ import static org.junit.Assume.assumeTrue; import android.content.Intent; import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java index 40be4806ec..4ff2f9c721 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java @@ -20,6 +20,7 @@ import static com.android.quickstep.TaplTestsTaskbar.TaskbarMode.TRANSIENT; import androidx.test.filters.LargeTest; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index d7c4ae3857..352447f9a1 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -82,10 +82,6 @@ import org.junit.rules.RuleChain; import org.junit.rules.TestRule; import java.io.IOException; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -209,12 +205,6 @@ public abstract class AbstractLauncherUiTest { mTargetContext.unregisterReceiver(broadcastReceiver); } - // Annotation for tests that need to be run in portrait and landscape modes. - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - protected @interface PortraitLandscape { - } - protected TestRule getRulesInsideActivityMonitor() { final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(); final RuleChain inner = RuleChain diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java index 266f0aeb1d..f0875f8104 100644 --- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java +++ b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java @@ -9,10 +9,21 @@ import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; -class PortraitLandscapeRunner implements TestRule { +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +public class PortraitLandscapeRunner implements TestRule { private static final String TAG = "PortraitLandscapeRunner"; private AbstractLauncherUiTest mTest; + // Annotation for tests that need to be run in portrait and landscape modes. + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + public @interface PortraitLandscape { + } + public PortraitLandscapeRunner(AbstractLauncherUiTest test) { mTest = test; } @@ -20,7 +31,7 @@ class PortraitLandscapeRunner implements TestRule { @Override public Statement apply(Statement base, Description description) { if (!TestHelpers.isInLauncherProcess() || - description.getAnnotation(AbstractLauncherUiTest.PortraitLandscape.class) == null) { + description.getAnnotation(PortraitLandscape.class) == null) { return base; } diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index 9d9fdc9c9f..6c273b4146 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -54,6 +54,7 @@ import com.android.launcher3.tapl.HomeAppIcon; import com.android.launcher3.tapl.HomeAppIconMenuItem; import com.android.launcher3.tapl.Widgets; import com.android.launcher3.tapl.Workspace; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.LauncherLayoutBuilder; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; diff --git a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java index e9a2b0ffb4..38066487a6 100644 --- a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java +++ b/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java @@ -34,6 +34,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.testcomponent.WidgetConfigActivity; import com.android.launcher3.ui.AbstractLauncherUiTest; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TestViewHelpers; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.ShellCommandRule; diff --git a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java index 78a006e11e..ff2fdb4ebe 100644 --- a/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java +++ b/tests/src/com/android/launcher3/ui/widget/AddWidgetTest.java @@ -29,6 +29,7 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.tapl.Widget; import com.android.launcher3.tapl.WidgetResizeFrame; import com.android.launcher3.ui.AbstractLauncherUiTest; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TestViewHelpers; import com.android.launcher3.util.rule.ShellCommandRule; import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; diff --git a/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java b/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java index c4b6d43466..0b2f33530d 100644 --- a/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java +++ b/tests/src/com/android/launcher3/ui/workspace/TwoPanelWorkspaceTest.java @@ -29,6 +29,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.tapl.Workspace; import com.android.launcher3.ui.AbstractLauncherUiTest; +import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.LauncherLayoutBuilder; import com.android.launcher3.util.TestUtil; From cf36a3f3a8a9f5245ea4b8b1b9e613a154d7e5b8 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Thu, 25 May 2023 22:43:27 +0000 Subject: [PATCH 04/20] Use LockedUserState in TouchInteractionService. This change was previously attempted, but failed because of a tricky issue where the LockedUserState singleton object was getting permanently set to a mock context in LockedUserStateTest, and then was failing TaplTests because isUserUnlocked was always false. This fixes that by avoiding using the singleton LockedUserState instance in the unit tests. Bug: 251502424 Test: Compilation threw no errors and user unlock behavior worked correctly. Post-submit was tested and this CL passed all previously failing tests: https://android-build.googleplex.com/builds/abtd/run/L12900000960898179 Change-Id: I045c9f2558a6bdacb4bfa029fbf6a07c3c190fe7 --- .../RecentsAnimationDeviceState.java | 49 ------------------- .../quickstep/TouchInteractionService.java | 27 +++++----- .../android/launcher3/util/LockedUserState.kt | 15 ++++++ .../launcher3/util/LockedUserStateTest.kt | 23 +++------ 4 files changed, 36 insertions(+), 78 deletions(-) diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java index 74ca64f5cc..7d2997ecb8 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java @@ -17,7 +17,6 @@ package com.android.quickstep; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; -import static android.content.Intent.ACTION_USER_UNLOCKED; import static android.view.Display.DEFAULT_DISPLAY; import static com.android.launcher3.util.DisplayController.CHANGE_ALL; @@ -52,10 +51,8 @@ import android.content.Context; import android.graphics.Region; import android.inputmethodservice.InputMethodService; import android.net.Uri; -import android.os.Process; import android.os.RemoteException; import android.os.SystemProperties; -import android.os.UserManager; import android.provider.Settings; import android.view.MotionEvent; import android.view.ViewConfiguration; @@ -68,7 +65,6 @@ import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener; import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.NavigationMode; import com.android.launcher3.util.SettingsCache; -import com.android.launcher3.util.SimpleBroadcastReceiver; import com.android.quickstep.TopTaskTracker.CachedTaskInfo; import com.android.quickstep.util.NavBarPosition; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -116,15 +112,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { private final boolean mIsOneHandedModeSupported; private boolean mPipIsActive; - private boolean mIsUserUnlocked; - private final ArrayList mUserUnlockedActions = new ArrayList<>(); - private final SimpleBroadcastReceiver mUserUnlockedReceiver = new SimpleBroadcastReceiver(i -> { - if (ACTION_USER_UNLOCKED.equals(i.getAction())) { - mIsUserUnlocked = true; - notifyUserUnlocked(); - } - }); - private int mGestureBlockingTaskId = -1; private @NonNull Region mExclusionRegion = new Region(); private SystemGestureExclusionListenerCompat mExclusionListener; @@ -150,14 +137,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { runOnDestroy(mRotationTouchHelper::destroy); } - // Register for user unlocked if necessary - mIsUserUnlocked = context.getSystemService(UserManager.class) - .isUserUnlocked(Process.myUserHandle()); - if (!mIsUserUnlocked) { - mUserUnlockedReceiver.register(mContext, ACTION_USER_UNLOCKED); - } - runOnDestroy(() -> mUserUnlockedReceiver.unregisterReceiverSafely(mContext)); - // Register for exclusion updates mExclusionListener = new SystemGestureExclusionListenerCompat(mDisplayId) { @Override @@ -316,25 +295,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { return mDisplayId; } - /** - * Adds a callback for when a user is unlocked. If the user is already unlocked, this listener - * will be called back immediately. - */ - public void runOnUserUnlocked(Runnable action) { - if (mIsUserUnlocked) { - action.run(); - } else { - mUserUnlockedActions.add(action); - } - } - - /** - * @return whether the user is unlocked. - */ - public boolean isUserUnlocked() { - return mIsUserUnlocked; - } - /** * @return whether the user has completed setup wizard */ @@ -342,14 +302,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { return mIsUserSetupComplete; } - private void notifyUserUnlocked() { - for (Runnable action : mUserUnlockedActions) { - action.run(); - } - mUserUnlockedActions.clear(); - mUserUnlockedReceiver.unregisterReceiverSafely(mContext); - } - /** * Sets the task id where gestures should be blocked */ @@ -607,7 +559,6 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener { pw.println(" assistantAvailable=" + mAssistantAvailable); pw.println(" assistantDisabled=" + QuickStepContract.isAssistantGestureDisabled(mSystemUiStateFlags)); - pw.println(" isUserUnlocked=" + mIsUserUnlocked); pw.println(" isOneHandedModeEnabled=" + mIsOneHandedModeEnabled); pw.println(" isSwipeToNotificationEnabled=" + mIsSwipeToNotificationEnabled); pw.println(" deferredGestureRegion=" + mDeferredGestureRegion.getBounds()); diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index ec06f87e29..c53e5706c2 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -100,6 +100,7 @@ import com.android.launcher3.tracing.TouchInteractionServiceProto; import com.android.launcher3.uioverrides.flags.FlagsFactory; import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper; import com.android.launcher3.util.DisplayController; +import com.android.launcher3.util.LockedUserState; import com.android.launcher3.util.OnboardingPrefs; import com.android.launcher3.util.TraceHelper; import com.android.quickstep.inputconsumers.AccessibilityInputConsumer; @@ -113,9 +114,9 @@ import com.android.quickstep.inputconsumers.OverviewWithoutFocusInputConsumer; import com.android.quickstep.inputconsumers.ProgressDelegateInputConsumer; import com.android.quickstep.inputconsumers.ResetGestureInputConsumer; import com.android.quickstep.inputconsumers.ScreenPinnedInputConsumer; -import com.android.quickstep.inputconsumers.TrackpadStatusBarInputConsumer; import com.android.quickstep.inputconsumers.SysUiOverlayInputConsumer; import com.android.quickstep.inputconsumers.TaskbarUnstashInputConsumer; +import com.android.quickstep.inputconsumers.TrackpadStatusBarInputConsumer; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.ActiveGestureLog.CompoundString; import com.android.quickstep.util.ProtoTracer; @@ -445,8 +446,8 @@ public class TouchInteractionService extends Service BootAwarePreloader.start(this); // Call runOnUserUnlocked() before any other callbacks to ensure everything is initialized. - mDeviceState.runOnUserUnlocked(this::onUserUnlocked); - mDeviceState.runOnUserUnlocked(mTaskbarManager::onUserUnlocked); + LockedUserState.get(this).runOnUserUnlocked(this::onUserUnlocked); + LockedUserState.get(this).runOnUserUnlocked(mTaskbarManager::onUserUnlocked); mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged); ProtoTracer.INSTANCE.get(this).add(this); @@ -516,7 +517,7 @@ public class TouchInteractionService extends Service } private void resetHomeBounceSeenOnQuickstepEnabledFirstTime() { - if (!mDeviceState.isUserUnlocked() || mDeviceState.isButtonNavMode()) { + if (!LockedUserState.get(this).isUserUnlocked() || mDeviceState.isButtonNavMode()) { // Skip if not yet unlocked (can't read user shared prefs) or if the current navigation // mode doesn't have gestures return; @@ -559,7 +560,7 @@ public class TouchInteractionService extends Service @UiThread private void onSystemUiFlagsChanged(int lastSysUIFlags) { - if (mDeviceState.isUserUnlocked()) { + if (LockedUserState.get(this).isUserUnlocked()) { int systemUiStateFlags = mDeviceState.getSystemUiStateFlags(); SystemUiProxy.INSTANCE.get(this).setLastSystemUiStateFlags(systemUiStateFlags); mOverviewComponentObserver.onSystemUiStateChanged(); @@ -604,7 +605,7 @@ public class TouchInteractionService extends Service @UiThread private void onAssistantVisibilityChanged() { - if (mDeviceState.isUserUnlocked()) { + if (LockedUserState.get(this).isUserUnlocked()) { mOverviewComponentObserver.getActivityInterface().onAssistantVisibilityChanged( mDeviceState.getAssistantVisibility()); } @@ -614,7 +615,7 @@ public class TouchInteractionService extends Service public void onDestroy() { Log.d(TAG, "Touch service destroyed: user=" + getUserId()); sIsInitialized = false; - if (mDeviceState.isUserUnlocked()) { + if (LockedUserState.get(this).isUserUnlocked()) { mInputConsumer.unregisterInputConsumer(); mOverviewComponentObserver.onDestroy(); } @@ -648,7 +649,7 @@ public class TouchInteractionService extends Service TestLogging.recordMotionEvent( TestProtocol.SEQUENCE_TIS, "TouchInteractionService.onInputEvent", event); - if (!mDeviceState.isUserUnlocked() || (mDeviceState.isButtonNavMode() + if (!LockedUserState.get(this).isUserUnlocked() || (mDeviceState.isButtonNavMode() && !isTrackpadMotionEvent(event))) { return; } @@ -677,7 +678,7 @@ public class TouchInteractionService extends Service mGestureState = newGestureState; mConsumer = newConsumer(prevGestureState, mGestureState, event); mUncheckedConsumer = mConsumer; - } else if (mDeviceState.isUserUnlocked() + } else if (LockedUserState.get(this).isUserUnlocked() && (mDeviceState.isFullyGesturalNavMode() || isTrackpadMultiFingerSwipe(event)) && mDeviceState.canTriggerAssistantAction(event)) { mGestureState = createGestureState(mGestureState, @@ -822,7 +823,7 @@ public class TouchInteractionService extends Service boolean canStartSystemGesture = mDeviceState.canStartSystemGesture(); - if (!mDeviceState.isUserUnlocked()) { + if (!LockedUserState.get(this).isUserUnlocked()) { CompoundString reasonString = newCompoundString("device locked"); InputConsumer consumer; if (canStartSystemGesture) { @@ -1181,7 +1182,7 @@ public class TouchInteractionService extends Service } private void preloadOverview(boolean fromInit, boolean forSUWAllSet) { - if (!mDeviceState.isUserUnlocked()) { + if (!LockedUserState.get(this).isUserUnlocked()) { return; } @@ -1217,7 +1218,7 @@ public class TouchInteractionService extends Service @Override public void onConfigurationChanged(Configuration newConfig) { - if (!mDeviceState.isUserUnlocked()) { + if (!LockedUserState.get(this).isUserUnlocked()) { return; } final BaseActivityInterface activityInterface = @@ -1258,7 +1259,7 @@ public class TouchInteractionService extends Service } else { // Dump everything FlagsFactory.dump(pw); - if (mDeviceState.isUserUnlocked()) { + if (LockedUserState.get(this).isUserUnlocked()) { PluginManagerWrapper.INSTANCE.get(getBaseContext()).dump(pw); } mDeviceState.dump(pw); diff --git a/src/com/android/launcher3/util/LockedUserState.kt b/src/com/android/launcher3/util/LockedUserState.kt index 1231604780..0a87594fde 100644 --- a/src/com/android/launcher3/util/LockedUserState.kt +++ b/src/com/android/launcher3/util/LockedUserState.kt @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.android.launcher3.util import android.content.Context diff --git a/tests/src/com/android/launcher3/util/LockedUserStateTest.kt b/tests/src/com/android/launcher3/util/LockedUserStateTest.kt index 84156e7101..92ab2cb90b 100644 --- a/tests/src/com/android/launcher3/util/LockedUserStateTest.kt +++ b/tests/src/com/android/launcher3/util/LockedUserStateTest.kt @@ -32,7 +32,7 @@ import org.mockito.Mockito.verifyZeroInteractions import org.mockito.Mockito.`when` import org.mockito.MockitoAnnotations -/** Unit tests for {@link LockedUserUtil} */ +/** Unit tests for {@link LockedUserState} */ @SmallTest @RunWith(AndroidJUnit4::class) class LockedUserStateTest { @@ -49,40 +49,31 @@ class LockedUserStateTest { @Test fun runOnUserUnlocked_runs_action_immediately_if_already_unlocked() { `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(true) - LockedUserState.INSTANCE.initializeForTesting(LockedUserState(context)) val action: Runnable = mock() - - LockedUserState.get(context).runOnUserUnlocked(action) + LockedUserState(context).runOnUserUnlocked(action) verify(action).run() } @Test fun runOnUserUnlocked_waits_to_run_action_until_user_is_unlocked() { `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(false) - LockedUserState.INSTANCE.initializeForTesting(LockedUserState(context)) val action: Runnable = mock() - - LockedUserState.get(context).runOnUserUnlocked(action) + val state = LockedUserState(context) + state.runOnUserUnlocked(action) verifyZeroInteractions(action) - - LockedUserState.get(context) - .mUserUnlockedReceiver - .onReceive(context, Intent(Intent.ACTION_USER_UNLOCKED)) - + state.mUserUnlockedReceiver.onReceive(context, Intent(Intent.ACTION_USER_UNLOCKED)) verify(action).run() } @Test fun isUserUnlocked_returns_true_when_user_is_unlocked() { `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(true) - LockedUserState.INSTANCE.initializeForTesting(LockedUserState(context)) - assertThat(LockedUserState.get(context).isUserUnlocked).isTrue() + assertThat(LockedUserState(context).isUserUnlocked).isTrue() } @Test fun isUserUnlocked_returns_false_when_user_is_locked() { `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(false) - LockedUserState.INSTANCE.initializeForTesting(LockedUserState(context)) - assertThat(LockedUserState.get(context).isUserUnlocked).isFalse() + assertThat(LockedUserState(context).isUserUnlocked).isFalse() } } From 34c6b871afe341c7cd1ba70b590b4e2340240049 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Fri, 26 May 2023 21:04:19 +0000 Subject: [PATCH 05/20] Fix how task stack listener closes overlays on task changes. Originally gated onTaskMovedToFront behind prototype because looked like it was causing overlay to close when it shouldn't. However, it turns out it was actually onTaskStackChanged that was doing this. Additionally, changing onTaskMovedToFront to close with animation, because this will fire if swiping up from all apps (going to overview so Launcher is considered as the task moving to front). Also, registered onTaskCreated to be a bit more thorough. Test: Manual (EDU, All Apps, and EDU + All Apps) Fix: 283373523 Flag: none Change-Id: I4cd3969f91a93bab190b764a656d9cfc03d1ce09 --- .../taskbar/overlay/TaskbarOverlayController.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java index 8de0e4079a..d4e2be9b49 100644 --- a/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java +++ b/quickstep/src/com/android/launcher3/taskbar/overlay/TaskbarOverlayController.java @@ -23,6 +23,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.launcher3.LauncherState.ALL_APPS; import android.annotation.SuppressLint; +import android.content.ComponentName; import android.content.Context; import android.graphics.PixelFormat; import android.view.Gravity; @@ -36,7 +37,6 @@ import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.taskbar.TaskbarActivityContext; import com.android.launcher3.taskbar.TaskbarControllers; -import com.android.quickstep.views.DesktopTaskView; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; @@ -60,15 +60,15 @@ public final class TaskbarOverlayController { private final TaskStackChangeListener mTaskStackListener = new TaskStackChangeListener() { @Override - public void onTaskStackChanged() { - mProxyView.close(false); + public void onTaskCreated(int taskId, ComponentName componentName) { + // Created task will be below existing overlay, so move out of the way. + hideWindow(); } @Override public void onTaskMovedToFront(int taskId) { - if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) { - mProxyView.close(false); - } + // New front task will be below existing overlay, so move out of the way. + hideWindow(); } }; From 0a8fab01da90f01e4b5896afab7fd4865c85d4d6 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Fri, 26 May 2023 21:11:41 +0000 Subject: [PATCH 06/20] Revert "Keep ViewCaptureRule logic self-contained." This reverts commit eec7a9d90f920bbea38d8001c1a8fe01d0917af3. Reason for revert: Failing tests. Change-Id: Idf16453bbd7f0ace17d8e80d3303fae26b50333b --- .../quickstep/FallbackRecentsTest.java | 5 +- .../launcher3/ui/AbstractLauncherUiTest.java | 5 +- .../launcher3/util/rule/FailureWatcher.java | 24 +++- .../launcher3/util/rule/ViewCaptureRule.kt | 111 ++++++------------ 4 files changed, 64 insertions(+), 81 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java index dbe4402812..97e34c5f10 100644 --- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java @@ -116,11 +116,12 @@ public class FallbackRecentsTest { Utilities.enableRunningInTestHarnessForTests(); } + final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(); mOrderSensitiveRules = RuleChain .outerRule(new SamplerRule()) .around(new NavigationModeSwitchRule(mLauncher)) - .around(new ViewCaptureRule()) - .around(new FailureWatcher(mDevice, mLauncher)); + .around(viewCaptureRule) + .around(new FailureWatcher(mDevice, mLauncher, viewCaptureRule.getViewCapture())); mOtherLauncherActivity = context.getPackageManager().queryIntentActivities( getHomeIntentInPackage(context), diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 5bd28d85a3..d7c4ae3857 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -216,10 +216,11 @@ public abstract class AbstractLauncherUiTest { } protected TestRule getRulesInsideActivityMonitor() { + final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(); final RuleChain inner = RuleChain .outerRule(new PortraitLandscapeRunner(this)) - .around(new ViewCaptureRule()) - .around(new FailureWatcher(mDevice, mLauncher)); + .around(viewCaptureRule) + .around(new FailureWatcher(mDevice, mLauncher, viewCaptureRule.getViewCapture())); return TestHelpers.isInLauncherProcess() ? RuleChain.outerRule(ShellCommandRule.setDefaultLauncher()).around(inner) diff --git a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java index 6b11fd6af4..7ca6a06ed2 100644 --- a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java +++ b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java @@ -6,8 +6,12 @@ import android.os.FileUtils; import android.os.ParcelFileDescriptor.AutoCloseInputStream; import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.test.core.app.ApplicationProvider; import androidx.test.uiautomator.UiDevice; +import com.android.app.viewcapture.ViewCapture; import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.ui.AbstractLauncherUiTest; @@ -28,10 +32,14 @@ public class FailureWatcher extends TestWatcher { private static boolean sSavedBugreport = false; final private UiDevice mDevice; private final LauncherInstrumentation mLauncher; + @NonNull + private final ViewCapture mViewCapture; - public FailureWatcher(UiDevice device, LauncherInstrumentation launcher) { + public FailureWatcher(UiDevice device, LauncherInstrumentation launcher, + @NonNull ViewCapture viewCapture) { mDevice = device; mLauncher = launcher; + mViewCapture = viewCapture; } @Override @@ -63,7 +71,7 @@ public class FailureWatcher extends TestWatcher { @Override protected void failed(Throwable e, Description description) { - onError(mLauncher, description, e); + onError(mLauncher, description, e, mViewCapture); } static File diagFile(Description description, String prefix, String ext) { @@ -74,6 +82,12 @@ public class FailureWatcher extends TestWatcher { public static void onError(LauncherInstrumentation launcher, Description description, Throwable e) { + onError(launcher, description, e, null); + } + + private static void onError(LauncherInstrumentation launcher, Description description, + Throwable e, @Nullable ViewCapture viewCapture) { + final File sceenshot = diagFile(description, "TestScreenshot", "png"); final File hierarchy = diagFile(description, "Hierarchy", "zip"); @@ -88,6 +102,12 @@ public class FailureWatcher extends TestWatcher { out.putNextEntry(new ZipEntry("visible_windows.zip")); dumpCommand("cmd window dump-visible-window-views", out); out.closeEntry(); + + if (viewCapture != null) { + out.putNextEntry(new ZipEntry("FS/data/misc/wmtrace/failed_test.vc")); + viewCapture.dumpTo(out, ApplicationProvider.getApplicationContext()); + out.closeEntry(); + } } catch (Exception ignored) { } diff --git a/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt b/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt index f3fff35c90..0c6553998d 100644 --- a/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt +++ b/tests/src/com/android/launcher3/util/rule/ViewCaptureRule.kt @@ -19,101 +19,62 @@ import android.app.Activity import android.app.Application import android.media.permission.SafeCloseable import android.os.Bundle -import android.util.Log -import androidx.annotation.AnyThread import androidx.test.core.app.ApplicationProvider import com.android.app.viewcapture.SimpleViewCapture import com.android.app.viewcapture.ViewCapture.MAIN_EXECUTOR import com.android.launcher3.util.ActivityLifecycleCallbacksAdapter -import java.io.File -import java.io.FileOutputStream -import java.util.zip.ZipEntry -import java.util.zip.ZipOutputStream -import org.junit.rules.TestWatcher +import org.junit.rules.TestRule import org.junit.runner.Description import org.junit.runners.model.Statement -private const val TAG = "ViewCaptureRule" - /** * This JUnit TestRule registers a listener for activity lifecycle events to attach a ViewCapture * instance that other test rules use to dump the timelapse hierarchy upon an error during a test. * * This rule will not work in OOP tests that don't have access to the activity under test. */ -class ViewCaptureRule : TestWatcher() { - private val viewCapture = SimpleViewCapture("test-view-capture") - private val windowListenerCloseables = mutableListOf() +class ViewCaptureRule : TestRule { + val viewCapture = SimpleViewCapture("test-view-capture") override fun apply(base: Statement, description: Description): Statement { - val testWatcherStatement = super.apply(base, description) - return object : Statement() { override fun evaluate() { - val lifecycleCallbacks = createLifecycleCallbacks(description) - with(ApplicationProvider.getApplicationContext()) { - registerActivityLifecycleCallbacks(lifecycleCallbacks) - try { - testWatcherStatement.evaluate() - } finally { - unregisterActivityLifecycleCallbacks(lifecycleCallbacks) + val windowListenerCloseables = mutableListOf() + + val lifecycleCallbacks = + object : ActivityLifecycleCallbacksAdapter { + override fun onActivityCreated(activity: Activity, bundle: Bundle?) { + super.onActivityCreated(activity, bundle) + windowListenerCloseables.add( + viewCapture.startCapture( + activity.window.decorView, + "${description.testClass?.simpleName}.${description.methodName}" + ) + ) + } + + override fun onActivityDestroyed(activity: Activity) { + super.onActivityDestroyed(activity) + viewCapture.stopCapture(activity.window.decorView) + } } + + val application = ApplicationProvider.getApplicationContext() + application.registerActivityLifecycleCallbacks(lifecycleCallbacks) + + try { + base.evaluate() + } finally { + application.unregisterActivityLifecycleCallbacks(lifecycleCallbacks) + + // Clean up ViewCapture references here rather than in onActivityDestroyed so + // test code can access view hierarchy capture. onActivityDestroyed would delete + // view capture data before FailureWatcher could output it as a test artifact. + // This is on the main thread to avoid a race condition where the onDrawListener + // is removed while onDraw is running, resulting in an IllegalStateException. + MAIN_EXECUTOR.execute { windowListenerCloseables.onEach(SafeCloseable::close) } } } } } - - private fun createLifecycleCallbacks(description: Description) = - object : ActivityLifecycleCallbacksAdapter { - override fun onActivityCreated(activity: Activity, bundle: Bundle?) { - super.onActivityCreated(activity, bundle) - windowListenerCloseables.add( - viewCapture.startCapture( - activity.window.decorView, - "${description.testClass?.simpleName}.${description.methodName}" - ) - ) - } - - override fun onActivityDestroyed(activity: Activity) { - super.onActivityDestroyed(activity) - viewCapture.stopCapture(activity.window.decorView) - } - } - - override fun succeeded(description: Description) = cleanup() - - /** If the test fails, this function will output the ViewCapture information. */ - override fun failed(e: Throwable, description: Description) { - super.failed(e, description) - - val testName = "${description.testClass.simpleName}.${description.methodName}" - val application: Application = ApplicationProvider.getApplicationContext() - val zip = File(application.filesDir, "ViewCapture-$testName.zip") - - ZipOutputStream(FileOutputStream(zip)).use { - it.putNextEntry(ZipEntry("FS/data/misc/wmtrace/failed_test.vc")) - viewCapture.dumpTo(it, ApplicationProvider.getApplicationContext()) - it.closeEntry() - } - cleanup() - - Log.d( - TAG, - "Failed $testName due to ${e::class.java.simpleName}.\n" + - "\tUse go/web-hv to open dump file: \n\t\t${zip.absolutePath}" - ) - } - - /** - * Clean up ViewCapture references can't happen in onActivityDestroyed otherwise view - * hierarchies would be erased before they could be outputted. - * - * This is on the main thread to avoid a race condition where the onDrawListener is removed - * while onDraw is running, resulting in an IllegalStateException. - */ - @AnyThread - private fun cleanup() { - MAIN_EXECUTOR.execute { windowListenerCloseables.onEach(SafeCloseable::close) } - } } From 2c353f29a245459ba4b954324dc2a57491091800 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 26 May 2023 15:45:42 -0700 Subject: [PATCH 07/20] Add logs to see if launcher model isn't loaded when work profile app is added * Add helper method to avoid checking sDebugTracing when logging for tests Bug: 243688989 Flag: None Change-Id: Id6cc3b286171eb598e593c5a8aaea6f2466aad60 --- src/com/android/launcher3/LauncherModel.java | 3 +++ .../android/launcher3/model/BaseModelUpdateTask.java | 5 ++++- .../android/launcher3/testing/shared/TestProtocol.java | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 617afcb292..c20494d604 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -20,6 +20,8 @@ import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURC import static com.android.launcher3.LauncherAppState.ACTION_FORCE_ROLOAD; import static com.android.launcher3.config.FeatureFlags.IS_STUDIO_BUILD; +import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING; +import static com.android.launcher3.testing.shared.TestProtocol.testLogD; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; @@ -560,6 +562,7 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi synchronized (mLock) { // Everything loaded bind the data. mModelLoaded = true; + testLogD(WORK_TAB_MISSING, "launcher model loaded"); } } diff --git a/src/com/android/launcher3/model/BaseModelUpdateTask.java b/src/com/android/launcher3/model/BaseModelUpdateTask.java index 70c98022fe..44d32d902a 100644 --- a/src/com/android/launcher3/model/BaseModelUpdateTask.java +++ b/src/com/android/launcher3/model/BaseModelUpdateTask.java @@ -16,6 +16,7 @@ package com.android.launcher3.model; import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING; +import static com.android.launcher3.testing.shared.TestProtocol.testLogD; import android.util.Log; @@ -72,7 +73,9 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask { @Override public final void run() { - if (!Objects.requireNonNull(mModel).isModelLoaded()) { + boolean isModelLoaded = Objects.requireNonNull(mModel).isModelLoaded(); + testLogD(WORK_TAB_MISSING, "modelLoaded: " + isModelLoaded + " forTask: " + this); + if (!isModelLoaded) { if (DEBUG_TASKS) { Log.d(TAG, "Ignoring model task since loader is pending=" + this); } diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java index bcad5defb2..193438c285 100644 --- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -16,6 +16,8 @@ package com.android.launcher3.testing.shared; +import android.util.Log; + /** * Protocol for custom accessibility events for communication with UI Automation tests. */ @@ -160,4 +162,12 @@ public final class TestProtocol { public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display"; public static final String REQUEST_IS_EMULATE_DISPLAY_RUNNING = "is-emulate-display-running"; public static final String REQUEST_EMULATE_PRINT_DEVICE = "emulate-print-device"; + + /** Logs {@link Log#d(String, String)} if {@link #sDebugTracing} is true. */ + public static void testLogD(String tag, String message) { + if (!sDebugTracing) { + return; + } + Log.d(tag, message); + } } From 48ac5a0f7400688ab29424787d96eacdcbc44bd0 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Sat, 27 May 2023 11:23:31 -0700 Subject: [PATCH 08/20] Simplify trackpad multi-finger gesture recognition logic for gesture nav Now we can use AXIS_GESTURE_SWIPE_FINGER_COUNT per ag/23288416 Test: swipe up to overview / home; workspace scroll 2-finger only / quick switch/ pull down notifications works Bug: 284463803 Change-Id: Ie1c7d13f4683d3b9c8de6e5ea2821df73b97ca29 --- .../NoButtonQuickSwitchTouchController.java | 15 ++++----------- .../src/com/android/quickstep/GestureState.java | 7 +------ .../quickstep/TouchInteractionService.java | 3 --- src/com/android/launcher3/MotionEventsUtils.java | 9 +++++++-- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index b4224bebae..463a0956b3 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -113,7 +113,6 @@ public class NoButtonQuickSwitchTouchController implements TouchController, newCancelListener(this::clearState); private boolean mNoIntercept; - private Boolean mIsTrackpadFourFingerSwipe; private LauncherState mStartState; private boolean mIsHomeScreenVisible = true; @@ -139,9 +138,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, @Override public boolean onControllerInterceptTouchEvent(MotionEvent ev) { - int action = ev.getActionMasked(); - if (action == ACTION_DOWN) { - mIsTrackpadFourFingerSwipe = null; + if (ev.getActionMasked() == ACTION_DOWN) { mNoIntercept = !canInterceptTouch(ev); if (mNoIntercept) { return false; @@ -150,13 +147,6 @@ public class NoButtonQuickSwitchTouchController implements TouchController, // Only detect horizontal swipe for intercept, then we will allow swipe up as well. mSwipeDetector.setDetectableScrollConditions(DIRECTION_RIGHT, false /* ignoreSlopWhenSettling */); - } else if (isTrackpadMultiFingerSwipe(ev) && mIsTrackpadFourFingerSwipe == null - && action == ACTION_MOVE) { - mIsTrackpadFourFingerSwipe = isTrackpadFourFingerSwipe(ev); - mNoIntercept = !mIsTrackpadFourFingerSwipe; - if (mNoIntercept) { - return false; - } } if (mNoIntercept) { @@ -191,6 +181,9 @@ public class NoButtonQuickSwitchTouchController implements TouchController, // TODO(b/268075592): add support for quickswitch to/from desktop return false; } + if (isTrackpadMultiFingerSwipe(ev)) { + return isTrackpadFourFingerSwipe(ev); + } return true; } diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java index 9d7ccb42e4..3d0f6d503c 100644 --- a/quickstep/src/com/android/quickstep/GestureState.java +++ b/quickstep/src/com/android/quickstep/GestureState.java @@ -150,15 +150,10 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL public enum TrackpadGestureType { NONE, - // Assigned before we know whether it's a 3-finger or 4-finger gesture. - MULTI_FINGER, THREE_FINGER, FOUR_FINGER; public static TrackpadGestureType getTrackpadGestureType(MotionEvent event) { - if (!isTrackpadMultiFingerSwipe(event)) { - return TrackpadGestureType.NONE; - } if (isTrackpadThreeFingerSwipe(event)) { return TrackpadGestureType.THREE_FINGER; } @@ -166,7 +161,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL return TrackpadGestureType.FOUR_FINGER; } - return TrackpadGestureType.MULTI_FINGER; + return TrackpadGestureType.NONE; } } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index ec06f87e29..4ed68aaf53 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -741,9 +741,6 @@ public class TouchInteractionService extends Service if (mGestureState.isTrackpadGesture() && (action == ACTION_POINTER_DOWN || action == ACTION_POINTER_UP)) { // Skip ACTION_POINTER_DOWN and ACTION_POINTER_UP events from trackpad. - if (action == ACTION_POINTER_DOWN) { - mGestureState.setTrackpadGestureType(getTrackpadGestureType(event)); - } } else if (event.isHoverEvent()) { mUncheckedConsumer.onHoverEvent(event); } else { diff --git a/src/com/android/launcher3/MotionEventsUtils.java b/src/com/android/launcher3/MotionEventsUtils.java index 40de003bd4..3228ec6942 100644 --- a/src/com/android/launcher3/MotionEventsUtils.java +++ b/src/com/android/launcher3/MotionEventsUtils.java @@ -30,6 +30,9 @@ public class MotionEventsUtils { /** {@link MotionEvent#CLASSIFICATION_MULTI_FINGER_SWIPE} is hidden. */ public static final int CLASSIFICATION_MULTI_FINGER_SWIPE = 4; + /** {@link MotionEvent#AXIS_GESTURE_SWIPE_FINGER_COUNT} is hidden. */ + private static final int AXIS_GESTURE_SWIPE_FINGER_COUNT = 53; + @TargetApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) public static boolean isTrackpadScroll(MotionEvent event) { return ENABLE_TRACKPAD_GESTURE.get() @@ -43,11 +46,13 @@ public class MotionEventsUtils { } public static boolean isTrackpadThreeFingerSwipe(MotionEvent event) { - return isTrackpadMultiFingerSwipe(event) && event.getPointerCount() == 3; + return isTrackpadMultiFingerSwipe(event) && event.getAxisValue( + AXIS_GESTURE_SWIPE_FINGER_COUNT) == 3; } public static boolean isTrackpadFourFingerSwipe(MotionEvent event) { - return isTrackpadMultiFingerSwipe(event) && event.getPointerCount() == 4; + return isTrackpadMultiFingerSwipe(event) && event.getAxisValue( + AXIS_GESTURE_SWIPE_FINGER_COUNT) == 4; } public static boolean isTrackpadMotionEvent(MotionEvent event) { From 827eabe7badd466b2d8fb6317016a161774ba0b7 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 28 May 2023 22:51:24 -0700 Subject: [PATCH 09/20] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: Iffe39983e24f92014ca0b0b546e670c95604dfde --- quickstep/res/values-mk/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml index 9d36c673d0..fcbca7e0ed 100644 --- a/quickstep/res/values-mk/strings.xml +++ b/quickstep/res/values-mk/strings.xml @@ -113,7 +113,7 @@ "Брзи поставки" "Лента со задачи" "Лентата со задачи е прикажана" - "Лентата со задачи е сокриена" + "Лентата со задачи е скриена" "Лента за навигација" "Секогаш прикажувај „Лента“" "Променете режим на навигација" From 709d01e1c89864a25c3373425ac05ee1173dc0cb Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 28 May 2023 22:53:15 -0700 Subject: [PATCH 10/20] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I5d6a85797683ee80a920254615c2aca547844f8a --- res/values-de/strings.xml | 2 +- res/values-fr-rCA/strings.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 2664988a16..93ea28e2c3 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -100,7 +100,7 @@ "Ordner: %1$s, %2$d Elemente" "Ordner: %1$s, %2$d oder mehr Elemente" "Hintergründe" - "Hintergrund & Stil" + "Hintergrund und Stil" "Startbildschirm bearbeiten" "Einstellungen" "Von deinem Administrator deaktiviert" diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml index 8416815925..74789684f3 100644 --- a/res/values-fr-rCA/strings.xml +++ b/res/values-fr-rCA/strings.xml @@ -50,8 +50,7 @@ "Personnels" "Professionnels" "Conversations" - - + "Prise de note" "Renseignements utiles à portée de main" "Pour obtenir des informations sans ouvrir d\'applications, vous pouvez ajouter des widgets à votre écran d\'accueil" "Touchez pour modifier les paramètres du widget" From 5bb829600eb103afe4b1d3050d91e31f93ca2fd6 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 28 May 2023 23:27:12 -0700 Subject: [PATCH 11/20] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I6e2d0769d84d7302ce4d1d46a7155acbdc76dbf1 --- quickstep/res/values-af/strings.xml | 6 ++---- quickstep/res/values-am/strings.xml | 6 ++---- quickstep/res/values-ar/strings.xml | 6 ++---- quickstep/res/values-as/strings.xml | 6 ++---- quickstep/res/values-az/strings.xml | 6 ++---- quickstep/res/values-b+sr+Latn/strings.xml | 6 ++---- quickstep/res/values-be/strings.xml | 6 ++---- quickstep/res/values-bn/strings.xml | 6 ++---- quickstep/res/values-bs/strings.xml | 6 ++---- quickstep/res/values-ca/strings.xml | 6 ++---- quickstep/res/values-cs/strings.xml | 6 ++---- quickstep/res/values-da/strings.xml | 6 ++---- quickstep/res/values-de/strings.xml | 6 ++---- quickstep/res/values-el/strings.xml | 6 ++---- quickstep/res/values-es-rUS/strings.xml | 6 ++---- quickstep/res/values-es/strings.xml | 6 ++---- quickstep/res/values-et/strings.xml | 6 ++---- quickstep/res/values-eu/strings.xml | 6 ++---- quickstep/res/values-fa/strings.xml | 6 ++---- quickstep/res/values-fi/strings.xml | 6 ++---- quickstep/res/values-fr-rCA/strings.xml | 6 ++---- quickstep/res/values-fr/strings.xml | 6 ++---- quickstep/res/values-gl/strings.xml | 6 ++---- quickstep/res/values-gu/strings.xml | 6 ++---- quickstep/res/values-hi/strings.xml | 6 ++---- quickstep/res/values-hr/strings.xml | 6 ++---- quickstep/res/values-hu/strings.xml | 6 ++---- quickstep/res/values-in/strings.xml | 6 ++---- quickstep/res/values-is/strings.xml | 6 ++---- quickstep/res/values-it/strings.xml | 6 ++---- quickstep/res/values-iw/strings.xml | 6 ++---- quickstep/res/values-kk/strings.xml | 6 ++---- quickstep/res/values-km/strings.xml | 6 ++---- quickstep/res/values-kn/strings.xml | 6 ++---- quickstep/res/values-ko/strings.xml | 6 ++---- quickstep/res/values-ky/strings.xml | 6 ++---- quickstep/res/values-lo/strings.xml | 6 ++---- quickstep/res/values-lt/strings.xml | 6 ++---- quickstep/res/values-lv/strings.xml | 6 ++---- quickstep/res/values-mk/strings.xml | 8 +++----- quickstep/res/values-ml/strings.xml | 6 ++---- quickstep/res/values-mn/strings.xml | 6 ++---- quickstep/res/values-mr/strings.xml | 6 ++---- quickstep/res/values-ms/strings.xml | 6 ++---- quickstep/res/values-my/strings.xml | 6 ++---- quickstep/res/values-nb/strings.xml | 6 ++---- quickstep/res/values-ne/strings.xml | 6 ++---- quickstep/res/values-nl/strings.xml | 6 ++---- quickstep/res/values-or/strings.xml | 6 ++---- quickstep/res/values-pa/strings.xml | 6 ++---- quickstep/res/values-pl/strings.xml | 6 ++---- quickstep/res/values-pt-rPT/strings.xml | 6 ++---- quickstep/res/values-pt/strings.xml | 6 ++---- quickstep/res/values-ro/strings.xml | 6 ++---- quickstep/res/values-ru/strings.xml | 6 ++---- quickstep/res/values-si/strings.xml | 6 ++---- quickstep/res/values-sk/strings.xml | 6 ++---- quickstep/res/values-sl/strings.xml | 6 ++---- quickstep/res/values-sq/strings.xml | 6 ++---- quickstep/res/values-sr/strings.xml | 6 ++---- quickstep/res/values-sv/strings.xml | 6 ++---- quickstep/res/values-sw/strings.xml | 6 ++---- quickstep/res/values-ta/strings.xml | 6 ++---- quickstep/res/values-te/strings.xml | 6 ++---- quickstep/res/values-tr/strings.xml | 6 ++---- quickstep/res/values-uk/strings.xml | 6 ++---- quickstep/res/values-ur/strings.xml | 6 ++---- quickstep/res/values-uz/strings.xml | 6 ++---- quickstep/res/values-vi/strings.xml | 6 ++---- quickstep/res/values-zh-rCN/strings.xml | 6 ++---- quickstep/res/values-zu/strings.xml | 6 ++---- 71 files changed, 143 insertions(+), 285 deletions(-) diff --git a/quickstep/res/values-af/strings.xml b/quickstep/res/values-af/strings.xml index 1a530f6ec9..56104e0c0a 100644 --- a/quickstep/res/values-af/strings.xml +++ b/quickstep/res/values-af/strings.xml @@ -122,8 +122,6 @@ "Skuif na regs onder" "{count,plural, =1{Wys nog # app.}other{Wys nog # apps.}}" "%1$s en %2$s" - - - - + "Voeg nou app by werkskerm" + "Kanselleer" diff --git a/quickstep/res/values-am/strings.xml b/quickstep/res/values-am/strings.xml index 6ec75ed0b4..b86e873bf3 100644 --- a/quickstep/res/values-am/strings.xml +++ b/quickstep/res/values-am/strings.xml @@ -122,8 +122,6 @@ "ወደ ታች/ቀኝ ይውሰዱ" "{count,plural, =1{ተጨማሪ # መተግበሪያ አሳይ።}one{ተጨማሪ # መተግበሪያ አሳይ።}other{ተጨማሪ # መተግበሪያዎች አሳይ።}}" "%1$s እና %2$s" - - - - + "መተግበሪያን ወደ ዴስክቶፕ በማከል ላይ" + "ይቅር" diff --git a/quickstep/res/values-ar/strings.xml b/quickstep/res/values-ar/strings.xml index 982cc2a6ba..872f40bdcc 100644 --- a/quickstep/res/values-ar/strings.xml +++ b/quickstep/res/values-ar/strings.xml @@ -122,8 +122,6 @@ "الانتقال إلى يسار الشاشة أو أسفلها" "{count,plural, =1{إظهار تطبيق واحد آخر}zero{إظهار # تطبيق آخر}two{إظهار تطبيقَين آخرَين}few{إظهار # تطبيقات أخرى}many{إظهار # تطبيقًا آخر}other{إظهار # تطبيق آخر}}" "\"%1$s\" و\"%2$s\"" - - - - + "إضافة تطبيق إلى سطح المكتب" + "إلغاء" diff --git a/quickstep/res/values-as/strings.xml b/quickstep/res/values-as/strings.xml index 05ae967911..020d91116e 100644 --- a/quickstep/res/values-as/strings.xml +++ b/quickstep/res/values-as/strings.xml @@ -122,8 +122,6 @@ "তলৰ সোঁফাললৈ নিয়ক" "{count,plural, =1{আৰু # টা এপ্‌ দেখুৱাওক।}one{আৰু # টা এপ্‌ দেখুৱাওক।}other{আৰু # টা এপ্‌ দেখুৱাওক।}}" "%1$s আৰু %2$s" - - - - + "ডেস্কটপত এপ্ যোগ দি থকা হৈছে" + "বাতিল কৰক" diff --git a/quickstep/res/values-az/strings.xml b/quickstep/res/values-az/strings.xml index e2643f8827..a44b1c4921 100644 --- a/quickstep/res/values-az/strings.xml +++ b/quickstep/res/values-az/strings.xml @@ -122,8 +122,6 @@ "Aşağı/sağa köçürün" "{count,plural, =1{Daha # tətbiqi göstərin.}other{Daha # tətbiqi göstərin.}}" "%1$s%2$s" - - - - + "Tətbiqin masaüstünə əlavə edilməsi" + "Ləğv edin" diff --git a/quickstep/res/values-b+sr+Latn/strings.xml b/quickstep/res/values-b+sr+Latn/strings.xml index 3513f4095f..8c05627e88 100644 --- a/quickstep/res/values-b+sr+Latn/strings.xml +++ b/quickstep/res/values-b+sr+Latn/strings.xml @@ -122,8 +122,6 @@ "Premesti dole desno" "{count,plural, =1{Prikaži još # aplikaciju.}one{Prikaži još # aplikaciju.}few{Prikaži još # aplikacije.}other{Prikaži još # aplikacija.}}" "%1$s i %2$s" - - - - + "Dodaje se aplikacija na radnu povrršinu" + "Otkaži" diff --git a/quickstep/res/values-be/strings.xml b/quickstep/res/values-be/strings.xml index b62d9823f5..a967e40b05 100644 --- a/quickstep/res/values-be/strings.xml +++ b/quickstep/res/values-be/strings.xml @@ -122,8 +122,6 @@ "Перамясціць уніз/управа" "{count,plural, =1{Паказаць ячшэ # праграму.}one{Паказаць ячшэ # праграму.}few{Паказаць ячшэ # праграмы.}many{Паказаць ячшэ # праграм.}other{Паказаць ячшэ # праграмы.}}" "%1$s і %2$s" - - - - + "Дадаванне праграмы на камп\'ютар" + "Скасаваць" diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml index 122b5da93f..492ba02732 100644 --- a/quickstep/res/values-bn/strings.xml +++ b/quickstep/res/values-bn/strings.xml @@ -122,8 +122,6 @@ "নিচে/ডানদিকে সরান" "{count,plural, =1{আরও #টি অ্যাপ দেখুন।}one{আরও #টি অ্যাপ দেখুন।}other{আরও #টি অ্যাপ দেখুন।}}" "%1$s%2$s" - - - - + "ডেস্কটপে অ্যাপ যোগ করা হচ্ছে" + "বাতিল করুন" diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml index 354c16e532..314fd97cee 100644 --- a/quickstep/res/values-bs/strings.xml +++ b/quickstep/res/values-bs/strings.xml @@ -122,8 +122,6 @@ "Premjesti dolje desno" "{count,plural, =1{Prikaži još # aplikaciju.}one{Prikaži još # aplikaciju.}few{Prikaži još # aplikacije.}other{Prikaži još # aplikacija.}}" "%1$s i %2$s" - - - - + "Dodavanje aplikacije na radnu površinu" + "Otkaži" diff --git a/quickstep/res/values-ca/strings.xml b/quickstep/res/values-ca/strings.xml index bc6f6b7c89..85b4f97975 100644 --- a/quickstep/res/values-ca/strings.xml +++ b/quickstep/res/values-ca/strings.xml @@ -122,8 +122,6 @@ "Mou a la part inferior o a la dreta" "{count,plural, =1{Mostra # aplicació més.}other{Mostra # aplicacions més.}}" "%1$s i %2$s" - - - - + "S\'està afegint l\'aplicació a l\'ordinador" + "Cancel·la" diff --git a/quickstep/res/values-cs/strings.xml b/quickstep/res/values-cs/strings.xml index befc62ea9c..a6eac945b1 100644 --- a/quickstep/res/values-cs/strings.xml +++ b/quickstep/res/values-cs/strings.xml @@ -122,8 +122,6 @@ "Přesunout doprava dolů" "{count,plural, =1{Zobrazit # další aplikaci.}few{Zobrazit # další aplikace.}many{Zobrazit # další aplikace.}other{Zobrazit # dalších aplikací.}}" "%1$s%2$s" - - - - + "Přidání aplikace na plochu" + "Zrušit" diff --git a/quickstep/res/values-da/strings.xml b/quickstep/res/values-da/strings.xml index 07615e22f1..906e0cfbc7 100644 --- a/quickstep/res/values-da/strings.xml +++ b/quickstep/res/values-da/strings.xml @@ -122,8 +122,6 @@ "Flyt til bunden eller højre side" "{count,plural, =1{Vis # app mere.}one{Vis # app mere.}other{Vis # apps mere.}}" "%1$s og %2$s" - - - - + "Appen føjes til computeren" + "Annuller" diff --git a/quickstep/res/values-de/strings.xml b/quickstep/res/values-de/strings.xml index 2ff90920af..bb4dde119d 100644 --- a/quickstep/res/values-de/strings.xml +++ b/quickstep/res/values-de/strings.xml @@ -122,8 +122,6 @@ "Nach unten / Nach rechts verschieben" "{count,plural, =1{# weitere App anzeigen.}other{# weitere Apps anzeigen.}}" "%1$s und %2$s" - - - - + "Hinzufügen einer App zum Desktop" + "Abbrechen" diff --git a/quickstep/res/values-el/strings.xml b/quickstep/res/values-el/strings.xml index 6626623f7b..70cb41e1d7 100644 --- a/quickstep/res/values-el/strings.xml +++ b/quickstep/res/values-el/strings.xml @@ -122,8 +122,6 @@ "Μετακίνηση κάτω/δεξιά" "{count,plural, =1{Εμφάνιση # ακόμα εφαρμογής.}other{Εμφάνιση # ακόμα εφαρμογών.}}" "%1$s και %2$s" - - - - + "Γίνεται προσθήκη εφαρμογής στον υπολογιστή" + "Ακύρωση" diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml index 78adde87c9..c37f6c355a 100644 --- a/quickstep/res/values-es-rUS/strings.xml +++ b/quickstep/res/values-es-rUS/strings.xml @@ -122,8 +122,6 @@ "Mover a la parte inferior o derecha" "{count,plural, =1{Mostrar # app más.}other{Mostrar # apps más.}}" "%1$s y %2$s" - - - - + "Agregando app al escritorio" + "Cancelar" diff --git a/quickstep/res/values-es/strings.xml b/quickstep/res/values-es/strings.xml index 9b0fdc5082..9f2f9fd9e8 100644 --- a/quickstep/res/values-es/strings.xml +++ b/quickstep/res/values-es/strings.xml @@ -122,8 +122,6 @@ "Mover abajo/a la derecha" "{count,plural, =1{Mostrar # aplicación más.}other{Mostrar # aplicaciones más.}}" "%1$s y %2$s" - - - - + "Añadiendo aplicación al ordenador" + "Cancelar" diff --git a/quickstep/res/values-et/strings.xml b/quickstep/res/values-et/strings.xml index f160418b09..0186c162a1 100644 --- a/quickstep/res/values-et/strings.xml +++ b/quickstep/res/values-et/strings.xml @@ -122,8 +122,6 @@ "Teisalda alla/paremale" "{count,plural, =1{Kuva veel # rakendus.}other{Kuva veel # rakendust.}}" "%1$s ja %2$s" - - - - + "Rakenduse lisamine arvutisse" + "Tühista" diff --git a/quickstep/res/values-eu/strings.xml b/quickstep/res/values-eu/strings.xml index 7dcbeca53e..97bee38370 100644 --- a/quickstep/res/values-eu/strings.xml +++ b/quickstep/res/values-eu/strings.xml @@ -122,8 +122,6 @@ "Eraman behera, eskuinetara" "{count,plural, =1{Erakutsi beste # aplikazio.}other{Erakutsi beste # aplikazio.}}" "%1$s eta %2$s" - - - - + "Aplikazioa mahaigainean gehitzen" + "Utzi" diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml index c0121c6fcf..55d3786693 100644 --- a/quickstep/res/values-fa/strings.xml +++ b/quickstep/res/values-fa/strings.xml @@ -122,8 +122,6 @@ "انتقال به پایین/ راست" "{count,plural, =1{نمایش # برنامه دیگر.}one{نمایش # برنامه دیگر.}other{نمایش # برنامه دیگر.}}" "%1$s و %2$s" - - - - + "درحال افزودن برنامه به رایانه" + "لغو" diff --git a/quickstep/res/values-fi/strings.xml b/quickstep/res/values-fi/strings.xml index fd413962d9..933996e6ae 100644 --- a/quickstep/res/values-fi/strings.xml +++ b/quickstep/res/values-fi/strings.xml @@ -122,8 +122,6 @@ "Siirrä alas tai oikealle" "{count,plural, =1{Näytä # muu sovellus.}other{Näytä # muuta sovellusta.}}" "%1$s ja %2$s" - - - - + "Sovelluksen lisääminen työpöydälle" + "Peru" diff --git a/quickstep/res/values-fr-rCA/strings.xml b/quickstep/res/values-fr-rCA/strings.xml index fa255c3e6a..b8bcffcca7 100644 --- a/quickstep/res/values-fr-rCA/strings.xml +++ b/quickstep/res/values-fr-rCA/strings.xml @@ -122,8 +122,6 @@ "Déplacer vers le coin inférieur droit de l\'écran" "{count,plural, =1{Afficher # autre application.}one{Afficher # autre application.}other{Afficher # autres applications.}}" "%1$s et %2$s" - - - - + "Ajout de l\'application au bureau en cours…" + "Annuler" diff --git a/quickstep/res/values-fr/strings.xml b/quickstep/res/values-fr/strings.xml index 2e3ff1bd93..147db17ffc 100644 --- a/quickstep/res/values-fr/strings.xml +++ b/quickstep/res/values-fr/strings.xml @@ -122,8 +122,6 @@ "Déplacer en bas ou à droite" "{count,plural, =1{Afficher # autre appli.}one{Afficher # autre appli.}other{Afficher # autre applis.}}" "%1$s et %2$s" - - - - + "Ajout de l\'appli au bureau" + "Annuler" diff --git a/quickstep/res/values-gl/strings.xml b/quickstep/res/values-gl/strings.xml index 07cda90fef..2fd2784977 100644 --- a/quickstep/res/values-gl/strings.xml +++ b/quickstep/res/values-gl/strings.xml @@ -122,8 +122,6 @@ "Mover á parte inferior ou á dereita" "{count,plural, =1{Mostrar # aplicación máis.}other{Mostrar # aplicacións máis.}}" "%1$s e %2$s" - - - - + "Engadindo aplicación ao ordenador" + "Cancelar" diff --git a/quickstep/res/values-gu/strings.xml b/quickstep/res/values-gu/strings.xml index b060e77c2d..2c142829b0 100644 --- a/quickstep/res/values-gu/strings.xml +++ b/quickstep/res/values-gu/strings.xml @@ -122,8 +122,6 @@ "સૌથી નીચે જમણી બાજુએ ખસેડો" "{count,plural, =1{વધુ # ઍપ બતાવો.}one{વધુ # ઍપ બતાવો.}other{વધુ # ઍપ બતાવો.}}" "%1$s અને %2$s" - - - - + "ડેસ્કટૉપ પર ઍપ ઉમેરી રહ્યાં છીએ" + "રદ કરો" diff --git a/quickstep/res/values-hi/strings.xml b/quickstep/res/values-hi/strings.xml index 651199165e..d84b05a4bc 100644 --- a/quickstep/res/values-hi/strings.xml +++ b/quickstep/res/values-hi/strings.xml @@ -122,8 +122,6 @@ "नीचे/दाईं तरफ़ ले जाएं" "{count,plural, =1{# और ऐप्लिकेशन दिखाएं.}one{# और ऐप्लिकेशन दिखाएं.}other{# और ऐप्लिकेशन दिखाएं.}}" "%1$s और %2$s" - - - - + "डेस्कटॉप पर ऐप्लिकेशन जोड़ा जा रहा है" + "रद्द करें" diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml index 4fe8d06990..753df152bf 100644 --- a/quickstep/res/values-hr/strings.xml +++ b/quickstep/res/values-hr/strings.xml @@ -122,8 +122,6 @@ "Premjesti dolje/desno" "{count,plural, =1{Prikaži više aplikacija (još #).}one{Prikaži više aplikacija (još #).}few{Prikaži više aplikacija (još #).}other{Prikaži više aplikacija (još #).}}" "%1$s i %2$s" - - - - + "Dodavanje aplikacije na radnu površinu" + "Odustani" diff --git a/quickstep/res/values-hu/strings.xml b/quickstep/res/values-hu/strings.xml index 1878ba350e..63e4baf2ec 100644 --- a/quickstep/res/values-hu/strings.xml +++ b/quickstep/res/values-hu/strings.xml @@ -122,8 +122,6 @@ "Mozgatás alulra vagy a jobb oldalra" "{count,plural, =1{# további alkalmazás megjelenítése.}other{# további alkalmazás megjelenítése.}}" "%1$s és %2$s" - - - - + "Alkalmazás hozzáadása az asztalhoz" + "Mégse" diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml index 9473311d8c..5a06763779 100644 --- a/quickstep/res/values-in/strings.xml +++ b/quickstep/res/values-in/strings.xml @@ -122,8 +122,6 @@ "Pindahkan ke bawah/kanan" "{count,plural, =1{Tampilkan # aplikasi lain.}other{Tampilkan # aplikasi lain.}}" "%1$s dan %2$s" - - - - + "Menambahkan aplikasi ke Desktop" + "Batalkan" diff --git a/quickstep/res/values-is/strings.xml b/quickstep/res/values-is/strings.xml index 672c8ce6ee..7ec957b01d 100644 --- a/quickstep/res/values-is/strings.xml +++ b/quickstep/res/values-is/strings.xml @@ -122,8 +122,6 @@ "Færa neðst/til hægri" "{count,plural, =1{Sýna # forrit í viðbót.}one{Sýna # forrit í viðbót.}other{Sýna # forrit í viðbót.}}" "%1$s og %2$s" - - - - + "Forriti bætt við skjáborð" + "Hætta við" diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml index 47b224cb2d..8f142aed23 100644 --- a/quickstep/res/values-it/strings.xml +++ b/quickstep/res/values-it/strings.xml @@ -122,8 +122,6 @@ "Sposta in basso/a destra" "{count,plural, =1{Mostra # altra app.}other{Mostra altre # app.}}" "%1$s e %2$s" - - - - + "Aggiunta app a desktop in corso…" + "Annulla" diff --git a/quickstep/res/values-iw/strings.xml b/quickstep/res/values-iw/strings.xml index 1fc5f7b0f4..56a45b57af 100644 --- a/quickstep/res/values-iw/strings.xml +++ b/quickstep/res/values-iw/strings.xml @@ -122,8 +122,6 @@ "העברה לפינה הימנית/התחתונה" "{count,plural, =1{הצגת אפליקציה אחת (#) נוספת.}one{הצגת # אפליקציות נוספות.}two{הצגת # אפליקציות נוספות.}other{הצגת # אפליקציות נוספות.}}" "%1$s ו-%2$s" - - - - + "האפליקציה מתווספת לשולחן העבודה" + "ביטול" diff --git a/quickstep/res/values-kk/strings.xml b/quickstep/res/values-kk/strings.xml index 3546bd4a22..05cfd74cd9 100644 --- a/quickstep/res/values-kk/strings.xml +++ b/quickstep/res/values-kk/strings.xml @@ -122,8 +122,6 @@ "Төмен/оңға жылжыту" "{count,plural, =1{Тағы # қолданбаны көрсету.}other{Тағы # қолданбаны көрсету.}}" "%1$s және %2$s" - - - - + "Жұмыс үстеліне қолданба қосу" + "Бас тарту" diff --git a/quickstep/res/values-km/strings.xml b/quickstep/res/values-km/strings.xml index e2b47bf921..1ece40b4df 100644 --- a/quickstep/res/values-km/strings.xml +++ b/quickstep/res/values-km/strings.xml @@ -122,8 +122,6 @@ "ផ្លាស់ទីទៅខាងក្រោម/ស្ដាំ" "{count,plural, =1{បង្ហាញកម្មវិធី # ទៀត។}other{បង្ហាញ​កម្មវិធី # ទៀត។}}" "%1$s និង %2$s" - - - - + "កំពុងបញ្ចូល​កម្មវិធីទៅកុំព្យូទ័រ" + "បោះបង់" diff --git a/quickstep/res/values-kn/strings.xml b/quickstep/res/values-kn/strings.xml index 69d7aaebf0..d526f89e10 100644 --- a/quickstep/res/values-kn/strings.xml +++ b/quickstep/res/values-kn/strings.xml @@ -122,8 +122,6 @@ "ಕೆಳಗಿನ/ಬಲಭಾಗಕ್ಕೆ ಸರಿಸಿ" "{count,plural, =1{ಇನ್ನೂ # ಆ್ಯಪ್ ಅನ್ನು ತೋರಿಸಿ.}one{ಇನ್ನೂ # ಆ್ಯಪ್‌ಗಳನ್ನು ತೋರಿಸಿ.}other{ಇನ್ನೂ # ಆ್ಯಪ್‌ಗಳನ್ನು ತೋರಿಸಿ.}}" "%1$s ಮತ್ತು %2$s" - - - - + "ಡೆಸ್ಕ್‌ಟಾಪ್‌ಗೆ ಆ್ಯಪ್ ಅನ್ನು ಸೇರಿಸಲಾಗುತ್ತಿದೆ" + "ರದ್ದುಮಾಡಿ" diff --git a/quickstep/res/values-ko/strings.xml b/quickstep/res/values-ko/strings.xml index 7a7c513d2f..72900f1176 100644 --- a/quickstep/res/values-ko/strings.xml +++ b/quickstep/res/values-ko/strings.xml @@ -122,8 +122,6 @@ "하단/오른쪽으로 이동" "{count,plural, =1{앱 #개 더 표시}other{앱 #개 더 표시}}" "%1$s%2$s" - - - - + "데스크톱에 앱 추가하기" + "취소" diff --git a/quickstep/res/values-ky/strings.xml b/quickstep/res/values-ky/strings.xml index 2c2d6fd49d..5f944ece4c 100644 --- a/quickstep/res/values-ky/strings.xml +++ b/quickstep/res/values-ky/strings.xml @@ -122,8 +122,6 @@ "Төмөнкү/оң бурчка жылдыруу" "{count,plural, =1{Дагы # колдонмону көрсөтүү.}other{Дагы # колдонмону көрсөтүү.}}" "%1$s жана %2$s" - - - - + "Колдонмону иш тактага кошуу" + "Жокко чыгаруу" diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml index 4a9e7e8fb1..a9a9202a6b 100644 --- a/quickstep/res/values-lo/strings.xml +++ b/quickstep/res/values-lo/strings.xml @@ -122,8 +122,6 @@ "ຍ້າຍໄປຂວາ/ລຸ່ມ" "{count,plural, =1{ສະແດງອີກ # ແອັບ.}other{ສະແດງອີກ # ແອັບ.}}" "%1$s ແລະ %2$s" - - - - + "ການເພີ່ມແອັບໄປໃສ່ເດັສທັອບ" + "ຍົກເລີກ" diff --git a/quickstep/res/values-lt/strings.xml b/quickstep/res/values-lt/strings.xml index 04fe87bdb2..54173742c0 100644 --- a/quickstep/res/values-lt/strings.xml +++ b/quickstep/res/values-lt/strings.xml @@ -122,8 +122,6 @@ "Perkelti žemyn, dešinėn" "{count,plural, =1{Rodyti dar # programą.}one{Rodyti dar # programą.}few{Rodyti dar # programas.}many{Rodyti dar # programos.}other{Rodyti dar # programų.}}" "„%1$s“ ir „%2$s“" - - - - + "Pridedama programa prie darbalaukio" + "Atšaukti" diff --git a/quickstep/res/values-lv/strings.xml b/quickstep/res/values-lv/strings.xml index af3bb70f15..d193c9d707 100644 --- a/quickstep/res/values-lv/strings.xml +++ b/quickstep/res/values-lv/strings.xml @@ -122,8 +122,6 @@ "Pārvietot uz apakšējo/labo stūri" "{count,plural, =1{Rādīt vēl # lietotni}zero{Rādīt vēl # lietotnes}one{Rādīt vēl # lietotni}other{Rādīt vēl # lietotnes}}" "“%1$s” un “%2$s”" - - - - + "Notiek lietotnes pievienošana datoram" + "Atcelt" diff --git a/quickstep/res/values-mk/strings.xml b/quickstep/res/values-mk/strings.xml index c6492b33b7..130c19858e 100644 --- a/quickstep/res/values-mk/strings.xml +++ b/quickstep/res/values-mk/strings.xml @@ -113,7 +113,7 @@ "Брзи поставки" "Лента со задачи" "Лентата со задачи е прикажана" - "Лентата со задачи е сокриена" + "Лентата со задачи е скриена" "Лента за навигација" "Секогаш прикажувај „Лента“" "Променете режим на навигација" @@ -122,8 +122,6 @@ "Премести долу десно" "{count,plural, =1{Прикажи уште # апликација.}one{Прикажи уште # апликација.}other{Прикажи уште # апликации.}}" "%1$s и %2$s" - - - - + "Додавање на апликацијата во „Работна површина“" + "Откажи" diff --git a/quickstep/res/values-ml/strings.xml b/quickstep/res/values-ml/strings.xml index fce4583b2e..4182ee3cc5 100644 --- a/quickstep/res/values-ml/strings.xml +++ b/quickstep/res/values-ml/strings.xml @@ -122,8 +122,6 @@ "താഴേക്കോ വലത്തേക്കോ നീക്കുക" "{count,plural, =1{# ആപ്പ് കൂടി കാണിക്കുക.}other{# ആപ്പുകൾ കൂടി കാണിക്കുക.}}" "%1$s, %2$s" - - - - + "ആപ്പ് ഡെസ്ക്ടോപ്പിലേക്ക് ചേർക്കുന്നു" + "റദ്ദാക്കുക" diff --git a/quickstep/res/values-mn/strings.xml b/quickstep/res/values-mn/strings.xml index f5496879c8..005dbd9a16 100644 --- a/quickstep/res/values-mn/strings.xml +++ b/quickstep/res/values-mn/strings.xml @@ -122,8 +122,6 @@ "Баруун доод хэсэг рүү зөөх" "{count,plural, =1{Өөр # аппыг харуулна уу.}other{Өөр # аппыг харуулна уу.}}" "%1$s болон %2$s" - - - - + "Компьютерт апп нэмж байна" + "Цуцлах" diff --git a/quickstep/res/values-mr/strings.xml b/quickstep/res/values-mr/strings.xml index 6e1141f582..7413d9fe84 100644 --- a/quickstep/res/values-mr/strings.xml +++ b/quickstep/res/values-mr/strings.xml @@ -122,8 +122,6 @@ "तळाशी/उजवीकडे हलवा" "{count,plural, =1{आणखी # अ‍ॅप दाखवा.}other{आणखी # अ‍ॅप्स दाखवा.}}" "%1$s आणि %2$s" - - - - + "डेस्कटॉपवर ॲप जोडत आहे" + "रद्द करा" diff --git a/quickstep/res/values-ms/strings.xml b/quickstep/res/values-ms/strings.xml index f6ce17e7e9..cc3c1ced92 100644 --- a/quickstep/res/values-ms/strings.xml +++ b/quickstep/res/values-ms/strings.xml @@ -122,8 +122,6 @@ "Alihkan ke bawah/kanan" "{count,plural, =1{Tunjukkan # lagi apl.}other{Tunjukkan # lagi apl.}}" "%1$s dan %2$s" - - - - + "Menambahkan apl pada Desktop" + "Batal" diff --git a/quickstep/res/values-my/strings.xml b/quickstep/res/values-my/strings.xml index aeb81a5202..a8b53f68ba 100644 --- a/quickstep/res/values-my/strings.xml +++ b/quickstep/res/values-my/strings.xml @@ -122,8 +122,6 @@ "အောက်ခြေ/ညာဘက်သို့ ရွှေ့ရန်" "{count,plural, =1{နောက်ထပ်အက်ပ် # ခု ပြပါ။}other{နောက်ထပ်အက်ပ် # ခု ပြပါ။}}" "%1$s နှင့် %2$s" - - - - + "‘ဒက်စ်တော့’ တွင် အက်ပ်ကို ထည့်ခြင်း" + "မလုပ်တော့" diff --git a/quickstep/res/values-nb/strings.xml b/quickstep/res/values-nb/strings.xml index bd3a525231..1268ffad63 100644 --- a/quickstep/res/values-nb/strings.xml +++ b/quickstep/res/values-nb/strings.xml @@ -122,8 +122,6 @@ "Flytt til nederst/høyre" "{count,plural, =1{Vis # app til.}other{Vis # apper til.}}" "%1$s og %2$s" - - - - + "Legg til apper på datamaskin" + "Avbryt" diff --git a/quickstep/res/values-ne/strings.xml b/quickstep/res/values-ne/strings.xml index 82d71d6e41..00c84512d3 100644 --- a/quickstep/res/values-ne/strings.xml +++ b/quickstep/res/values-ne/strings.xml @@ -122,8 +122,6 @@ "फेद/दायाँतिर सार्नुहोस्" "{count,plural, =1{थप # एप देखाइयोस्।}other{थप # वटा एप देखाइयोस्।}}" "%1$s%2$s" - - - - + "डेस्कटपमा एप हालिँदै छ" + "रद्द गर्नुहोस्" diff --git a/quickstep/res/values-nl/strings.xml b/quickstep/res/values-nl/strings.xml index 631535b63d..1e273c37fc 100644 --- a/quickstep/res/values-nl/strings.xml +++ b/quickstep/res/values-nl/strings.xml @@ -122,8 +122,6 @@ "Naar beneden/rechts verplaatsen" "{count,plural, =1{Nog # app tonen.}other{Nog # apps tonen.}}" "%1$s en %2$s" - - - - + "App toevoegen aan desktop" + "Annuleren" diff --git a/quickstep/res/values-or/strings.xml b/quickstep/res/values-or/strings.xml index 2b5750fd62..a41fbe7208 100644 --- a/quickstep/res/values-or/strings.xml +++ b/quickstep/res/values-or/strings.xml @@ -122,8 +122,6 @@ "ନିମ୍ନ/ଡାହାଣକୁ ମୁଭ କରନ୍ତୁ" "{count,plural, =1{ଅଧିକ #ଟି ଆପ ଦେଖାନ୍ତୁ।}other{ଅଧିକ #ଟି ଆପ୍ସ ଦେଖାନ୍ତୁ।}}" "%1$s ଏବଂ %2$s" - - - - + "ଡେସ୍କଟପରେ ଆପ ଯୋଗ କରାଯାଉଛି" + "ବାତିଲ କରନ୍ତୁ" diff --git a/quickstep/res/values-pa/strings.xml b/quickstep/res/values-pa/strings.xml index 0d89af5ce3..ab76838d8b 100644 --- a/quickstep/res/values-pa/strings.xml +++ b/quickstep/res/values-pa/strings.xml @@ -122,8 +122,6 @@ "ਹੇਠਾਂ/ਸੱਜੇ ਪਾਸੇ ਲੈ ਕੇ ਜਾਓ" "{count,plural, =1{# ਹੋਰ ਐਪ ਦਿਖਾਓ।}one{# ਹੋਰ ਐਪ ਦਿਖਾਓ।}other{# ਹੋਰ ਐਪਾਂ ਦਿਖਾਓ।}}" "%1$s ਅਤੇ %2$s" - - - - + "ਐਪ ਨੂੰ ਡੈਸਕਟਾਪ \'ਤੇ ਸ਼ਾਮਲ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ" + "ਰੱਦ ਕਰੋ" diff --git a/quickstep/res/values-pl/strings.xml b/quickstep/res/values-pl/strings.xml index ab267d4cf2..e0bec9c77c 100644 --- a/quickstep/res/values-pl/strings.xml +++ b/quickstep/res/values-pl/strings.xml @@ -122,8 +122,6 @@ "Przesuń w dolny prawy róg" "{count,plural, =1{Pokaż jeszcze # aplikację.}few{Pokaż jeszcze # aplikacje.}many{Pokaż jeszcze # aplikacji.}other{Pokaż jeszcze # aplikacji.}}" "%1$s%2$s" - - - - + "Dodaję aplikację do komputera" + "Anuluj" diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml index b1eb0254c5..1b953ca85a 100644 --- a/quickstep/res/values-pt-rPT/strings.xml +++ b/quickstep/res/values-pt-rPT/strings.xml @@ -122,8 +122,6 @@ "Mover para a part superior direita" "{count,plural, =1{Mostrar mais # app.}other{Mostrar mais # apps.}}" "%1$s e %2$s" - - - - + "A adicionar a app ao computador" + "Cancelar" diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml index b95321142d..1e61ad9ae0 100644 --- a/quickstep/res/values-pt/strings.xml +++ b/quickstep/res/values-pt/strings.xml @@ -122,8 +122,6 @@ "Mover para baixo/para a direita" "{count,plural, =1{Mostrar mais # app.}one{Mostrar mais # app.}other{Mostrar mais # apps.}}" "%1$s e %2$s" - - - - + "Adicionando app ao computador" + "Cancelar" diff --git a/quickstep/res/values-ro/strings.xml b/quickstep/res/values-ro/strings.xml index 2d117f22dd..3562074e6b 100644 --- a/quickstep/res/values-ro/strings.xml +++ b/quickstep/res/values-ro/strings.xml @@ -122,8 +122,6 @@ "Mută în dreapta jos" "{count,plural, =1{Afișează încă # aplicație}few{Afișează încă # aplicații}other{Afișează încă # de aplicații}}" "%1$s și %2$s" - - - - + "Se adaugă aplicația pe computer" + "Anulează" diff --git a/quickstep/res/values-ru/strings.xml b/quickstep/res/values-ru/strings.xml index e8f1191c88..2e92ee2715 100644 --- a/quickstep/res/values-ru/strings.xml +++ b/quickstep/res/values-ru/strings.xml @@ -122,8 +122,6 @@ "Переместить вниз или вправо" "{count,plural, =1{Показать ещё # приложение}one{Показать ещё # приложение}few{Показать ещё # приложения}many{Показать ещё # приложений}other{Показать ещё # приложения}}" "%1$s и %2$s" - - - - + "Добавление приложения на компьютер" + "Отмена" diff --git a/quickstep/res/values-si/strings.xml b/quickstep/res/values-si/strings.xml index 5b7b016b68..2369e514a3 100644 --- a/quickstep/res/values-si/strings.xml +++ b/quickstep/res/values-si/strings.xml @@ -122,8 +122,6 @@ "පහළ/දකුණ වෙත ගෙන යන්න" "{count,plural, =1{තවත් # යෙදුමක් පෙන්වන්න.}one{තවත් යෙදුම් #ක් පෙන්වන්න.}other{තවත් යෙදුම් #ක් පෙන්වන්න.}}" "%1$s සහ %2$s" - - - - + "ඩෙස්ක්ටොප් වෙත යෙදුම එක් කිරීම" + "අවලංගු කරන්න" diff --git a/quickstep/res/values-sk/strings.xml b/quickstep/res/values-sk/strings.xml index 6c0d7ccaae..2291b19c82 100644 --- a/quickstep/res/values-sk/strings.xml +++ b/quickstep/res/values-sk/strings.xml @@ -122,8 +122,6 @@ "Presunúť dole alebo doprava" "{count,plural, =1{Zobraziť # ďalšiu aplikáciu.}few{Zobraziť # ďalšie aplikácie.}many{Show # more apps.}other{Zobraziť # ďalších aplikácií.}}" "%1$s%2$s" - - - - + "Pridanie aplikácie na plochu" + "Zrušiť" diff --git a/quickstep/res/values-sl/strings.xml b/quickstep/res/values-sl/strings.xml index 5f108bd0f8..3c4a45fbd7 100644 --- a/quickstep/res/values-sl/strings.xml +++ b/quickstep/res/values-sl/strings.xml @@ -122,8 +122,6 @@ "Premakni na dno/desno" "{count,plural, =1{Pokaži še # aplikacijo.}one{Pokaži še # aplikacijo.}two{Pokaži še # aplikaciji.}few{Pokaži še # aplikacije.}other{Pokaži še # aplikacij.}}" "%1$s in %2$s" - - - - + "Dodajanje aplikacije na namizje" + "Prekliči" diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml index 3443b3a8a8..1b207a4ef0 100644 --- a/quickstep/res/values-sq/strings.xml +++ b/quickstep/res/values-sq/strings.xml @@ -122,8 +122,6 @@ "Lëviz në fund/djathtas" "{count,plural, =1{Shfaq # aplikacion tjetër.}other{Shfaq # aplikacione të tjera.}}" "%1$s dhe %2$s" - - - - + "Shtimi i aplikacionit te desktopi" + "Anulo" diff --git a/quickstep/res/values-sr/strings.xml b/quickstep/res/values-sr/strings.xml index 5dab234590..d9491383e7 100644 --- a/quickstep/res/values-sr/strings.xml +++ b/quickstep/res/values-sr/strings.xml @@ -122,8 +122,6 @@ "Премести доле десно" "{count,plural, =1{Прикажи још # апликацију.}one{Прикажи још # апликацију.}few{Прикажи још # апликације.}other{Прикажи још # апликација.}}" "%1$s и %2$s" - - - - + "Додаје се апликација на радну поврршину" + "Откажи" diff --git a/quickstep/res/values-sv/strings.xml b/quickstep/res/values-sv/strings.xml index cdeaa2e937..0ff9288c7d 100644 --- a/quickstep/res/values-sv/strings.xml +++ b/quickstep/res/values-sv/strings.xml @@ -122,8 +122,6 @@ "Flytta längst ned/till höger" "{count,plural, =1{Visa # app till.}other{Visa # appar till.}}" "%1$s och %2$s" - - - - + "Lägger till appen på skrivbordet" + "Avbryt" diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml index 1d5fe60ed3..d895ebfd20 100644 --- a/quickstep/res/values-sw/strings.xml +++ b/quickstep/res/values-sw/strings.xml @@ -122,8 +122,6 @@ "Sogeza chini/kulia" "{count,plural, =1{Onyesha programu # zaidi.}other{Onyesha programu # zaidi.}}" "%1$s na %2$s" - - - - + "Kuweka programu kwenye Eneo-kazi" + "Ghairi" diff --git a/quickstep/res/values-ta/strings.xml b/quickstep/res/values-ta/strings.xml index 462b4765f2..cc589d7e26 100644 --- a/quickstep/res/values-ta/strings.xml +++ b/quickstep/res/values-ta/strings.xml @@ -122,8 +122,6 @@ "கீழே/வலதுபுறம் நகர்த்தும்" "{count,plural, =1{மேலும் # ஆப்ஸைக் காட்டு.}other{மேலும் # ஆப்ஸைக் காட்டு.}}" "%1$s மற்றும் %2$s" - - - - + "ஆப்ஸை டெஸ்க்டாப்பில் சேர்க்கிறது" + "ரத்துசெய்" diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml index 29e94a217a..4e80fb8321 100644 --- a/quickstep/res/values-te/strings.xml +++ b/quickstep/res/values-te/strings.xml @@ -122,8 +122,6 @@ "దిగువ/కుడి వైపునకు తరలించండి" "{count,plural, =1{మరో # యాప్‌ను చూడండి.}other{మరో # యాప్‌లను చూడండి.}}" "%1$s, %2$s" - - - - + "డెస్క్‌టాప్‌నకు యాప్‌ను జోడిస్తోంది" + "రద్దు చేయండి" diff --git a/quickstep/res/values-tr/strings.xml b/quickstep/res/values-tr/strings.xml index 9687c33f7a..d263601313 100644 --- a/quickstep/res/values-tr/strings.xml +++ b/quickstep/res/values-tr/strings.xml @@ -122,8 +122,6 @@ "Sağ alta taşı" "{count,plural, =1{# uygulama daha göster.}other{# uygulama daha göster}}" "%1$s ve %2$s" - - - - + "Uygulama Masaüstü\'ne ekleniyor" + "İptal" diff --git a/quickstep/res/values-uk/strings.xml b/quickstep/res/values-uk/strings.xml index d18bdf3602..8c325f33ac 100644 --- a/quickstep/res/values-uk/strings.xml +++ b/quickstep/res/values-uk/strings.xml @@ -122,8 +122,6 @@ "Перемістити вниз або вправо" "{count,plural, =1{Показати ще # додаток.}one{Показати ще # додаток.}few{Показати ще # додатки.}many{Показати ще # додатків.}other{Показати ще # додатка.}}" "%1$s та %2$s" - - - - + "Встановлення додатка на комп’ютер" + "Скасувати" diff --git a/quickstep/res/values-ur/strings.xml b/quickstep/res/values-ur/strings.xml index d78a8f6517..e2df2ee486 100644 --- a/quickstep/res/values-ur/strings.xml +++ b/quickstep/res/values-ur/strings.xml @@ -122,8 +122,6 @@ "نیچے/دائیں طرف منتقل کریں" "{count,plural, =1{# مزید ایپ دکھائیں۔}other{# مزید ایپس دکھائیں۔}}" "%1$s اور %2$s" - - - - + "ڈیسک ٹاپ پر ایپ شامل کرنا" + "منسوخ کریں" diff --git a/quickstep/res/values-uz/strings.xml b/quickstep/res/values-uz/strings.xml index f7fcedb671..43a1b86242 100644 --- a/quickstep/res/values-uz/strings.xml +++ b/quickstep/res/values-uz/strings.xml @@ -122,8 +122,6 @@ "Pastga yoki oʻngga oʻtkazish" "{count,plural, =1{Yana # ta ilovani chiqarish}other{Yana # ta ilovani chiqarish}}" "%1$s va %2$s" - - - - + "Ilova kompyuterga qoʻshilmoqda" + "Bekor qilish" diff --git a/quickstep/res/values-vi/strings.xml b/quickstep/res/values-vi/strings.xml index d3b2151f97..635a7bcb6a 100644 --- a/quickstep/res/values-vi/strings.xml +++ b/quickstep/res/values-vi/strings.xml @@ -122,8 +122,6 @@ "Chuyển xuống dưới cùng/sang bên phải" "{count,plural, =1{Hiện thêm # ứng dụng.}other{Hiện thêm # ứng dụng.}}" "%1$s%2$s" - - - - + "Đang thêm ứng dụng vào máy tính" + "Huỷ" diff --git a/quickstep/res/values-zh-rCN/strings.xml b/quickstep/res/values-zh-rCN/strings.xml index cd42e1dc75..05f92aa149 100644 --- a/quickstep/res/values-zh-rCN/strings.xml +++ b/quickstep/res/values-zh-rCN/strings.xml @@ -122,8 +122,6 @@ "移到底部/右侧" "{count,plural, =1{显示另外 # 个应用。}other{显示另外 # 个应用。}}" "%1$s%2$s" - - - - + "将应用添加到桌面" + "取消" diff --git a/quickstep/res/values-zu/strings.xml b/quickstep/res/values-zu/strings.xml index 42393c3306..7313972dac 100644 --- a/quickstep/res/values-zu/strings.xml +++ b/quickstep/res/values-zu/strings.xml @@ -122,8 +122,6 @@ "Hamba phansi/kwesokudla" "{count,plural, =1{Bonisa i-app e-# ngaphezulu.}one{Bonisa ama-app angu-# ngaphezulu.}other{Bonisa ama-app angu-# ngaphezulu.}}" "I-%1$s ne-%2$s" - - - - + "Yengeza i-app ku-Deskithophu" + "Khansela" From bd415ba60d3b96d966db70e941c1de472e671721 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Sun, 28 May 2023 23:28:37 -0700 Subject: [PATCH 12/20] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I19116ec25fdef750a9ef48f36cc60f2dcd8a3dd2 --- res/values-de/strings.xml | 2 +- res/values-fr-rCA/strings.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 2664988a16..93ea28e2c3 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -100,7 +100,7 @@ "Ordner: %1$s, %2$d Elemente" "Ordner: %1$s, %2$d oder mehr Elemente" "Hintergründe" - "Hintergrund & Stil" + "Hintergrund und Stil" "Startbildschirm bearbeiten" "Einstellungen" "Von deinem Administrator deaktiviert" diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml index 8416815925..74789684f3 100644 --- a/res/values-fr-rCA/strings.xml +++ b/res/values-fr-rCA/strings.xml @@ -50,8 +50,7 @@ "Personnels" "Professionnels" "Conversations" - - + "Prise de note" "Renseignements utiles à portée de main" "Pour obtenir des informations sans ouvrir d\'applications, vous pouvez ajouter des widgets à votre écran d\'accueil" "Touchez pour modifier les paramètres du widget" From 7120373bbc9f7ad6cf2d44966e04d31b2ecd07d3 Mon Sep 17 00:00:00 2001 From: Kateryna Ivanova Date: Wed, 24 May 2023 15:09:00 +0000 Subject: [PATCH 13/20] Migrate Interpolators from Launcher3 to the public animation library Test: atest Bug: 271850966 Change-Id: Iba999f2e753764a37d35e508e707df02388432e9 --- Android.bp | 1 + .../launcher3/QuickstepTransitionManager.java | 24 +- .../hybridhotseat/HotseatEduDialog.java | 2 +- .../statehandlers/DepthController.java | 2 +- .../taskbar/KeyboardQuickSwitchView.java | 2 +- .../taskbar/TaskbarBackgroundRenderer.kt | 2 +- .../taskbar/TaskbarDragController.java | 6 +- .../taskbar/TaskbarStashController.java | 8 +- .../taskbar/TaskbarStashViaTouchController.kt | 2 +- .../taskbar/TaskbarTranslationController.java | 2 +- .../taskbar/TaskbarViewController.java | 6 +- .../allapps/TaskbarAllAppsSlideInView.java | 2 +- .../taskbar/bubbles/BubbleBarBackground.kt | 2 +- .../BaseRecentsViewStateController.java | 8 +- .../uioverrides/PredictedAppIcon.java | 6 +- .../uioverrides/QuickstepLauncher.java | 2 +- .../RecentsViewStateController.java | 2 +- .../uioverrides/states/AllAppsState.java | 4 +- .../uioverrides/states/OverviewState.java | 4 +- .../QuickstepAtomicAnimationFactory.java | 44 ++-- .../NavBarToHomeTouchController.java | 4 +- ...ButtonNavbarToOverviewTouchController.java | 4 +- .../NoButtonQuickSwitchTouchController.java | 12 +- .../PortraitStatesTouchController.java | 2 +- .../QuickSwitchTouchController.java | 20 +- .../TaskViewTouchController.java | 2 +- .../android/quickstep/AbsSwipeUpHandler.java | 16 +- .../quickstep/BaseActivityInterface.java | 8 +- .../quickstep/FallbackSwipeHandler.java | 6 +- .../quickstep/LauncherActivityInterface.java | 2 +- .../quickstep/LauncherSwipeHandlerV2.java | 4 +- .../android/quickstep/RecentsActivity.java | 4 +- .../quickstep/SwipeUpAnimationLogic.java | 6 +- .../com/android/quickstep/TaskViewUtils.java | 22 +- .../FallbackRecentsStateController.java | 6 +- .../AssistantInputConsumer.java | 4 +- .../DeviceLockedInputConsumer.java | 4 +- .../ProgressDelegateInputConsumer.java | 2 +- .../quickstep/interaction/AllSetActivity.java | 4 +- .../BackGestureTutorialController.java | 6 +- .../interaction/EdgeBackGesturePanel.java | 2 +- .../OverviewGestureTutorialController.java | 4 +- .../SwipeUpGestureTutorialController.java | 14 +- .../AnimatorControllerWithResistance.java | 6 +- .../quickstep/util/BorderAnimator.java | 2 +- .../util/OverviewToSplitTimings.java | 4 +- .../util/PhoneOverviewToSplitTimings.java | 2 +- .../quickstep/util/SplitAnimationTimings.java | 2 +- .../quickstep/util/SplitToConfirmTimings.java | 2 +- .../util/StaggeredWorkspaceAnim.java | 2 +- .../util/TabletHomeToSplitTimings.java | 2 +- .../util/TabletOverviewToSplitTimings.java | 10 +- .../quickstep/util/TransformParams.java | 5 +- .../quickstep/util/WorkspaceRevealAnim.java | 2 +- .../quickstep/views/AllAppsEduView.java | 6 +- .../quickstep/views/DesktopAppSelectView.java | 2 +- .../quickstep/views/FloatingTaskView.java | 4 +- .../android/quickstep/views/RecentsView.java | 28 +-- .../android/quickstep/views/TaskMenuView.java | 4 +- .../com/android/quickstep/views/TaskView.java | 10 +- .../android/launcher3/ButtonDropTarget.java | 4 +- src/com/android/launcher3/CellLayout.java | 8 +- src/com/android/launcher3/DeviceProfile.java | 2 +- src/com/android/launcher3/DropTargetBar.java | 4 +- src/com/android/launcher3/Launcher.java | 2 +- src/com/android/launcher3/LauncherState.java | 12 +- src/com/android/launcher3/PagedView.java | 2 +- src/com/android/launcher3/Workspace.java | 6 +- .../WorkspaceStateTransitionAnimation.java | 8 +- .../allapps/AllAppsTransitionController.java | 10 +- .../allapps/SearchTransitionController.java | 8 +- .../anim/AnimatorPlaybackController.java | 6 +- .../android/launcher3/anim/Interpolators.java | 237 ------------------ .../anim/SpringAnimationBuilder.java | 2 +- .../launcher3/dragndrop/DragController.java | 2 +- .../launcher3/dragndrop/DragLayer.java | 10 +- .../android/launcher3/dragndrop/DragView.java | 4 +- .../android/launcher3/folder/FolderIcon.java | 4 +- .../graphics/PreloadIconDrawable.java | 4 +- .../notification/NotificationContainer.java | 2 +- .../notification/NotificationMainView.java | 2 +- .../android/launcher3/popup/ArrowPopup.java | 10 +- .../AbstractStateChangeTouchController.java | 2 +- .../touch/AllAppsSwipeController.java | 16 +- .../util/WallpaperOffsetInterpolator.java | 4 +- .../launcher3/views/AbstractSlideInView.java | 8 +- .../android/launcher3/views/ArrowTipView.java | 8 +- .../android/launcher3/views/ClipIconView.java | 2 +- .../launcher3/views/FloatingIconView.java | 2 +- src/com/android/launcher3/views/Snackbar.java | 6 +- .../launcher3/views/WidgetsEduView.java | 2 +- .../widget/AddItemWidgetsBottomSheet.java | 2 +- .../launcher3/widget/BaseWidgetSheet.java | 2 +- .../launcher3/widget/WidgetsBottomSheet.java | 2 +- .../uioverrides/states/AllAppsState.java | 4 +- 95 files changed, 278 insertions(+), 513 deletions(-) delete mode 100644 src/com/android/launcher3/anim/Interpolators.java diff --git a/Android.bp b/Android.bp index a7edf2a9b9..9b696a2640 100644 --- a/Android.bp +++ b/Android.bp @@ -172,6 +172,7 @@ android_library { static_libs: [ "Launcher3ResLib", "launcher-testing-shared", + "animationlib" ], sdk_version: "current", min_sdk_version: min_launcher3_sdk_version, diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 114965fcab..0592510338 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -30,6 +30,12 @@ import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_NONE; import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN; import static android.window.TransitionFilter.CONTAINER_ORDER_TOP; +import static com.android.app.animation.Interpolators.ACCELERATE_1_5; +import static com.android.app.animation.Interpolators.AGGRESSIVE_EASE; +import static com.android.app.animation.Interpolators.DECELERATE_1_5; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.EXAGGERATED_EASE; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.BaseActivity.INVISIBLE_ALL; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_APP_TRANSITIONS; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS; @@ -41,12 +47,6 @@ import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.Utilities.mapBoundToRange; -import static com.android.launcher3.anim.Interpolators.ACCEL_1_5; -import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.EXAGGERATED_EASE; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_BACK_SWIPE_HOME_ANIMATION; import static com.android.launcher3.config.FeatureFlags.ENABLE_SCRIM_FOR_APP_LAUNCH; import static com.android.launcher3.config.FeatureFlags.KEYGUARD_ANIMATION; @@ -553,7 +553,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener ObjectAnimator scaleAnim = ObjectAnimator.ofFloat(view, SCALE_PROPERTY, scales) .setDuration(CONTENT_SCALE_DURATION); - scaleAnim.setInterpolator(DEACCEL_1_5); + scaleAnim.setInterpolator(DECELERATE_1_5); launcherAnimator.play(scaleAnim); }); @@ -571,7 +571,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener ObjectAnimator scrim = ObjectAnimator.ofArgb(scrimView, VIEW_BACKGROUND_COLOR, colors); scrim.setDuration(CONTENT_SCRIM_DURATION); - scrim.setInterpolator(DEACCEL_1_5); + scrim.setInterpolator(DECELERATE_1_5); launcherAnimator.play(scrim); } @@ -1462,11 +1462,11 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener float startShadowRadius = areAllTargetsTranslucent(appTargets) ? 0 : mMaxShadowRadius; closingAnimator.setDuration(duration); closingAnimator.addUpdateListener(new MultiValueUpdateListener() { - FloatProp mDy = new FloatProp(0, mClosingWindowTransY, 0, duration, DEACCEL_1_7); - FloatProp mScale = new FloatProp(1f, 1f, 0, duration, DEACCEL_1_7); + FloatProp mDy = new FloatProp(0, mClosingWindowTransY, 0, duration, DECELERATE_1_7); + FloatProp mScale = new FloatProp(1f, 1f, 0, duration, DECELERATE_1_7); FloatProp mAlpha = new FloatProp(1f, 0f, 25, 125, LINEAR); FloatProp mShadowRadius = new FloatProp(startShadowRadius, 0, 0, duration, - DEACCEL_1_7); + DECELERATE_1_7); @Override public void onUpdate(float percent, boolean initOnly) { @@ -2032,7 +2032,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener if (progress >= end) { return 0f; } - return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5); + return Utilities.mapToRange(progress, start, end, 1, 0, ACCELERATE_1_5); } } diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java index 80bdb6f153..bd4792358a 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduDialog.java @@ -30,6 +30,7 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.CellLayout; import com.android.launcher3.DeviceProfile; @@ -37,7 +38,6 @@ import com.android.launcher3.Insettable; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.model.data.WorkspaceItemInfo; import com.android.launcher3.uioverrides.PredictedAppIcon; diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index 7c62763943..9afcd2ab81 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -16,7 +16,7 @@ package com.android.launcher3.statehandlers; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; diff --git a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java index 15f2914ae4..4e9e3019a9 100644 --- a/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java +++ b/quickstep/src/com/android/launcher3/taskbar/KeyboardQuickSwitchView.java @@ -42,10 +42,10 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.constraintlayout.widget.ConstraintLayout; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.util.GroupTask; import java.util.HashMap; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt index fe365f73b2..a9a2ccf025 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt @@ -22,12 +22,12 @@ import android.graphics.Color import android.graphics.Paint import android.graphics.Path import android.graphics.RectF +import com.android.app.animation.Interpolators import com.android.launcher3.DeviceProfile import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.Utilities.mapRange import com.android.launcher3.Utilities.mapToRange -import com.android.launcher3.anim.Interpolators import com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound import com.android.launcher3.util.DisplayController diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java index 040b8f7bfe..64ba5aa718 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java @@ -15,11 +15,11 @@ */ package com.android.launcher3.taskbar; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.AbstractFloatingView.TYPE_TASKBAR_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APPS; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PREDICTION; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -47,6 +47,7 @@ import android.window.SurfaceSyncGroup; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.internal.logging.InstanceId; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BubbleTextView; @@ -55,7 +56,6 @@ import com.android.launcher3.DropTarget; import com.android.launcher3.LauncherSettings; import com.android.launcher3.R; import com.android.launcher3.accessibility.DragViewStateAnnouncer; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragDriver; import com.android.launcher3.dragndrop.DragOptions; @@ -642,7 +642,7 @@ public class TaskbarDragController extends DragController im final FloatProp mScale = new FloatProp(1f, toScale, 0, ANIM_DURATION_RETURN_ICON_TO_TASKBAR, FAST_OUT_SLOW_IN); final FloatProp mAlpha = new FloatProp(1f, toAlpha, 0, - ANIM_DURATION_RETURN_ICON_TO_TASKBAR, Interpolators.ACCEL_2); + ANIM_DURATION_RETURN_ICON_TO_TASKBAR, Interpolators.ACCELERATE_2); @Override public void onUpdate(float percent, boolean initOnly) { animListener.updateDragShadow(mDx.value, mDy.value, mScale.value, mAlpha.value); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 00e14adf07..eb4c136ab2 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -18,11 +18,11 @@ package com.android.launcher3.taskbar; import static android.view.HapticFeedbackConstants.LONG_PRESS; import static android.view.accessibility.AccessibilityManager.FLAG_CONTENT_CONTROLS; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherPrefs.TASKBAR_PINNING_KEY; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_PINNING; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_HIDE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_LONGPRESS_SHOW; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt index 1cc667211c..ec93846198 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashViaTouchController.kt @@ -16,9 +16,9 @@ package com.android.launcher3.taskbar import android.view.MotionEvent +import com.android.app.animation.Interpolators.LINEAR import com.android.launcher3.R import com.android.launcher3.Utilities -import com.android.launcher3.anim.Interpolators.LINEAR import com.android.launcher3.testing.shared.ResourceUtils import com.android.launcher3.touch.SingleAxisSwipeDetector import com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_NEGATIVE diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java index 065d1117c8..2b4e67cb0b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java @@ -26,8 +26,8 @@ import android.animation.ValueAnimator; import androidx.annotation.Nullable; import androidx.dynamicanimation.animation.SpringForce; +import com.android.app.animation.Interpolators; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.SpringAnimationBuilder; import com.android.launcher3.util.DisplayController; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 4abd9957b2..528a32892a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -15,6 +15,8 @@ */ package com.android.launcher3.taskbar; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; @@ -22,8 +24,6 @@ import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.anim.AnimatedFloat.VALUE; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASKBAR_ALLAPPS_BUTTON_TAP; import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; @@ -45,6 +45,7 @@ import androidx.annotation.Nullable; import androidx.core.graphics.ColorUtils; import androidx.core.view.OneShotPreDrawListener; +import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherAppState; import com.android.launcher3.R; @@ -53,7 +54,6 @@ import com.android.launcher3.Utilities; import com.android.launcher3.anim.AlphaUpdateListener; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.RevealOutlineAnimation; import com.android.launcher3.anim.RoundedRectRevealOutlineProvider; diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index cfa1027dcc..84cc00278b 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.taskbar.allapps; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import android.animation.PropertyValuesHolder; import android.content.Context; diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt index 7397159f42..8a8e21f9fd 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarBackground.kt @@ -21,10 +21,10 @@ import android.graphics.ColorFilter import android.graphics.Paint import android.graphics.drawable.Drawable import android.graphics.drawable.ShapeDrawable +import com.android.app.animation.Interpolators import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.Utilities.mapToRange -import com.android.launcher3.anim.Interpolators import com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound import com.android.launcher3.taskbar.TaskbarActivityContext import com.android.wm.shell.common.TriangleShape diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index 955440b49a..8c8e267e34 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -16,11 +16,11 @@ package com.android.launcher3.uioverrides; +import static com.android.app.animation.Interpolators.AGGRESSIVE_EASE_IN_OUT; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME; -import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; diff --git a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java index b059cbdc6c..e61599f8e5 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java +++ b/quickstep/src/com/android/launcher3/uioverrides/PredictedAppIcon.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; import static com.android.launcher3.icons.BitmapInfo.FLAG_THEMED; import static com.android.launcher3.icons.FastBitmapDrawable.getDisabledColorFilter; @@ -260,8 +260,8 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView { Keyframe.ofFloat(0.82f, finalTrans - getOutlineOffsetY() / 2f), // Overshoot Keyframe.ofFloat(1f, finalTrans) // Ease back into the final position }; - keyframes[1].setInterpolator(ACCEL_DEACCEL); - keyframes[2].setInterpolator(ACCEL_DEACCEL); + keyframes[1].setInterpolator(ACCELERATE_DECELERATE); + keyframes[2].setInterpolator(ACCELERATE_DECELERATE); mSlotMachineAnim = ObjectAnimator.ofPropertyValuesHolder(this, PropertyValuesHolder.ofKeyframe(SLOT_MACHINE_TRANSLATION_Y, keyframes)); diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index d91e0488cd..d626608d45 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -20,6 +20,7 @@ import static android.os.Trace.TRACE_TAG_APP; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE; import static android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON; import static com.android.launcher3.LauncherSettings.Animation.VIEW_BACKGROUND; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT; @@ -31,7 +32,6 @@ import static com.android.launcher3.LauncherState.NO_OFFSET; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java index f16b43df5e..23e922c945 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java @@ -15,10 +15,10 @@ */ package com.android.launcher3.uioverrides; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON; import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA; diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java index 2a42175b5b..a4db375046 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides.states; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS; import android.content.Context; @@ -91,7 +91,7 @@ public class AllAppsState extends LauncherState { @Override public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { PageAlphaProvider superPageAlphaProvider = super.getWorkspacePageAlphaProvider(launcher); - return new PageAlphaProvider(DEACCEL_2) { + return new PageAlphaProvider(DECELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return launcher.getDeviceProfile().isTablet diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java index 214679acbe..3f0b54e618 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides.states; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; import android.content.Context; @@ -97,7 +97,7 @@ public class OverviewState extends LauncherState { @Override public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { - return new PageAlphaProvider(DEACCEL_2) { + return new PageAlphaProvider(DECELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return 0; diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index c7cd39c100..fc5f5671ee 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -17,6 +17,20 @@ package com.android.launcher3.uioverrides.states; import static android.view.View.VISIBLE; +import static com.android.app.animation.Interpolators.ACCELERATE; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.DECELERATE_3; +import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.OVERSHOOT_0_75; +import static com.android.app.animation.Interpolators.OVERSHOOT_1_2; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON; @@ -25,20 +39,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.QuickstepTransitionManager.TASKBAR_TO_HOME_DURATION; import static com.android.launcher3.WorkspaceStateTransitionAnimation.getWorkspaceSpringScaleAnimator; -import static com.android.launcher3.anim.Interpolators.ACCEL; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE; @@ -108,8 +108,8 @@ public class QuickstepAtomicAnimationFactory extends fromState == OVERVIEW_SPLIT_SELECT ? clampToProgress(LINEAR, 0.33f, 1) : LINEAR); - config.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL); - config.setInterpolator(ANIM_WORKSPACE_FADE, ACCEL); + config.setInterpolator(ANIM_WORKSPACE_SCALE, DECELERATE); + config.setInterpolator(ANIM_WORKSPACE_FADE, ACCELERATE); if (DisplayController.getNavigationMode(mActivity).hasGestures && overview.getTaskViewCount() > 0) { @@ -135,9 +135,9 @@ public class QuickstepAtomicAnimationFactory extends } overview.snapToPage(DEFAULT_PAGE, Math.toIntExact(config.duration)); } else { - config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCEL_DEACCEL); - config.setInterpolator(ANIM_OVERVIEW_SCALE, clampToProgress(ACCEL, 0, 0.9f)); - config.setInterpolator(ANIM_OVERVIEW_FADE, DEACCEL_1_7); + config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, ACCELERATE_DECELERATE); + config.setInterpolator(ANIM_OVERVIEW_SCALE, clampToProgress(ACCELERATE, 0, 0.9f)); + config.setInterpolator(ANIM_OVERVIEW_FADE, DECELERATE_1_7); } Workspace workspace = mActivity.getWorkspace(); @@ -163,8 +163,8 @@ public class QuickstepAtomicAnimationFactory extends || fromState == HINT_STATE_TWO_BUTTON) && toState == OVERVIEW) { if (DisplayController.getNavigationMode(mActivity).hasGestures) { config.setInterpolator(ANIM_WORKSPACE_SCALE, - fromState == NORMAL ? ACCEL : OVERSHOOT_1_2); - config.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL); + fromState == NORMAL ? ACCELERATE : OVERSHOOT_1_2); + config.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCELERATE); // Scrolling in tasks, so show straight away if (overview.getTaskViewCount() > 0) { @@ -192,7 +192,7 @@ public class QuickstepAtomicAnimationFactory extends config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_2); config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, OVERSHOOT_1_2); } else if (fromState == HINT_STATE && toState == NORMAL) { - config.setInterpolator(ANIM_DEPTH, DEACCEL_3); + config.setInterpolator(ANIM_DEPTH, DECELERATE_3); if (mHintToNormalDuration == -1) { ValueAnimator va = getWorkspaceSpringScaleAnimator(mActivity, mActivity.getWorkspace(), diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java index f967e18422..be532206e9 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NavBarToHomeTouchController.java @@ -15,6 +15,7 @@ */ package com.android.launcher3.uioverrides.touchcontrollers; +import static com.android.app.animation.Interpolators.DECELERATE_3; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL_APPS_EDU; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; @@ -25,7 +26,6 @@ import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_ALPHA; import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PULL_BACK_TRANSLATION; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS; @@ -57,7 +57,7 @@ import com.android.quickstep.views.RecentsView; public class NavBarToHomeTouchController implements TouchController, SingleAxisSwipeDetector.Listener { - private static final Interpolator PULLBACK_INTERPOLATOR = DEACCEL_3; + private static final Interpolator PULLBACK_INTERPOLATOR = DECELERATE_3; // The min amount of overview scrim we keep during the transition. private static final float OVERVIEW_TO_HOME_SCRIM_MULTIPLIER = 0.5f; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java index e3b3a793e1..2f5467ea75 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonNavbarToOverviewTouchController.java @@ -16,6 +16,7 @@ package com.android.launcher3.uioverrides.touchcontrollers; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; import static com.android.launcher3.LauncherState.ALL_APPS; @@ -25,7 +26,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS; import static com.android.launcher3.util.VibratorWrapper.OVERVIEW_HAPTIC; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ONE_HANDED_ACTIVE; @@ -280,7 +280,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch mRecentsView.animate() .translationX(0) .translationY(0) - .setInterpolator(ACCEL_DEACCEL) + .setInterpolator(ACCELERATE_DECELERATE) .setDuration(duration) .withEndAction(goToHomeInsteadOfOverview ? null diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index b4224bebae..8bd956c098 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -18,6 +18,10 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static android.view.MotionEvent.ACTION_DOWN; import static android.view.MotionEvent.ACTION_MOVE; +import static com.android.app.animation.Interpolators.ACCELERATE_0_75; +import static com.android.app.animation.Interpolators.DECELERATE_3; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; @@ -28,10 +32,6 @@ import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent; import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe; import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; -import static com.android.launcher3.anim.Interpolators.DEACCEL_3; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_QUICKSWITCH_RIGHT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_UNKNOWN_SWIPEDOWN; @@ -96,8 +96,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController, BothAxesSwipeDetector.Listener { private static final float Y_ANIM_MIN_PROGRESS = 0.25f; - private static final Interpolator FADE_OUT_INTERPOLATOR = DEACCEL_3; - private static final Interpolator TRANSLATE_OUT_INTERPOLATOR = ACCEL_0_75; + private static final Interpolator FADE_OUT_INTERPOLATOR = DECELERATE_3; + private static final Interpolator TRANSLATE_OUT_INTERPOLATOR = ACCELERATE_0_75; private static final Interpolator SCALE_DOWN_INTERPOLATOR = LINEAR; private static final long ATOMIC_DURATION_FROM_PAUSED_TO_OVERVIEW = 300; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java index 8368f9ca03..bb74a3650a 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java @@ -24,11 +24,11 @@ import static com.android.launcher3.LauncherState.OVERVIEW; import android.view.MotionEvent; +import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.allapps.AllAppsTransitionController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.states.StateAnimationConfig; import com.android.launcher3.touch.AbstractStateChangeTouchController; import com.android.launcher3.touch.AllAppsSwipeController; diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java index f941b02065..9a35bb2ae7 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java @@ -15,12 +15,12 @@ */ package com.android.launcher3.uioverrides.touchcontrollers; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE; @@ -128,14 +128,14 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll } private void setupInterpolators(StateAnimationConfig stateAnimationConfig) { - stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_FADE, DEACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_ALL_APPS_FADE, DEACCEL_2); + stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_FADE, DECELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_ALL_APPS_FADE, DECELERATE_2); if (DisplayController.getNavigationMode(mLauncher) == NavigationMode.NO_BUTTON) { // Overview lives to the left of workspace, so translate down later than over - stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_VERTICAL_PROGRESS, ACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_SCALE, ACCEL_2); - stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, ACCEL_2); + stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_TRANSLATE, ACCELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_VERTICAL_PROGRESS, ACCELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_SCALE, ACCELERATE_2); + stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, ACCELERATE_2); stateAnimationConfig.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT); } else { stateAnimationConfig.setInterpolator(ANIM_WORKSPACE_TRANSLATE, LINEAR); diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java index eddc50c64f..3d94857848 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java @@ -27,13 +27,13 @@ import android.view.MotionEvent; import android.view.View; import android.view.animation.Interpolator; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.LauncherAnimUtils; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.touch.BaseSwipeDetector; import com.android.launcher3.touch.PagedOrientationHandler; diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 4a4c127231..a546fdf71d 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -21,13 +21,13 @@ import static android.view.Surface.ROTATION_270; import static android.view.Surface.ROTATION_90; import static android.widget.Toast.LENGTH_SHORT; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE; +import static com.android.app.animation.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.BaseActivity.INVISIBLE_BY_STATE_HANDLER; import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS; import static com.android.launcher3.LauncherPrefs.ALL_APPS_OVERVIEW_THRESHOLD; import static com.android.launcher3.PagedView.INVALID_PAGE; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE; @@ -1319,11 +1319,11 @@ public abstract class AbsSwipeUpHandler, Interpolator interpolator; S state = mActivityInterface.stateFromGestureEndTarget(endTarget); if (state.displayOverviewTasksAsGrid(mDp)) { - interpolator = ACCEL_DEACCEL; + interpolator = ACCELERATE_DECELERATE; } else if (endTarget == RECENTS) { interpolator = OVERSHOOT_1_2; } else { - interpolator = DEACCEL; + interpolator = DECELERATE; } if (endTarget.isLauncher) { @@ -2414,11 +2414,11 @@ public abstract class AbsSwipeUpHandler, if (scrollOffset < mQuickSwitchScaleScrollThreshold) { scaleProgress = Utilities.mapToRange(scrollOffset, 0, mQuickSwitchScaleScrollThreshold, - 0, maxScaleProgress, ACCEL_DEACCEL); + 0, maxScaleProgress, ACCELERATE_DECELERATE); } else if (scrollOffset > (maxScrollOffset - mQuickSwitchScaleScrollThreshold)) { scaleProgress = Utilities.mapToRange(scrollOffset, (maxScrollOffset - mQuickSwitchScaleScrollThreshold), maxScrollOffset, - maxScaleProgress, 0, ACCEL_DEACCEL); + maxScaleProgress, 0, ACCELERATE_DECELERATE); } return scaleProgress; @@ -2447,7 +2447,7 @@ public abstract class AbsSwipeUpHandler, // "Catch up" with the displacement at mTaskbarCatchUpThreshold. if (displacement < mTaskbarCatchUpThreshold) { return Utilities.mapToRange(displacement, mTaskbarAppWindowThreshold, - mTaskbarCatchUpThreshold, 0, mTaskbarCatchUpThreshold, ACCEL_DEACCEL); + mTaskbarCatchUpThreshold, 0, mTaskbarCatchUpThreshold, ACCELERATE_DECELERATE); } return displacement; diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 60083c67e7..5a9d80d630 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -15,11 +15,11 @@ */ package com.android.quickstep; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR; import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.AbsSwipeUpHandler.RECENTS_ATTACH_DURATION; import static com.android.quickstep.GestureState.GestureEndTarget.LAST_TASK; import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS; @@ -553,7 +553,7 @@ public abstract class BaseActivityInterface { if (activityClosing) { Animator adjacentAnimation = mFallbackRecentsView .createAdjacentPageAnimForTaskLaunch(taskView); - adjacentAnimation.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); + adjacentAnimation.setInterpolator(Interpolators.TOUCH_RESPONSE); adjacentAnimation.setDuration(RECENTS_LAUNCH_DURATION); adjacentAnimation.addListener(resetStateListener()); target.play(adjacentAnimation); diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 1b4fdc4a8f..2e93c00962 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -15,8 +15,8 @@ */ package com.android.quickstep; -import static com.android.launcher3.anim.Interpolators.ACCEL_1_5; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.ACCELERATE_1_5; +import static com.android.app.animation.Interpolators.LINEAR; import android.animation.Animator; import android.content.Context; @@ -217,7 +217,7 @@ public abstract class SwipeUpAnimationLogic implements if (progress >= end) { return 0f; } - return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5); + return Utilities.mapToRange(progress, start, end, 1, 0, ACCELERATE_1_5); } } diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 499a2601a9..bfe52ddafc 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -21,6 +21,9 @@ import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.TRANSIT_OPEN; import static android.view.WindowManager.TRANSIT_TO_FRONT; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.TOUCH_RESPONSE; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; @@ -35,9 +38,6 @@ import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DU import static com.android.launcher3.QuickstepTransitionManager.SPLIT_DIVIDER_ANIM_DURATION; import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURATION; import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.util.MultiPropertyFactory.MULTI_PROPERTY_VALUE; import static com.android.quickstep.views.DesktopTaskView.DESKTOP_MODE_SUPPORTED; @@ -61,12 +61,12 @@ import android.window.TransitionInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.BaseActivity; import com.android.launcher3.DeviceProfile; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.statehandlers.DepthController; @@ -237,12 +237,12 @@ public final class TaskViewUtils { for (RemoteTargetHandle targetHandle : remoteTargetHandles) { TaskViewSimulator tvsLocal = targetHandle.getTaskViewSimulator(); out.setFloat(tvsLocal.fullScreenProgress, - AnimatedFloat.VALUE, 1, TOUCH_RESPONSE_INTERPOLATOR); + AnimatedFloat.VALUE, 1, TOUCH_RESPONSE); out.setFloat(tvsLocal.recentsViewScale, AnimatedFloat.VALUE, tvsLocal.getFullScreenScale(), - TOUCH_RESPONSE_INTERPOLATOR); + TOUCH_RESPONSE); out.setFloat(tvsLocal.recentsViewScroll, AnimatedFloat.VALUE, 0, - TOUCH_RESPONSE_INTERPOLATOR); + TOUCH_RESPONSE); out.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { @@ -355,9 +355,9 @@ public final class TaskViewUtils { float fullScreenScale = topMostSimulators[i].getTaskViewSimulator().getFullScreenScale(); out.addFloat(ttv, VIEW_TRANSLATE_Y, translationY, - translationY / fullScreenScale, TOUCH_RESPONSE_INTERPOLATOR); + translationY / fullScreenScale, TOUCH_RESPONSE); out.addFloat(ttv, VIEW_TRANSLATE_X, translationX, - translationX / fullScreenScale, TOUCH_RESPONSE_INTERPOLATOR); + translationX / fullScreenScale, TOUCH_RESPONSE); } Matrix[] k0i = new Matrix[matrixSize]; @@ -405,7 +405,7 @@ public final class TaskViewUtils { if (depthController != null) { out.setFloat(depthController.stateDepth, MULTI_PROPERTY_VALUE, - BACKGROUND_APP.getDepth(baseActivity), TOUCH_RESPONSE_INTERPOLATOR); + BACKGROUND_APP.getDepth(baseActivity), TOUCH_RESPONSE); } } @@ -639,7 +639,7 @@ public final class TaskViewUtils { raController.setWillFinishToHome(false); } launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView); - launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR); + launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE); launcherAnim.setDuration(RECENTS_LAUNCH_DURATION); windowAnimEndListener = new AnimatorListenerAdapter() { diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index 11b1ab8ec9..8a9e04e488 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -15,9 +15,9 @@ */ package com.android.quickstep.fallback; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MODAL; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X; diff --git a/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java index 162ace4965..a209b3b435 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/AssistantInputConsumer.java @@ -42,9 +42,9 @@ import android.view.HapticFeedbackConstants; import android.view.MotionEvent; import android.view.ViewConfiguration; +import com.android.app.animation.Interpolators; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.BaseActivityInterface; import com.android.quickstep.GestureState; import com.android.quickstep.InputConsumer; @@ -209,7 +209,7 @@ public class AssistantInputConsumer extends DelegateInputConsumer { SystemUiProxy.INSTANCE.get(mContext).onAssistantProgress(0f); } }); - animator.setInterpolator(Interpolators.DEACCEL_2); + animator.setInterpolator(Interpolators.DECELERATE_2); animator.start(); } mPassedSlop = false; diff --git a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java index a5536483df..2a355848b5 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/DeviceLockedInputConsumer.java @@ -39,9 +39,9 @@ import android.view.MotionEvent; import android.view.RemoteAnimationTarget; import android.view.VelocityTracker; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.DisplayController; @@ -203,7 +203,7 @@ public class DeviceLockedInputConsumer implements InputConsumer, // Animate back to fullscreen before finishing ObjectAnimator animator = mProgress.animateToValue(mProgress.value, 0); animator.setDuration(100); - animator.setInterpolator(Interpolators.ACCEL); + animator.setInterpolator(Interpolators.ACCELERATE); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { diff --git a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java index ab70272852..5202529942 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.inputconsumers; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.touch.BaseSwipeDetector.calculateDuration; import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_POSITIVE; import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL; diff --git a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java index 8274a51ff7..5e1a46e0b9 100644 --- a/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java +++ b/quickstep/src/com/android/quickstep/interaction/AllSetActivity.java @@ -15,10 +15,10 @@ */ package com.android.quickstep.interaction; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.mapBoundToRange; import static com.android.launcher3.Utilities.mapRange; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.OverviewComponentObserver.startHomeIntentSafely; import android.animation.Animator; diff --git a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java index 54c441b59e..f1091f26c6 100644 --- a/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/BackGestureTutorialController.java @@ -23,9 +23,9 @@ import android.annotation.LayoutRes; import android.graphics.PointF; import android.view.View; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.interaction.EdgeBackGestureHandler.BackGestureResult; import com.android.quickstep.interaction.NavBarGestureHandler.NavBarGestureResult; import com.android.quickstep.util.LottieAnimationColorUtils; @@ -176,7 +176,7 @@ final class BackGestureTutorialController extends TutorialController { /* upperBound = */ 1f, /* toMin = */ 1f, /* toMax = */ EXITING_APP_MIN_SIZE_PERCENTAGE, - Interpolators.DEACCEL); + Interpolators.DECELERATE); // shrink the exiting app as we progress through the back gesture mExitingAppView.setPivotX(isLeftGesture ? mScreenWidth : 0); @@ -190,7 +190,7 @@ final class BackGestureTutorialController extends TutorialController { /* upperBound = */ 1f, /* toMin = */ 0, /* toMax = */ mExitingAppMargin, - Interpolators.DEACCEL) + Interpolators.DECELERATE) * (isLeftGesture ? -1 : 1)); // round the corners of the exiting app as we progress through the back gesture diff --git a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java index 8eb40593c9..a9dcad8db1 100644 --- a/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java +++ b/quickstep/src/com/android/quickstep/interaction/EdgeBackGesturePanel.java @@ -40,8 +40,8 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat; import androidx.dynamicanimation.animation.SpringAnimation; import androidx.dynamicanimation.animation.SpringForce; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.testing.shared.ResourceUtils; import com.android.launcher3.util.VibratorWrapper; diff --git a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java index 667fe4dfad..1c5ad3fe5c 100644 --- a/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/OverviewGestureTutorialController.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.interaction; -import static com.android.launcher3.anim.Interpolators.ACCEL; +import static com.android.app.animation.Interpolators.ACCELERATE; import static com.android.launcher3.config.FeatureFlags.ENABLE_NEW_GESTURE_NAV_TUTORIAL; import android.animation.Animator; @@ -245,7 +245,7 @@ final class OverviewGestureTutorialController extends SwipeUpGestureTutorialCont public void animateTaskViewToOverview(boolean animateDelayedSuccessFeedback) { PendingAnimation anim = new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS); anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCELERATE); if (animateDelayedSuccessFeedback) { anim.addListener(new AnimatorListenerAdapter() { diff --git a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java index 0bbf373023..0c14819ec8 100644 --- a/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java +++ b/quickstep/src/com/android/quickstep/interaction/SwipeUpGestureTutorialController.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.interaction; -import static com.android.launcher3.anim.Interpolators.ACCEL; +import static com.android.app.animation.Interpolators.ACCELERATE; import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; import static com.android.quickstep.AbsSwipeUpHandler.MAX_SWIPE_DURATION; @@ -160,14 +160,14 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { PendingAnimation anim = new PendingAnimation(300); if (toOverviewFirst) { anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 1, ACCELERATE); anim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation, boolean isReverse) { PendingAnimation fadeAnim = new PendingAnimation(TASK_VIEW_END_ANIMATION_DURATION_MILLIS); fadeAnim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCELERATE); if (resetViews) { fadeAnim.addListener(mResetTaskView); } @@ -202,7 +202,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { }); } else { anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCELERATE); if (resetViews) { anim.addListener(mResetTaskView); } @@ -228,8 +228,8 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { mFakeTaskView.setVisibility(View.VISIBLE); PendingAnimation anim = new PendingAnimation(300); anim.setFloat(mTaskViewSwipeUpAnimation - .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCEL); - anim.setViewAlpha(mFakeTaskView, 1, ACCEL); + .getCurrentShift(), AnimatedFloat.VALUE, 0, ACCELERATE); + anim.setViewAlpha(mFakeTaskView, 1, ACCELERATE); anim.addListener(mResetTaskView); AnimatorSet animset = anim.buildAnim(); if (animateTaskbar) { @@ -249,7 +249,7 @@ abstract class SwipeUpGestureTutorialController extends TutorialController { mTaskViewSwipeUpAnimation.handleSwipeUpToHome(finalVelocity); // After home animation finishes, fade out and run onEndRunnable. PendingAnimation fadeAnim = new PendingAnimation(300); - fadeAnim.setViewAlpha(mFakeIconView, 0, ACCEL); + fadeAnim.setViewAlpha(mFakeIconView, 0, ACCELERATE); if (onEndRunnable != null) { fadeAnim.addListener(AnimatorListeners.forSuccessCallback(onEndRunnable)); } diff --git a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java index 6f927d3faf..df9830a93f 100644 --- a/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java +++ b/quickstep/src/com/android/quickstep/util/AnimatorControllerWithResistance.java @@ -15,9 +15,9 @@ */ package com.android.quickstep.util; +import static com.android.app.animation.Interpolators.DECELERATE; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherPrefs.ALL_APPS_OVERVIEW_THRESHOLD; -import static com.android.launcher3.anim.Interpolators.DEACCEL; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY; import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION; @@ -92,7 +92,7 @@ public class AnimatorControllerWithResistance { public final boolean stopScalingAtTop; } - private static final TimeInterpolator RECENTS_SCALE_RESIST_INTERPOLATOR = DEACCEL; + private static final TimeInterpolator RECENTS_SCALE_RESIST_INTERPOLATOR = DECELERATE; private static final TimeInterpolator RECENTS_TRANSLATE_RESIST_INTERPOLATOR = LINEAR; private static final Rect TEMP_RECT = new Rect(); diff --git a/quickstep/src/com/android/quickstep/util/BorderAnimator.java b/quickstep/src/com/android/quickstep/util/BorderAnimator.java index 011d45c8e7..7563187b93 100644 --- a/quickstep/src/com/android/quickstep/util/BorderAnimator.java +++ b/quickstep/src/com/android/quickstep/util/BorderAnimator.java @@ -29,9 +29,9 @@ import android.view.animation.Interpolator; import androidx.annotation.NonNull; import androidx.annotation.Px; +import com.android.app.animation.Interpolators; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorListeners; -import com.android.launcher3.anim.Interpolators; /** * Utility class for drawing a rounded-rect border around a view. diff --git a/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java b/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java index e189a66ee4..3027f79f03 100644 --- a/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/OverviewToSplitTimings.java @@ -16,8 +16,8 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.INSTANT; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java b/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java index f1dde53d12..a38f437664 100644 --- a/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/PhoneOverviewToSplitTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java b/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java index 7dc1b32858..93f2255a4d 100644 --- a/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java +++ b/quickstep/src/com/android/quickstep/util/SplitAnimationTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java index f5b00cf42b..d1ec2b6f23 100644 --- a/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java +++ b/quickstep/src/com/android/quickstep/util/SplitToConfirmTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java index cd5edab9d6..9099012214 100644 --- a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +++ b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java @@ -15,11 +15,11 @@ */ package com.android.quickstep.util; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER; import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW; diff --git a/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java b/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java index bf8612a797..8804049550 100644 --- a/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/TabletHomeToSplitTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.view.animation.Interpolator; diff --git a/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java b/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java index cbf46bfcb8..5463d84b65 100644 --- a/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java +++ b/quickstep/src/com/android/quickstep/util/TabletOverviewToSplitTimings.java @@ -16,7 +16,7 @@ package com.android.quickstep.util; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import android.view.animation.Interpolator; @@ -36,8 +36,8 @@ public class TabletOverviewToSplitTimings public int getGridSlideDuration() { return 500; } public int getDuration() { return TABLET_ENTER_DURATION; } - public Interpolator getStagedRectXInterpolator() { return DEACCEL_2; } - public Interpolator getStagedRectYInterpolator() { return DEACCEL_2; } - public Interpolator getStagedRectScaleXInterpolator() { return DEACCEL_2; } - public Interpolator getStagedRectScaleYInterpolator() { return DEACCEL_2; } + public Interpolator getStagedRectXInterpolator() { return DECELERATE_2; } + public Interpolator getStagedRectYInterpolator() { return DECELERATE_2; } + public Interpolator getStagedRectScaleXInterpolator() { return DECELERATE_2; } + public Interpolator getStagedRectScaleYInterpolator() { return DECELERATE_2; } } diff --git a/quickstep/src/com/android/quickstep/util/TransformParams.java b/quickstep/src/com/android/quickstep/util/TransformParams.java index 0f20e430fc..1cbded63b2 100644 --- a/quickstep/src/com/android/quickstep/util/TransformParams.java +++ b/quickstep/src/com/android/quickstep/util/TransformParams.java @@ -21,8 +21,8 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import android.util.FloatProperty; import android.view.RemoteAnimationTarget; +import com.android.app.animation.Interpolators; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.Interpolators; import com.android.quickstep.RemoteAnimationTargets; import com.android.quickstep.util.SurfaceTransaction.SurfaceProperties; @@ -153,7 +153,8 @@ public class TransformParams { // Fade out Assistant overlay. if (activityType == ACTIVITY_TYPE_ASSISTANT && app.isNotInRecents) { float progress = Utilities.boundToRange(getProgress(), 0, 1); - builder.setAlpha(1 - Interpolators.DEACCEL_2_5.getInterpolation(progress)); + builder.setAlpha(1 - Interpolators.DECELERATE_QUINT + .getInterpolation(progress)); } else { builder.setAlpha(getTargetAlpha()); } diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java index 34fa7f1764..ac8862f27d 100644 --- a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java +++ b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java @@ -32,11 +32,11 @@ import android.animation.ObjectAnimator; import android.util.FloatProperty; import android.view.View; +import com.android.app.animation.Interpolators; import com.android.launcher3.Hotseat; import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.Workspace; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.statehandlers.DepthController; import com.android.launcher3.states.StateAnimationConfig; diff --git a/quickstep/src/com/android/quickstep/views/AllAppsEduView.java b/quickstep/src/com/android/quickstep/views/AllAppsEduView.java index 716d389a2c..fdc8f1ff14 100644 --- a/quickstep/src/com/android/quickstep/views/AllAppsEduView.java +++ b/quickstep/src/com/android/quickstep/views/AllAppsEduView.java @@ -15,12 +15,12 @@ */ package com.android.quickstep.views; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.Utilities.EDGE_NAV_BAR; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALL_APPS_EDU_SHOWN; import android.animation.Animator; diff --git a/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java b/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java index 53101fbc49..45a26a5f8f 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java +++ b/quickstep/src/com/android/quickstep/views/DesktopAppSelectView.java @@ -15,7 +15,7 @@ */ package com.android.quickstep.views; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.content.Context; import android.util.AttributeSet; diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index 75a8ea2b3b..a5652dc78c 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -1,8 +1,8 @@ package com.android.quickstep.views; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import android.animation.ValueAnimator; import android.content.Context; diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index edd3562c61..3142c9e492 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -21,6 +21,16 @@ import static android.view.Surface.ROTATION_0; import static android.view.View.MeasureSpec.EXACTLY; import static android.view.View.MeasureSpec.makeMeasureSpec; +import static com.android.app.animation.Interpolators.ACCELERATE; +import static com.android.app.animation.Interpolators.ACCELERATE_0_75; +import static com.android.app.animation.Interpolators.ACCELERATE_DECELERATE; +import static com.android.app.animation.Interpolators.DECELERATE_2; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.OVERSHOOT_0_75; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU; import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType; import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS; @@ -32,16 +42,6 @@ import static com.android.launcher3.Utilities.EDGE_NAV_BAR; import static com.android.launcher3.Utilities.mapToRange; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredTouchSlop; -import static com.android.launcher3.anim.Interpolators.ACCEL; -import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; -import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.config.FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW; import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCH_FROM_STAGED_APP; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT; @@ -1180,7 +1180,7 @@ public abstract class RecentsView { float percent = valueAnimator.getAnimatedFraction(); SurfaceTransaction transaction = new SurfaceTransaction(); @@ -3132,7 +3132,7 @@ public abstract class RecentsView secondaryViewTranslate = taskView.getSecondaryDismissTranslationProperty(); int secondaryTaskDimension = mOrientationHandler.getSecondaryDimension(taskView); @@ -4285,7 +4285,7 @@ public abstract class RecentsView updateVisibility(DropTargetBar.this); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5af8e1e2e7..db5a27ac38 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -21,6 +21,7 @@ import static android.app.PendingIntent.FLAG_UPDATE_CURRENT; import static android.content.pm.ActivityInfo.CONFIG_UI_MODE; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER; import static com.android.launcher3.AbstractFloatingView.TYPE_ICON_SURFACE; @@ -43,7 +44,6 @@ import static com.android.launcher3.LauncherState.NO_SCALE; import static com.android.launcher3.LauncherState.SPRING_LOADED; import static com.android.launcher3.Utilities.postAsyncCallback; import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.getSupportedActions; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE; import static com.android.launcher3.config.FeatureFlags.MULTI_SELECT_EDIT_MODE; import static com.android.launcher3.config.FeatureFlags.SHOW_DOT_PAGINATION; diff --git a/src/com/android/launcher3/LauncherState.java b/src/com/android/launcher3/LauncherState.java index 8b124dc847..05471ada48 100644 --- a/src/com/android/launcher3/LauncherState.java +++ b/src/com/android/launcher3/LauncherState.java @@ -15,8 +15,8 @@ */ package com.android.launcher3; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.DECELERATE_2; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; import static com.android.launcher3.testing.shared.TestProtocol.ALL_APPS_STATE_ORDINAL; @@ -90,7 +90,7 @@ public abstract class LauncherState implements BaseState { public static final float NO_SCALE = 1; protected static final PageAlphaProvider DEFAULT_ALPHA_PROVIDER = - new PageAlphaProvider(ACCEL_2) { + new PageAlphaProvider(ACCELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return 1; @@ -98,7 +98,7 @@ public abstract class LauncherState implements BaseState { }; protected static final PageTranslationProvider DEFAULT_PAGE_TRANSLATION_PROVIDER = - new PageTranslationProvider(DEACCEL_2) { + new PageTranslationProvider(DECELERATE_2) { @Override public float getPageTranslation(int pageIndex) { return 0; @@ -319,7 +319,7 @@ public abstract class LauncherState implements BaseState { return DEFAULT_ALPHA_PROVIDER; } final int centerPage = launcher.getWorkspace().getNextPage(); - return new PageAlphaProvider(ACCEL_2) { + return new PageAlphaProvider(ACCELERATE_2) { @Override public float getPageAlpha(int pageIndex) { return pageIndex != centerPage ? 0 : 1f; @@ -337,7 +337,7 @@ public abstract class LauncherState implements BaseState { return DEFAULT_PAGE_TRANSLATION_PROVIDER; } final float quarterPageSpacing = launcher.getWorkspace().getPageSpacing() / 4f; - return new PageTranslationProvider(DEACCEL_2) { + return new PageTranslationProvider(DECELERATE_2) { @Override public float getPageTranslation(int pageIndex) { boolean isRtl = launcher.getWorkspace().mIsRtl; diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index af64b3b0ee..4b4a4a5204 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -16,7 +16,7 @@ package com.android.launcher3; -import static com.android.launcher3.anim.Interpolators.SCROLL; +import static com.android.app.animation.Interpolators.SCROLL; import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; import static com.android.launcher3.touch.OverScroll.OVERSCROLL_DAMP_FACTOR; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index dbf08944e0..52755d4e2c 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -67,9 +67,9 @@ import android.widget.Toast; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import com.android.app.animation.Interpolators; import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.celllayout.CellPosMapper; @@ -562,9 +562,9 @@ public class Workspace extends PagedView // Change the interpolators such that the fade animation plays before the move animation. // This prevents empty adjacent pages to overlay during animation mLayoutTransition.setInterpolator(LayoutTransition.DISAPPEARING, - Interpolators.clampToProgress(Interpolators.ACCEL_DEACCEL, 0, 0.5f)); + Interpolators.clampToProgress(Interpolators.ACCELERATE_DECELERATE, 0, 0.5f)); mLayoutTransition.setInterpolator(LayoutTransition.CHANGE_DISAPPEARING, - Interpolators.clampToProgress(Interpolators.ACCEL_DEACCEL, 0.5f, 1)); + Interpolators.clampToProgress(Interpolators.ACCELERATE_DECELERATE, 0.5f, 1)); mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING); mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING); diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 565d7da9e5..c04cdfdb0f 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -18,6 +18,9 @@ package com.android.launcher3; import static androidx.dynamicanimation.animation.DynamicAnimation.MIN_VISIBLE_CHANGE_SCALE; +import static com.android.app.animation.Interpolators.ACCELERATE_2; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.ZOOM_OUT; import static com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY; import static com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_WORKSPACE_STATE; import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA; @@ -30,9 +33,6 @@ import static com.android.launcher3.LauncherState.HINT_STATE; import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.WORKSPACE_PAGE_INDICATOR; -import static com.android.launcher3.anim.Interpolators.ACCEL_2; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.ZOOM_OUT; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS; import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS; @@ -201,7 +201,7 @@ public class WorkspaceStateTransitionAnimation { propertySetter.setViewBackgroundColor(mLauncher.getScrimView(), state.getWorkspaceScrimColor(mLauncher), - config.getInterpolator(ANIM_SCRIM_FADE, ACCEL_2)); + config.getInterpolator(ANIM_SCRIM_FADE, ACCELERATE_2)); } public void applyChildState(LauncherState state, CellLayout cl, int childIndex) { diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index d4f152aa0a..6ca084a3b7 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -15,14 +15,14 @@ */ package com.android.launcher3.allapps; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.ALL_APPS_CONTENT; import static com.android.launcher3.LauncherState.NORMAL; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_BOTTOM_SHEET_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; @@ -45,6 +45,7 @@ import android.view.animation.Interpolator; import androidx.annotation.FloatRange; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.Launcher; @@ -53,7 +54,6 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; import com.android.launcher3.anim.AnimatorListeners; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.PropertySetter; import com.android.launcher3.config.FeatureFlags; @@ -380,7 +380,7 @@ public class AllAppsTransitionController // need to decide depending on the release velocity Interpolator verticalProgressInterpolator = config.getInterpolator(ANIM_VERTICAL_PROGRESS, - config.userControlled ? LINEAR : DEACCEL_1_7); + config.userControlled ? LINEAR : DECELERATE_1_7); Animator anim = createSpringAnimation(mProgress, targetProgress); anim.setInterpolator(verticalProgressInterpolator); anim.addListener(getProgressAnimatorListener()); diff --git a/src/com/android/launcher3/allapps/SearchTransitionController.java b/src/com/android/launcher3/allapps/SearchTransitionController.java index b01ea53621..eb1bc0a4be 100644 --- a/src/com/android/launcher3/allapps/SearchTransitionController.java +++ b/src/com/android/launcher3/allapps/SearchTransitionController.java @@ -20,12 +20,12 @@ import static android.view.View.VISIBLE; import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; +import static com.android.app.animation.Interpolators.DECELERATE_1_7; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APPLICATION; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_7; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import android.animation.ObjectAnimator; import android.animation.TimeInterpolator; @@ -48,7 +48,7 @@ public class SearchTransitionController { private static final String LOG_TAG = "SearchTransitionCtrl"; // Interpolator when the user taps the QSB while already in All Apps. - private static final Interpolator INTERPOLATOR_WITHIN_ALL_APPS = DEACCEL_1_7; + private static final Interpolator INTERPOLATOR_WITHIN_ALL_APPS = DECELERATE_1_7; // Interpolator when the user taps the QSB from home screen, so transition to all apps is // happening simultaneously. private static final Interpolator INTERPOLATOR_TRANSITIONING_TO_ALL_APPS = INSTANT; diff --git a/src/com/android/launcher3/anim/AnimatorPlaybackController.java b/src/com/android/launcher3/anim/AnimatorPlaybackController.java index 1cc0c21745..d11a51f585 100644 --- a/src/com/android/launcher3/anim/AnimatorPlaybackController.java +++ b/src/com/android/launcher3/anim/AnimatorPlaybackController.java @@ -15,10 +15,10 @@ */ package com.android.launcher3.anim; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.clampToProgress; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.Utilities.boundToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFrameMs; import android.animation.Animator; diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java deleted file mode 100644 index e88654379a..0000000000 --- a/src/com/android/launcher3/anim/Interpolators.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.launcher3.anim; - -import android.graphics.Path; -import android.view.animation.AccelerateDecelerateInterpolator; -import android.view.animation.AccelerateInterpolator; -import android.view.animation.DecelerateInterpolator; -import android.view.animation.Interpolator; -import android.view.animation.LinearInterpolator; -import android.view.animation.OvershootInterpolator; -import android.view.animation.PathInterpolator; - -import com.android.launcher3.Utilities; - -/** - * Common interpolators used in Launcher - */ -public class Interpolators { - - public static final Interpolator LINEAR = new LinearInterpolator(); - - public static final Interpolator ACCEL = new AccelerateInterpolator(); - public static final Interpolator ACCEL_0_5 = new AccelerateInterpolator(0.5f); - public static final Interpolator ACCEL_0_75 = new AccelerateInterpolator(0.75f); - public static final Interpolator ACCEL_1_5 = new AccelerateInterpolator(1.5f); - public static final Interpolator ACCEL_2 = new AccelerateInterpolator(2); - - public static final Interpolator DEACCEL = new DecelerateInterpolator(); - public static final Interpolator DEACCEL_1_5 = new DecelerateInterpolator(1.5f); - public static final Interpolator DEACCEL_1_7 = new DecelerateInterpolator(1.7f); - public static final Interpolator DEACCEL_2 = new DecelerateInterpolator(2); - public static final Interpolator DEACCEL_2_5 = new DecelerateInterpolator(2.5f); - public static final Interpolator DEACCEL_3 = new DecelerateInterpolator(3f); - - public static final Interpolator ACCEL_DEACCEL = new AccelerateDecelerateInterpolator(); - - public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f); - - public static final Interpolator AGGRESSIVE_EASE = new PathInterpolator(0.2f, 0f, 0f, 1f); - public static final Interpolator AGGRESSIVE_EASE_IN_OUT = new PathInterpolator(0.6f,0, 0.4f, 1); - - public static final Interpolator DECELERATED_EASE = new PathInterpolator(0, 0, .2f, 1f); - public static final Interpolator ACCELERATED_EASE = new PathInterpolator(0.4f, 0, 1f, 1f); - public static final Interpolator PREDICTIVE_BACK_DECELERATED_EASE = - new PathInterpolator(0, 0, 0, 1f); - - /** - * The default emphasized interpolator. Used for hero / emphasized movement of content. - */ - public static final Interpolator EMPHASIZED = createEmphasizedInterpolator(); - public static final Interpolator EMPHASIZED_ACCELERATE = new PathInterpolator( - 0.3f, 0f, 0.8f, 0.15f); - public static final Interpolator EMPHASIZED_DECELERATE = new PathInterpolator( - 0.05f, 0.7f, 0.1f, 1f); - - public static final Interpolator EXAGGERATED_EASE; - - public static final Interpolator INSTANT = t -> 1; - /** - * All values of t map to 0 until t == 1. This is primarily useful for setting view visibility, - * which should only happen at the very end of the animation (when it's already hidden). - */ - public static final Interpolator FINAL_FRAME = t -> t < 1 ? 0 : 1; - - static { - Path exaggeratedEase = new Path(); - exaggeratedEase.moveTo(0, 0); - exaggeratedEase.cubicTo(0.05f, 0f, 0.133333f, 0.08f, 0.166666f, 0.4f); - exaggeratedEase.cubicTo(0.225f, 0.94f, 0.5f, 1f, 1f, 1f); - EXAGGERATED_EASE = new PathInterpolator(exaggeratedEase); - } - - public static final Interpolator OVERSHOOT_0_75 = new OvershootInterpolator(0.75f); - public static final Interpolator OVERSHOOT_1_2 = new OvershootInterpolator(1.2f); - public static final Interpolator OVERSHOOT_1_7 = new OvershootInterpolator(1.7f); - - public static final Interpolator TOUCH_RESPONSE_INTERPOLATOR = - new PathInterpolator(0.3f, 0f, 0.1f, 1f); - public static final Interpolator TOUCH_RESPONSE_INTERPOLATOR_ACCEL_DEACCEL = - v -> ACCEL_DEACCEL.getInterpolation(TOUCH_RESPONSE_INTERPOLATOR.getInterpolation(v)); - - /** - * Inversion of ZOOM_OUT, compounded with an ease-out. - */ - public static final Interpolator ZOOM_IN = new Interpolator() { - @Override - public float getInterpolation(float v) { - return DEACCEL_3.getInterpolation(1 - ZOOM_OUT.getInterpolation(1 - v)); - } - }; - - public static final Interpolator ZOOM_OUT = new Interpolator() { - - private static final float FOCAL_LENGTH = 0.35f; - - @Override - public float getInterpolation(float v) { - return zInterpolate(v); - } - - /** - * This interpolator emulates the rate at which the perceived scale of an object changes - * as its distance from a camera increases. When this interpolator is applied to a scale - * animation on a view, it evokes the sense that the object is shrinking due to moving away - * from the camera. - */ - private float zInterpolate(float input) { - return (1.0f - FOCAL_LENGTH / (FOCAL_LENGTH + input)) / - (1.0f - FOCAL_LENGTH / (FOCAL_LENGTH + 1.0f)); - } - }; - - public static final Interpolator SCROLL = new Interpolator() { - @Override - public float getInterpolation(float t) { - t -= 1.0f; - return t*t*t*t*t + 1; - } - }; - - public static final Interpolator SCROLL_CUBIC = new Interpolator() { - @Override - public float getInterpolation(float t) { - t -= 1.0f; - return t*t*t + 1; - } - }; - - private static final float FAST_FLING_PX_MS = 10; - - public static Interpolator scrollInterpolatorForVelocity(float velocity) { - return Math.abs(velocity) > FAST_FLING_PX_MS ? SCROLL : SCROLL_CUBIC; - } - - /** - * Create an OvershootInterpolator with tension directly related to the velocity (in px/ms). - * @param velocity The start velocity of the animation we want to overshoot. - */ - public static Interpolator overshootInterpolatorForVelocity(float velocity) { - return new OvershootInterpolator(Math.min(Math.abs(velocity), 3f)); - } - - /** - * Returns a function that runs the given interpolator such that the entire progress is set - * between the given bounds. That is, we set the interpolation to 0 until lowerBound and reach - * 1 by upperBound. - */ - public static Interpolator clampToProgress(Interpolator interpolator, float lowerBound, - float upperBound) { - if (upperBound < lowerBound) { - throw new IllegalArgumentException( - String.format("upperBound (%f) must be greater than lowerBound (%f)", - upperBound, lowerBound)); - } - return t -> clampToProgress(interpolator, t, lowerBound, upperBound); - } - - /** - * Returns the progress value's progress between the lower and upper bounds. That is, the - * progress will be 0f from 0f to lowerBound, and reach 1f by upperBound. - * - * Between lowerBound and upperBound, the progress value will be interpolated using the provided - * interpolator. - */ - public static float clampToProgress( - Interpolator interpolator, float progress, float lowerBound, float upperBound) { - if (upperBound < lowerBound) { - throw new IllegalArgumentException( - String.format("upperBound (%f) must be greater than lowerBound (%f)", - upperBound, lowerBound)); - } - - if (progress == lowerBound && progress == upperBound) { - return progress == 0f ? 0 : 1; - } - if (progress < lowerBound) { - return 0; - } - if (progress > upperBound) { - return 1; - } - return interpolator.getInterpolation((progress - lowerBound) / (upperBound - lowerBound)); - } - - /** - * Returns the progress value's progress between the lower and upper bounds. That is, the - * progress will be 0f from 0f to lowerBound, and reach 1f by upperBound. - */ - public static float clampToProgress(float progress, float lowerBound, float upperBound) { - return clampToProgress(Interpolators.LINEAR, progress, lowerBound, upperBound); - } - - /** - * Runs the given interpolator such that the interpolated value is mapped to the given range. - * This is useful, for example, if we only use this interpolator for part of the animation, - * such as to take over a user-controlled animation when they let go. - */ - public static Interpolator mapToProgress(Interpolator interpolator, float lowerBound, - float upperBound) { - return t -> Utilities.mapRange(interpolator.getInterpolation(t), lowerBound, upperBound); - } - - /** - * Returns the reverse of the provided interpolator, following the formula: g(x) = 1 - f(1 - x). - * In practice, this means that if f is an interpolator used to model a value animating between - * m and n, g is the interpolator to use to obtain the specular behavior when animating from n - * to m. - */ - public static Interpolator reverse(Interpolator interpolator) { - return t -> 1 - interpolator.getInterpolation(1 - t); - } - - // Create the default emphasized interpolator - private static PathInterpolator createEmphasizedInterpolator() { - Path path = new Path(); - // Doing the same as fast_out_extra_slow_in - path.moveTo(0f, 0f); - path.cubicTo(0.05f, 0f, 0.133333f, 0.06f, 0.166666f, 0.4f); - path.cubicTo(0.208333f, 0.82f, 0.25f, 1f, 1f, 1f); - return new PathInterpolator(path); - } -} diff --git a/src/com/android/launcher3/anim/SpringAnimationBuilder.java b/src/com/android/launcher3/anim/SpringAnimationBuilder.java index 40fa0cfd02..bc7b7f00d2 100644 --- a/src/com/android/launcher3/anim/SpringAnimationBuilder.java +++ b/src/com/android/launcher3/anim/SpringAnimationBuilder.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.anim; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.LINEAR; import android.animation.Animator; import android.animation.ValueAnimator; diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index 98672685e9..0d51d4826a 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -28,9 +28,9 @@ import android.view.View; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.DragSource; import com.android.launcher3.DropTarget; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.logging.InstanceId; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 366870b4c2..f18f900593 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -19,11 +19,11 @@ package com.android.launcher3.dragndrop; import static android.animation.ObjectAnimator.ofFloat; +import static com.android.app.animation.Interpolators.DECELERATE_1_5; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y; import static com.android.launcher3.Utilities.mapRange; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import android.animation.Animator; @@ -42,6 +42,7 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.animation.Interpolator; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DropTargetBar; import com.android.launcher3.Launcher; @@ -49,7 +50,6 @@ import com.android.launcher3.R; import com.android.launcher3.ShortcutAndWidgetContainer; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.PendingAnimation; import com.android.launcher3.anim.SpringProperty; import com.android.launcher3.celllayout.CellLayoutLayoutParams; @@ -340,14 +340,14 @@ public class DragLayer extends BaseDragLayer implements LauncherOverla if (duration < 0) { duration = res.getInteger(R.integer.config_dropAnimMaxDuration); if (dist < maxDist) { - duration *= DEACCEL_1_5.getInterpolation(dist / maxDist); + duration *= DECELERATE_1_5.getInterpolation(dist / maxDist); } duration = Math.max(duration, res.getInteger(R.integer.config_dropAnimMinDuration)); } // Fall back to cubic ease out interpolator for the animation if none is specified TimeInterpolator interpolator = - motionInterpolator == null ? DEACCEL_1_5 : motionInterpolator; + motionInterpolator == null ? DECELERATE_1_5 : motionInterpolator; // Animate the view PendingAnimation anim = new PendingAnimation(duration); @@ -475,7 +475,7 @@ public class DragLayer extends BaseDragLayer implements LauncherOverla @Override public void onOverlayScrollChanged(float progress) { - float alpha = 1 - Interpolators.DEACCEL_3.getInterpolation(progress); + float alpha = 1 - Interpolators.DECELERATE_3.getInterpolation(progress); float transX = getMeasuredWidth() * progress; if (mIsRtl) { diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 0d0717e4f6..c26d673f8c 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -55,9 +55,9 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat; import androidx.dynamicanimation.animation.SpringAnimation; import androidx.dynamicanimation.animation.SpringForce; +import com.android.app.animation.Interpolators; import com.android.launcher3.R; import com.android.launcher3.Utilities; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.icons.FastBitmapDrawable; import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.model.data.ItemInfo; @@ -371,7 +371,7 @@ public abstract class DragView extends Fram AnimatorSet anim = new AnimatorSet(); anim.play(ObjectAnimator.ofFloat(newContent, VIEW_ALPHA, 0, 1)); anim.play(ObjectAnimator.ofFloat(mContent, VIEW_ALPHA, 0)); - anim.setDuration(duration).setInterpolator(Interpolators.DEACCEL_1_5); + anim.setDuration(duration).setInterpolator(Interpolators.DECELERATE_1_5); anim.start(); } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index be643b31e2..d78bfbafb7 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -42,6 +42,7 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.Alarm; import com.android.launcher3.BubbleTextView; import com.android.launcher3.CellLayout; @@ -56,7 +57,6 @@ import com.android.launcher3.Reorderable; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; import com.android.launcher3.allapps.ActivityAllAppsContainerView; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.celllayout.CellLayoutLayoutParams; import com.android.launcher3.dot.FolderDotInfo; import com.android.launcher3.dragndrop.BaseItemDragListener; @@ -406,7 +406,7 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel final int finalIndex = index; dragLayer.animateView(animateView, to, finalAlpha, finalScale, finalScale, DROP_IN_ANIMATION_DURATION, - Interpolators.DEACCEL_2, + Interpolators.DECELERATE_2, () -> { mPreviewItemManager.hidePreviewItem(finalIndex, false); mFolder.showItem(item); diff --git a/src/com/android/launcher3/graphics/PreloadIconDrawable.java b/src/com/android/launcher3/graphics/PreloadIconDrawable.java index d366c4ae0d..c5c74ac429 100644 --- a/src/com/android/launcher3/graphics/PreloadIconDrawable.java +++ b/src/com/android/launcher3/graphics/PreloadIconDrawable.java @@ -17,8 +17,8 @@ package com.android.launcher3.graphics; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V2; import static com.android.launcher3.config.FeatureFlags.ENABLE_DOWNLOAD_APP_UX_V3; diff --git a/src/com/android/launcher3/notification/NotificationContainer.java b/src/com/android/launcher3/notification/NotificationContainer.java index 9eb05cd40f..7cc9ad38bc 100644 --- a/src/com/android/launcher3/notification/NotificationContainer.java +++ b/src/com/android/launcher3/notification/NotificationContainer.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.notification; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.touch.SingleAxisSwipeDetector.HORIZONTAL; import android.animation.Animator; diff --git a/src/com/android/launcher3/notification/NotificationMainView.java b/src/com/android/launcher3/notification/NotificationMainView.java index 16a40576b8..ecd018b26d 100644 --- a/src/com/android/launcher3/notification/NotificationMainView.java +++ b/src/com/android/launcher3/notification/NotificationMainView.java @@ -16,8 +16,8 @@ package com.android.launcher3.notification; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.mapToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_NOTIFICATION_DISMISSED; import android.animation.AnimatorSet; diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index 72f99cb4df..08be026ba8 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -18,11 +18,11 @@ package com.android.launcher3.popup; import static androidx.core.content.ContextCompat.getColorStateList; -import static com.android.launcher3.anim.Interpolators.ACCELERATED_EASE; -import static com.android.launcher3.anim.Interpolators.DECELERATED_EASE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.ACCELERATED_EASE; +import static com.android.app.animation.Interpolators.DECELERATED_EASE; +import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.config.FeatureFlags.ENABLE_MATERIAL_U_POPUP; import android.animation.Animator; diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index c499e35ddd..8bc1c3718c 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -15,6 +15,7 @@ */ package com.android.launcher3.touch; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.newCancelListener; @@ -22,7 +23,6 @@ import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW; diff --git a/src/com/android/launcher3/touch/AllAppsSwipeController.java b/src/com/android/launcher3/touch/AllAppsSwipeController.java index d028f24b0a..b672bde45d 100644 --- a/src/com/android/launcher3/touch/AllAppsSwipeController.java +++ b/src/com/android/launcher3/touch/AllAppsSwipeController.java @@ -15,15 +15,15 @@ */ package com.android.launcher3.touch; +import static com.android.app.animation.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED_ACCELERATE; +import static com.android.app.animation.Interpolators.EMPHASIZED_DECELERATE; +import static com.android.app.animation.Interpolators.FINAL_FRAME; +import static com.android.app.animation.Interpolators.INSTANT; +import static com.android.app.animation.Interpolators.LINEAR; +import static com.android.app.animation.Interpolators.clampToProgress; import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_ACCELERATE; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED_DECELERATE; -import static com.android.launcher3.anim.Interpolators.FINAL_FRAME; -import static com.android.launcher3.anim.Interpolators.INSTANT; -import static com.android.launcher3.anim.Interpolators.LINEAR; -import static com.android.launcher3.anim.Interpolators.clampToProgress; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_BOTTOM_SHEET_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; @@ -40,11 +40,11 @@ import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW; import android.view.MotionEvent; import android.view.animation.Interpolator; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.states.StateAnimationConfig; /** diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java index 4ac6bc475c..b97b8894c7 100644 --- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java +++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java @@ -15,9 +15,9 @@ import android.view.animation.Interpolator; import androidx.annotation.AnyThread; +import com.android.app.animation.Interpolators; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace; -import com.android.launcher3.anim.Interpolators; /** * Utility class to handle wallpaper scrolling along with workspace. @@ -237,7 +237,7 @@ public class WallpaperOffsetInterpolator { public OffsetHandler(Context context) { super(UI_HELPER_EXECUTOR.getLooper()); - mInterpolator = Interpolators.DEACCEL_1_5; + mInterpolator = Interpolators.DECELERATE_1_5; mWM = WallpaperManager.getInstance(context); } diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java index ec7ec0b6c0..91eb10970b 100644 --- a/src/com/android/launcher3/views/AbstractSlideInView.java +++ b/src/com/android/launcher3/views/AbstractSlideInView.java @@ -17,11 +17,11 @@ package com.android.launcher3.views; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; +import static com.android.app.animation.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.LauncherAnimUtils.TABLET_BOTTOM_SHEET_SUCCESS_TRANSITION_PROGRESS; import static com.android.launcher3.allapps.AllAppsTransitionController.REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS; -import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity; import static com.android.launcher3.util.ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE; import android.animation.Animator; @@ -47,10 +47,10 @@ import androidx.annotation.Nullable; import androidx.annotation.Px; import androidx.annotation.RequiresApi; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatedFloat; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.touch.BaseSwipeDetector; import com.android.launcher3.touch.SingleAxisSwipeDetector; @@ -310,7 +310,7 @@ public abstract class AbstractSlideInView TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED)); mOpenCloseAnimator.setDuration( BaseSwipeDetector.calculateDuration(velocity, mTranslationShift)) - .setInterpolator(Interpolators.DEACCEL); + .setInterpolator(Interpolators.DECELERATE); mOpenCloseAnimator.start(); } } @@ -357,7 +357,7 @@ public abstract class AbstractSlideInView } protected Interpolator getIdleInterpolator() { - return Interpolators.ACCEL; + return Interpolators.ACCELERATE; } protected void onCloseComplete() { diff --git a/src/com/android/launcher3/views/ArrowTipView.java b/src/com/android/launcher3/views/ArrowTipView.java index 73c5ad457b..d905aaaadb 100644 --- a/src/com/android/launcher3/views/ArrowTipView.java +++ b/src/com/android/launcher3/views/ArrowTipView.java @@ -35,11 +35,11 @@ import androidx.annotation.Nullable; import androidx.annotation.Px; import androidx.core.content.ContextCompat; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.graphics.TriangleShape; @@ -95,7 +95,7 @@ public class ArrowTipView extends AbstractFloatingView { .withLayer() .setStartDelay(0) .setDuration(HIDE_DURATION_MS) - .setInterpolator(Interpolators.ACCEL) + .setInterpolator(Interpolators.ACCELERATE) .withEndAction(() -> mActivity.getDragLayer().removeView(this)) .start(); } else { @@ -191,7 +191,7 @@ public class ArrowTipView extends AbstractFloatingView { .withLayer() .setStartDelay(SHOW_DELAY_MS) .setDuration(SHOW_DURATION_MS) - .setInterpolator(Interpolators.DEACCEL) + .setInterpolator(Interpolators.DECELERATE) .start(); return this; } @@ -339,7 +339,7 @@ public class ArrowTipView extends AbstractFloatingView { .withLayer() .setStartDelay(SHOW_DELAY_MS) .setDuration(SHOW_DURATION_MS) - .setInterpolator(Interpolators.DEACCEL) + .setInterpolator(Interpolators.DECELERATE) .start(); return this; } diff --git a/src/com/android/launcher3/views/ClipIconView.java b/src/com/android/launcher3/views/ClipIconView.java index 694deadb63..87e496e4c2 100644 --- a/src/com/android/launcher3/views/ClipIconView.java +++ b/src/com/android/launcher3/views/ClipIconView.java @@ -15,9 +15,9 @@ */ package com.android.launcher3.views; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.boundToRange; import static com.android.launcher3.Utilities.mapToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; import static java.lang.Math.max; diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 4d0e2aff2d..3b052210a4 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -17,10 +17,10 @@ package com.android.launcher3.views; import static android.view.Gravity.LEFT; +import static com.android.app.animation.Interpolators.LINEAR; import static com.android.launcher3.Utilities.getBadge; import static com.android.launcher3.Utilities.getFullDrawable; import static com.android.launcher3.Utilities.mapToRange; -import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; import static com.android.launcher3.views.IconLabelDotView.setIconAndDotVisible; diff --git a/src/com/android/launcher3/views/Snackbar.java b/src/com/android/launcher3/views/Snackbar.java index 8d5838e592..2d81db8600 100644 --- a/src/com/android/launcher3/views/Snackbar.java +++ b/src/com/android/launcher3/views/Snackbar.java @@ -30,10 +30,10 @@ import android.widget.TextView; import androidx.annotation.Nullable; +import com.android.app.animation.Interpolators; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; -import com.android.launcher3.anim.Interpolators; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.dragndrop.DragLayer; @@ -159,7 +159,7 @@ public class Snackbar extends AbstractFloatingView { .scaleX(1) .scaleY(1) .setDuration(SHOW_DURATION_MS) - .setInterpolator(Interpolators.ACCEL_DEACCEL) + .setInterpolator(Interpolators.ACCELERATE_DECELERATE) .start(); int timeout = AccessibilityManagerCompat.getRecommendedTimeoutMillis(activity, TIMEOUT_DURATION_MS, FLAG_CONTENT_TEXT | FLAG_CONTENT_CONTROLS); @@ -174,7 +174,7 @@ public class Snackbar extends AbstractFloatingView { .withLayer() .setStartDelay(0) .setDuration(HIDE_DURATION_MS) - .setInterpolator(Interpolators.ACCEL) + .setInterpolator(Interpolators.ACCELERATE) .withEndAction(this::onClosed) .start(); } else { diff --git a/src/com/android/launcher3/views/WidgetsEduView.java b/src/com/android/launcher3/views/WidgetsEduView.java index c2947c7310..918078178c 100644 --- a/src/com/android/launcher3/views/WidgetsEduView.java +++ b/src/com/android/launcher3/views/WidgetsEduView.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.views; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import android.animation.PropertyValuesHolder; import android.content.Context; diff --git a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java index 9442734646..473abf1b1b 100644 --- a/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java +++ b/src/com/android/launcher3/widget/AddItemWidgetsBottomSheet.java @@ -16,8 +16,8 @@ package com.android.launcher3.widget; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.Utilities.ATLEAST_R; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import android.animation.PropertyValuesHolder; import android.annotation.SuppressLint; diff --git a/src/com/android/launcher3/widget/BaseWidgetSheet.java b/src/com/android/launcher3/widget/BaseWidgetSheet.java index 049131ef10..dcc86a15e9 100644 --- a/src/com/android/launcher3/widget/BaseWidgetSheet.java +++ b/src/com/android/launcher3/widget/BaseWidgetSheet.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.widget; -import static com.android.launcher3.anim.Interpolators.EMPHASIZED; +import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.config.FeatureFlags.LARGE_SCREEN_WIDGET_PICKER; import android.content.Context; diff --git a/src/com/android/launcher3/widget/WidgetsBottomSheet.java b/src/com/android/launcher3/widget/WidgetsBottomSheet.java index 846dafdf30..93f7cb3afe 100644 --- a/src/com/android/launcher3/widget/WidgetsBottomSheet.java +++ b/src/com/android/launcher3/widget/WidgetsBottomSheet.java @@ -16,8 +16,8 @@ package com.android.launcher3.widget; +import static com.android.app.animation.Interpolators.FAST_OUT_SLOW_IN; import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_BOTTOM_WIDGETS_TRAY; -import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN; import android.animation.PropertyValuesHolder; import android.content.Context; diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java index 772a995324..b62dbd1d95 100644 --- a/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java +++ b/src_ui_overrides/com/android/launcher3/uioverrides/states/AllAppsState.java @@ -15,7 +15,7 @@ */ package com.android.launcher3.uioverrides.states; -import static com.android.launcher3.anim.Interpolators.DEACCEL_2; +import static com.android.app.animation.Interpolators.DECELERATE; import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAPPS; import android.content.Context; @@ -80,7 +80,7 @@ public class AllAppsState extends LauncherState { @Override public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) { PageAlphaProvider superPageAlphaProvider = super.getWorkspacePageAlphaProvider(launcher); - return new PageAlphaProvider(DEACCEL_2) { + return new PageAlphaProvider(DECELERATE) { @Override public float getPageAlpha(int pageIndex) { return launcher.getDeviceProfile().isTablet From 7945649c5e3804a448133083d90363673ea0e647 Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Tue, 23 May 2023 11:32:22 +0100 Subject: [PATCH 14/20] Implement calculations of Responsive Grid in DeviceProfile When a grid has a responsive spec and the feature flag is on, use the new calculations for the sizes in Workspace. This shouldn't affect Scalable grids. Fix: 277064708 Test: HomeScreenImageTest Test: DeviceProfileDumpTest Test: ResponsiveHomeScreenImageTest Test: DeviceProfileResponsiveDumpTest Flag: ENABLE_RESPONSIVE_WORKSPACE Change-Id: Idef3d17fbfa1b2e0c82c12e7784a7584f1ba1b88 --- src/com/android/launcher3/BubbleTextView.java | 2 +- src/com/android/launcher3/DeviceProfile.java | 136 +++++++++++------- .../launcher3/ShortcutAndWidgetContainer.java | 7 +- .../launcher3/workspace/WorkspaceSpecs.kt | 7 + 4 files changed, 97 insertions(+), 55 deletions(-) diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index f920d7507c..05d434e479 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -210,7 +210,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx); setCompoundDrawablePadding(grid.iconDrawablePaddingPx); defaultIconSize = grid.iconSizePx; - setCenterVertically(grid.isScalableGrid); + setCenterVertically(grid.iconCenterVertically); } else if (mDisplay == DISPLAY_ALL_APPS) { setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx); setCompoundDrawablePadding(grid.allAppsIconDrawablePaddingPx); diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index fb41044875..1085e4c550 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -103,7 +103,7 @@ public class DeviceProfile { public final float aspectRatio; - public final boolean isScalableGrid; + private final boolean mIsScalableGrid; private final int mTypeIndex; // Responsive grid @@ -152,13 +152,14 @@ public class DeviceProfile { public int iconTextSizePx; public int iconDrawablePaddingPx; public int iconDrawablePaddingOriginalPx; + public boolean iconCenterVertically; public float cellScaleToFit; public int cellWidthPx; public int cellHeightPx; public int workspaceCellPaddingXPx; - public int cellYPaddingPx; + public int cellYPaddingPx = -1; // Folder public float folderLabelTextScale; @@ -305,7 +306,7 @@ public class DeviceProfile { // TODO(b/241386436): shouldn't change any launcher behaviour mIsResponsiveGrid = inv.workspaceSpecsId != INVALID_RESOURCE_HANDLE; - isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode; + mIsScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode; // Determine device posture. mInfo = info; isTablet = info.isTablet(windowBounds); @@ -342,14 +343,6 @@ public class DeviceProfile { } } - if (mIsResponsiveGrid) { - mWorkspaceSpecs = new WorkspaceSpecs(new ResourceHelper(context, inv.workspaceSpecsId)); - mResponsiveWidthSpec = mWorkspaceSpecs.getCalculatedWidthSpec(inv.numColumns, - availableWidthPx); - mResponsiveHeightSpec = mWorkspaceSpecs.getCalculatedHeightSpec(inv.numRows, - availableHeightPx); - } - if (DisplayController.isTransientTaskbar(context)) { float invTransientIconSizeDp = inv.transientTaskbarIconSize[mTypeIndex]; taskbarIconSize = pxFromDp(invTransientIconSizeDp, mMetrics); @@ -372,8 +365,6 @@ public class DeviceProfile { edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); workspaceContentScale = res.getFloat(R.dimen.workspace_content_scale); - desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res); - desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx; gridVisualizationPaddingX = res.getDimensionPixelSize( R.dimen.grid_visualization_horizontal_cell_spacing); gridVisualizationPaddingY = res.getDimensionPixelSize( @@ -406,7 +397,7 @@ public class DeviceProfile { folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale); - if (isScalableGrid && inv.folderStyle != INVALID_RESOURCE_HANDLE) { + if (mIsScalableGrid && inv.folderStyle != INVALID_RESOURCE_HANDLE) { TypedArray folderStyle = context.obtainStyledAttributes(inv.folderStyle, R.styleable.FolderStyle); // These are re-set in #updateFolderCellSize if the grid is not scalable @@ -428,8 +419,6 @@ public class DeviceProfile { folderContentPaddingTop = res.getDimensionPixelSize(R.dimen.folder_top_padding_default); } - cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv); - cellLayoutBorderSpaceOriginalPx = new Point(cellLayoutBorderSpacePx); allAppsBorderSpacePx = new Point( pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics), pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics)); @@ -479,7 +468,7 @@ public class DeviceProfile { || inv.inlineQsb[INDEX_TWO_PANEL_LANDSCAPE] : inv.inlineQsb[INDEX_DEFAULT] || inv.inlineQsb[INDEX_LANDSCAPE]) && hotseatQsbHeight > 0; - isQsbInline = isScalableGrid && inv.inlineQsb[mTypeIndex] && canQsbInline; + isQsbInline = mIsScalableGrid && inv.inlineQsb[mTypeIndex] && canQsbInline; areNavButtonsInline = isTaskbarPresent && !isGestureMode; numShownHotseatIcons = @@ -534,6 +523,21 @@ public class DeviceProfile { hotseatBarEndOffset = 0; } + // Needs to be calculated after hotseatBarSizePx is correct, + // for the available height to be correct + if (mIsResponsiveGrid) { + mWorkspaceSpecs = new WorkspaceSpecs(new ResourceHelper(context, inv.workspaceSpecsId)); + mResponsiveWidthSpec = mWorkspaceSpecs.getCalculatedWidthSpec(inv.numColumns, + availableWidthPx); + mResponsiveHeightSpec = mWorkspaceSpecs.getCalculatedHeightSpec(inv.numRows, + // don't use availableHeightPx because it subtracts bottom padding, + // but the hotseat go behind it + heightPx - mInsets.top - hotseatBarSizePx); + } + + desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res); + desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx; + overviewTaskMarginPx = res.getDimensionPixelSize(R.dimen.overview_task_margin); overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size); overviewTaskIconDrawableSizePx = @@ -554,21 +558,7 @@ public class DeviceProfile { // Calculate all of the remaining variables. extraSpace = updateAvailableDimensions(res); - // Now that we have all of the variables calculated, we can tune certain sizes. - if (isScalableGrid && inv.devicePaddingId != INVALID_RESOURCE_HANDLE) { - // Paddings were created assuming no scaling, so we first unscale the extra space. - int unscaledExtraSpace = (int) (extraSpace / cellScaleToFit); - DevicePaddings devicePaddings = new DevicePaddings(context, inv.devicePaddingId); - DevicePadding padding = devicePaddings.getDevicePadding(unscaledExtraSpace); - maxEmptySpace = padding.getMaxEmptySpacePx(); - - int paddingWorkspaceTop = padding.getWorkspaceTopPadding(unscaledExtraSpace); - int paddingWorkspaceBottom = padding.getWorkspaceBottomPadding(unscaledExtraSpace); - int paddingHotseatBottom = padding.getHotseatBottomPadding(unscaledExtraSpace); - - workspaceTopPadding = Math.round(paddingWorkspaceTop * cellScaleToFit); - workspaceBottomPadding = Math.round(paddingWorkspaceBottom * cellScaleToFit); - } + calculateAndSetWorkspaceVerticalPadding(context, inv, extraSpace); int cellLayoutPadding = isTwoPanels ? cellLayoutBorderSpacePx.x / 2 : res.getDimensionPixelSize( @@ -649,15 +639,40 @@ public class DeviceProfile { } private int getHorizontalMarginPx(InvariantDeviceProfile idp, Resources res) { + if (mIsResponsiveGrid) { + return mResponsiveWidthSpec.getStartPaddingPx(); + } + if (isVerticalBarLayout()) { return 0; } - return isScalableGrid + return mIsScalableGrid ? pxFromDp(idp.horizontalMargin[mTypeIndex], mMetrics) : res.getDimensionPixelSize(R.dimen.dynamic_grid_left_right_margin); } + private void calculateAndSetWorkspaceVerticalPadding(Context context, + InvariantDeviceProfile inv, + int extraSpace) { + if (mIsResponsiveGrid) { + workspaceTopPadding = mResponsiveHeightSpec.getStartPaddingPx(); + workspaceBottomPadding = mResponsiveHeightSpec.getEndPaddingPx(); + } else if (mIsScalableGrid && inv.devicePaddingId != INVALID_RESOURCE_HANDLE) { + // Paddings were created assuming no scaling, so we first unscale the extra space. + int unscaledExtraSpace = (int) (extraSpace / cellScaleToFit); + DevicePaddings devicePaddings = new DevicePaddings(context, inv.devicePaddingId); + DevicePadding padding = devicePaddings.getDevicePadding(unscaledExtraSpace); + maxEmptySpace = padding.getMaxEmptySpacePx(); + + int paddingWorkspaceTop = padding.getWorkspaceTopPadding(unscaledExtraSpace); + int paddingWorkspaceBottom = padding.getWorkspaceBottomPadding(unscaledExtraSpace); + + workspaceTopPadding = Math.round(paddingWorkspaceTop * cellScaleToFit); + workspaceBottomPadding = Math.round(paddingWorkspaceBottom * cellScaleToFit); + } + } + /** Updates hotseatCellHeightPx and hotseatBarSizePx */ private void updateHotseatSizes(int hotseatIconSizePx) { // Ensure there is enough space for folder icons, which have a slightly larger radius. @@ -682,7 +697,7 @@ public class DeviceProfile { * necessary. */ public void recalculateHotseatWidthAndBorderSpace() { - if (!isScalableGrid) return; + if (!mIsScalableGrid) return; int columns = inv.hotseatColumnSpan[mTypeIndex]; float hotseatWidthPx = getIconToIconWidthForColumns(columns); @@ -735,12 +750,16 @@ public class DeviceProfile { } private Point getCellLayoutBorderSpace(InvariantDeviceProfile idp, float scale) { - if (!isScalableGrid) { - return new Point(0, 0); - } + int horizontalSpacePx = 0; + int verticalSpacePx = 0; - int horizontalSpacePx = pxFromDp(idp.borderSpaces[mTypeIndex].x, mMetrics, scale); - int verticalSpacePx = pxFromDp(idp.borderSpaces[mTypeIndex].y, mMetrics, scale); + if (mIsResponsiveGrid) { + horizontalSpacePx = mResponsiveWidthSpec.getGutterPx(); + verticalSpacePx = mResponsiveHeightSpec.getGutterPx(); + } else if (mIsScalableGrid) { + horizontalSpacePx = pxFromDp(idp.borderSpaces[mTypeIndex].x, mMetrics, scale); + verticalSpacePx = pxFromDp(idp.borderSpaces[mTypeIndex].y, mMetrics, scale); + } return new Point(horizontalSpacePx, verticalSpacePx); } @@ -861,6 +880,7 @@ public class DeviceProfile { float invIconTextSizeSp = inv.iconTextSize[mTypeIndex]; iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics)); iconTextSizePx = pxFromSp(invIconTextSizeSp, mMetrics); + iconCenterVertically = mIsScalableGrid || mIsResponsiveGrid; updateIconSize(1f, res); @@ -874,7 +894,7 @@ public class DeviceProfile { boolean shouldScale = scaleY < 1f; float scaleX = 1f; - if (isScalableGrid) { + if (mIsScalableGrid) { // We scale to fit the cellWidth and cellHeight in the available space. // The benefit of scalable grids is that we can get consistent aspect ratios between // devices. @@ -919,8 +939,18 @@ public class DeviceProfile { final boolean isVerticalLayout = isVerticalBarLayout(); iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * iconScale); cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv, scale); + int cellTextAndPaddingHeight = + iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx); - if (isScalableGrid) { + if (mIsResponsiveGrid) { + int cellContentHeight = iconSizePx + cellTextAndPaddingHeight; + + cellWidthPx = mResponsiveWidthSpec.getCellSizePx(); + cellHeightPx = mResponsiveHeightSpec.getCellSizePx(); + cellYPaddingPx = Math.max(0, cellHeightPx - cellContentHeight) / 2; + + // TODO(b/283929701): decrease icon size if content doesn't fit on cell + } else if (mIsScalableGrid) { cellWidthPx = pxFromDp(inv.minCellSize[mTypeIndex].x, mMetrics, scale); cellHeightPx = pxFromDp(inv.minCellSize[mTypeIndex].y, mMetrics, scale); @@ -942,8 +972,6 @@ public class DeviceProfile { } } - int cellTextAndPaddingHeight = - iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx); int cellContentHeight = iconSizePx + cellTextAndPaddingHeight; if (cellHeightPx < cellContentHeight) { // If cellHeight no longer fit iconSize, reduce borderSpace to make cellHeight @@ -1041,7 +1069,7 @@ public class DeviceProfile { + allAppsBorderSpacePx.y; // but width is just the cell, // the border is added in #updateAllAppsContainerWidth - if (isScalableGrid) { + if (mIsScalableGrid) { allAppsIconSizePx = pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics); allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; @@ -1124,7 +1152,7 @@ public class DeviceProfile { int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx); - if (isScalableGrid) { + if (mIsScalableGrid) { if (inv.folderStyle == INVALID_RESOURCE_HANDLE) { folderCellWidthPx = roundPxValueFromFloat(getCellSize().x * scale); folderCellHeightPx = roundPxValueFromFloat(getCellSize().y * scale); @@ -1299,10 +1327,12 @@ public class DeviceProfile { } else { // Pad the bottom of the workspace with hotseat bar // and leave a bit of space in case a widget go all the way down - int paddingBottom = hotseatBarSizePx + workspaceBottomPadding - + workspacePageIndicatorHeight - mWorkspacePageIndicatorOverlapWorkspace - - mInsets.bottom; - int paddingTop = workspaceTopPadding + (isScalableGrid ? 0 : edgeMarginPx); + int paddingBottom = hotseatBarSizePx + workspaceBottomPadding - mInsets.bottom; + if (!mIsResponsiveGrid) { + paddingBottom += + workspacePageIndicatorHeight - mWorkspacePageIndicatorOverlapWorkspace; + } + int paddingTop = workspaceTopPadding + (mIsScalableGrid ? 0 : edgeMarginPx); int paddingSide = desiredWorkspaceHorizontalMarginPx; padding.set(paddingSide, paddingTop, paddingSide, paddingBottom); @@ -1378,7 +1408,7 @@ public class DeviceProfile { hotseatBarPadding.right = endSpacing; } - } else if (isScalableGrid) { + } else if (mIsScalableGrid) { int sideSpacing = (availableWidthPx - hotseatQsbWidth) / 2; hotseatBarPadding.set(sideSpacing, 0, @@ -1598,7 +1628,7 @@ public class DeviceProfile { writer.println(prefix + "\taspectRatio:" + aspectRatio); writer.println(prefix + "\tisResponsiveGrid:" + mIsResponsiveGrid); - writer.println(prefix + "\tisScalableGrid:" + isScalableGrid); + writer.println(prefix + "\tisScalableGrid:" + mIsScalableGrid); writer.println(prefix + "\tinv.numRows: " + inv.numRows); writer.println(prefix + "\tinv.numColumns: " + inv.numColumns); @@ -1752,6 +1782,10 @@ public class DeviceProfile { getWorkspaceSpringLoadScale(context))); writer.println(prefix + pxToDpStr("getCellLayoutHeight()", getCellLayoutHeight())); writer.println(prefix + pxToDpStr("getCellLayoutWidth()", getCellLayoutWidth())); + if (mIsResponsiveGrid) { + writer.println(prefix + "\tmResponsiveHeightSpec:" + mResponsiveHeightSpec.toString()); + writer.println(prefix + "\tmResponsiveWidthSpec:" + mResponsiveWidthSpec.toString()); + } } /** Returns a reduced representation of this DeviceProfile. */ diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index a0ceefb733..ba6dc26b39 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -154,9 +154,10 @@ public class ShortcutAndWidgetContainer extends ViewGroup implements FolderIcon. mBorderSpace); // Center the icon/folder int cHeight = getCellContentHeight(); - int cellPaddingY = dp.isScalableGrid && mContainerType == WORKSPACE - ? dp.cellYPaddingPx - : (int) Math.max(0, ((lp.height - cHeight) / 2f)); + int cellPaddingY = + dp.cellYPaddingPx >= 0 && mContainerType == WORKSPACE + ? dp.cellYPaddingPx + : (int) Math.max(0, ((lp.height - cHeight) / 2f)); // No need to add padding when cell layout border spacing is present. boolean noPaddingX = diff --git a/src/com/android/launcher3/workspace/WorkspaceSpecs.kt b/src/com/android/launcher3/workspace/WorkspaceSpecs.kt index ac0a166b18..dc5ae47b16 100644 --- a/src/com/android/launcher3/workspace/WorkspaceSpecs.kt +++ b/src/com/android/launcher3/workspace/WorkspaceSpecs.kt @@ -231,6 +231,13 @@ class CalculatedWorkspaceSpec( if (workspaceSpec.cellSize.ofRemainderSpace > 0) cellSizePx = (workspaceSpec.cellSize.ofRemainderSpace * remainderSpace).roundToInt() } + + override fun toString(): String { + return "CalculatedWorkspaceSpec(availableSpace=$availableSpace, " + + "cells=$cells, startPaddingPx=$startPaddingPx, endPaddingPx=$endPaddingPx, " + + "gutterPx=$gutterPx, cellSizePx=$cellSizePx, " + + "workspaceSpec.maxAvailableSize=${workspaceSpec.maxAvailableSize})" + } } data class WorkspaceSpec( From 0873afd7fa2fe1cb91caf3d71ff98ab6f2f62415 Mon Sep 17 00:00:00 2001 From: Nick Chameyev Date: Tue, 30 May 2023 18:10:08 +0100 Subject: [PATCH 15/20] [Unfold animation] Disable preemptive launcher animation Disables preemptive unfold animation by default. Bug: 281821523 Test: unfold on launcher Change-Id: I767f25cf0414a91c82a33cf86ca16db2e4dcfa22 --- src/com/android/launcher3/config/FeatureFlags.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index 621c2abb90..f88ff86612 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -302,7 +302,7 @@ public final class FeatureFlags { "Enable widget transition animation when resizing the widgets"); public static final BooleanFlag PREEMPTIVE_UNFOLD_ANIMATION_START = getDebugFlag(270397209, - "PREEMPTIVE_UNFOLD_ANIMATION_START", ENABLED, + "PREEMPTIVE_UNFOLD_ANIMATION_START", DISABLED, "Enables starting the unfold animation preemptively when unfolding, without" + "waiting for SystemUI and then merging the SystemUI progress whenever we " + "start receiving the events"); From bbab64e00cad8543a9a24133fd58e3f418d03e1c Mon Sep 17 00:00:00 2001 From: fbaron Date: Tue, 30 May 2023 10:28:45 -0700 Subject: [PATCH 16/20] Fix widget picker crash It looks like if shouldClearVisibleEntries() evaluates to true and we clear mVisibleEntries, we get an Inconsistency IndexOutOfBounds error, the same as the one reported in the crash. Bug: 276766307 Test: Verify that with these changes the widgets still update correctly when changing languages Change-Id: I9f92e61d967aab2c8297cfc2fb4b04193df67650 --- .../widget/picker/WidgetsListAdapter.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java b/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java index 723ea17147..8dd1de4ac8 100644 --- a/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java +++ b/src/com/android/launcher3/widget/picker/WidgetsListAdapter.java @@ -42,7 +42,6 @@ import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.android.launcher3.R; -import com.android.launcher3.model.data.PackageItemInfo; import com.android.launcher3.recyclerview.ViewHolderBinder; import com.android.launcher3.util.LabelComparator; import com.android.launcher3.util.PackageUserKey; @@ -58,7 +57,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; -import java.util.Map; import java.util.OptionalInt; import java.util.function.IntSupplier; import java.util.function.Predicate; @@ -174,9 +172,6 @@ public class WidgetsListAdapter extends Adapter implements OnHeaderC mAllEntries.clear(); mAllEntries.add(new WidgetListSpaceEntry()); tempEntries.stream().sorted(mRowComparator).forEach(mAllEntries::add); - if (shouldClearVisibleEntries()) { - mVisibleEntries.clear(); - } updateVisibleEntries(); } @@ -426,29 +421,6 @@ public class WidgetsListAdapter extends Adapter implements OnHeaderC updateVisibleEntries(); } - /** - * Returns {@code true} if there is a change in {@link #mAllEntries} that results in an - * invalidation of {@link #mVisibleEntries}. e.g. there is change in the device language. - */ - private boolean shouldClearVisibleEntries() { - Map packagesInfo = - mAllEntries.stream() - .filter(entry -> entry instanceof WidgetsListHeaderEntry) - .map(entry -> entry.mPkgItem) - .collect(Collectors.toMap( - entry -> PackageUserKey.fromPackageItemInfo(entry), - entry -> entry)); - for (WidgetsListBaseEntry visibleEntry: mVisibleEntries) { - PackageUserKey key = PackageUserKey.fromPackageItemInfo(visibleEntry.mPkgItem); - PackageItemInfo packageItemInfo = packagesInfo.get(key); - if (packageItemInfo != null - && !visibleEntry.mPkgItem.title.equals(packageItemInfo.title)) { - return true; - } - } - return false; - } - /** Comparator for sorting WidgetListRowEntry based on package title. */ public static class WidgetListBaseRowEntryComparator implements Comparator { From aa0e91820b15f4b3182e756102ce5baeb9912551 Mon Sep 17 00:00:00 2001 From: Anushree Ganjam Date: Tue, 23 May 2023 20:15:45 +0000 Subject: [PATCH 17/20] Add LAUNCHER_APP_LAUNCH_PENDING_INTENT where an app is launched through pending intent. Bug: Bug: 282236269 Test: Manual Flag: NA Change-Id: I6fb15a77f32ce5914f9632f5fb77f340acd3cfda --- src/com/android/launcher3/logging/StatsLogManager.java | 3 +++ src/com/android/launcher3/views/ActivityContext.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index 15f353827e..17d3302e69 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -642,6 +642,9 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User has swiped upwards from the gesture handle to show transient taskbar.") LAUNCHER_TRANSIENT_TASKBAR_SHOW(1331), + + @UiEvent(doc = "App launched through pending intent") + LAUNCHER_APP_LAUNCH_PENDING_INTENT(1394), ; // ADD MORE diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java index 515a2d81a5..4b319e5b61 100644 --- a/src/com/android/launcher3/views/ActivityContext.java +++ b/src/com/android/launcher3/views/ActivityContext.java @@ -20,6 +20,7 @@ import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR; import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON; import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_PENDING_INTENT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; @@ -305,6 +306,11 @@ public interface ActivityContext { ActivityOptionsWrapper options = getActivityLaunchOptions(v, item); try { intent.send(null, 0, null, null, null, null, options.toBundle()); + if (item != null) { + InstanceId instanceId = new InstanceIdSequence().newInstanceId(); + getStatsLogManager().logger().withItemInfo(item).withInstanceId(instanceId) + .log(LAUNCHER_APP_LAUNCH_PENDING_INTENT); + } return options.onEndCallback; } catch (PendingIntent.CanceledException e) { Toast.makeText(v.getContext(), From 734da5c1eb5e0f868bb2da325128eb278b7e4327 Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Mon, 29 May 2023 21:45:55 -0700 Subject: [PATCH 18/20] Fix invalid outline after widget resizing Fix: 283778989 Test: Manual Change-Id: I8821658a1db333159684562ba79f30fd92291fad --- .../android/launcher3/widget/BaseLauncherAppWidgetHostView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java b/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java index 2742882b1f..580b4f11ea 100644 --- a/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java +++ b/src/com/android/launcher3/widget/BaseLauncherAppWidgetHostView.java @@ -105,6 +105,7 @@ public abstract class BaseLauncherAppWidgetHostView extends NavigableAppWidgetHo mEnforcedRectangle); setOutlineProvider(mCornerRadiusEnforcementOutline); setClipToOutline(true); + invalidateOutline(); } /** Returns the corner radius currently enforced, in pixels. */ From 48465319f6f6badd7fd5cb627d814b9f9d39b22f Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Tue, 30 May 2023 15:01:34 -0700 Subject: [PATCH 19/20] Possibly fix the widget restoration bug The update will always be considered as failed because we always return 0 for all the commits. Test: N/A Bug: 234700507 Change-Id: I33ee8af996cef62dbc14349f9a7dd3cb72836ab6 --- src/com/android/launcher3/util/ContentWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/util/ContentWriter.java b/src/com/android/launcher3/util/ContentWriter.java index 7c5ef4db0c..9910dc2e70 100644 --- a/src/com/android/launcher3/util/ContentWriter.java +++ b/src/com/android/launcher3/util/ContentWriter.java @@ -106,7 +106,7 @@ public class ContentWriter { public int commit() { if (mCommitParams != null) { - mCommitParams.mDbController.update( + return mCommitParams.mDbController.update( Favorites.TABLE_NAME, getValues(mContext), mCommitParams.mWhere, mCommitParams.mSelectionArgs); } From cfbbf8510c42d58336f845f48737b7429e1901a7 Mon Sep 17 00:00:00 2001 From: Anushree Ganjam Date: Tue, 23 May 2023 20:15:45 +0000 Subject: [PATCH 20/20] Add LAUNCHER_APP_LAUNCH_PENDING_INTENT where an app is launched through pending intent. Bug: Bug: 282236269 Test: Manual Flag: NA Change-Id: I6fb15a77f32ce5914f9632f5fb77f340acd3cfda Merged-In: I6fb15a77f32ce5914f9632f5fb77f340acd3cfda --- src/com/android/launcher3/logging/StatsLogManager.java | 3 +++ src/com/android/launcher3/views/ActivityContext.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/com/android/launcher3/logging/StatsLogManager.java b/src/com/android/launcher3/logging/StatsLogManager.java index 15f353827e..17d3302e69 100644 --- a/src/com/android/launcher3/logging/StatsLogManager.java +++ b/src/com/android/launcher3/logging/StatsLogManager.java @@ -642,6 +642,9 @@ public class StatsLogManager implements ResourceBasedOverride { @UiEvent(doc = "User has swiped upwards from the gesture handle to show transient taskbar.") LAUNCHER_TRANSIENT_TASKBAR_SHOW(1331), + + @UiEvent(doc = "App launched through pending intent") + LAUNCHER_APP_LAUNCH_PENDING_INTENT(1394), ; // ADD MORE diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java index 515a2d81a5..4b319e5b61 100644 --- a/src/com/android/launcher3/views/ActivityContext.java +++ b/src/com/android/launcher3/views/ActivityContext.java @@ -20,6 +20,7 @@ import static android.window.SplashScreen.SPLASH_SCREEN_STYLE_SOLID_COLOR; import static com.android.launcher3.LauncherSettings.Animation.DEFAULT_NO_ICON; import static com.android.launcher3.logging.KeyboardStateManager.KeyboardState.HIDE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_KEYBOARD_CLOSED; +import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_PENDING_INTENT; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.model.WidgetsModel.GO_DISABLE_WIDGETS; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; @@ -305,6 +306,11 @@ public interface ActivityContext { ActivityOptionsWrapper options = getActivityLaunchOptions(v, item); try { intent.send(null, 0, null, null, null, null, options.toBundle()); + if (item != null) { + InstanceId instanceId = new InstanceIdSequence().newInstanceId(); + getStatsLogManager().logger().withItemInfo(item).withInstanceId(instanceId) + .log(LAUNCHER_APP_LAUNCH_PENDING_INTENT); + } return options.onEndCallback; } catch (PendingIntent.CanceledException e) { Toast.makeText(v.getContext(),