Loading quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java +7 −4 Original line number Diff line number Diff line Loading @@ -68,10 +68,13 @@ public class AllAppsState extends LauncherState { @Override public void onBackInvoked(Launcher launcher) { // In predictive back swipe, onBackInvoked() will be called after onBackStarted(). // Because the 2nd InteractionJankMonitor.begin() will be ignore within timeout, it's safe // to call InteractionJankMonitorWrapper.begin here. InteractionJankMonitorWrapper.begin(launcher.getAppsView(), Cuj.CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK); // In 3 button mode, onBackStarted() is not called but onBackInvoked() will be called. // Thus In onBackInvoked(), we should only begin instrumenting if we didn't call // onBackStarted() to start instrumenting CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK. if (!InteractionJankMonitorWrapper.isInstrumenting(Cuj.CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK)) { InteractionJankMonitorWrapper.begin( launcher.getAppsView(), Cuj.CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK); } super.onBackInvoked(launcher); } Loading src/com/android/launcher3/Launcher.java +5 −1 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ public class Launcher extends StatefulActivity<LauncherState> @Override public void onBackCancelled() { mStateManager.getState().onBackCancelled(Launcher.this); Launcher.this.onBackCancelled(); } }; } Loading Loading @@ -2086,6 +2086,10 @@ public class Launcher extends StatefulActivity<LauncherState> mStateManager.getState().onBackInvoked(this); } protected void onBackCancelled() { mStateManager.getState().onBackCancelled(this); } protected void onScreenOnChanged(boolean isOn) { // Reset AllApps to its initial state only if we are not in the middle of // processing a multi-step drop Loading src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +13 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.pm.UserCache; import com.android.launcher3.recyclerview.AllAppsRecyclerViewPool; import com.android.launcher3.util.ItemInfoMatcher; import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.BaseDragLayer; Loading Loading @@ -1366,6 +1367,18 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> invalidateHeader(); } /** * Set {@link Animator.AnimatorListener} on {@link mAllAppsTransitionController} to observe * animation of backing out of all apps search view to all apps view. */ public void setAllAppsSearchBackAnimatorListener(Animator.AnimatorListener listener) { Preconditions.assertNotNull(mAllAppsTransitionController); if (mAllAppsTransitionController == null) { return; } mAllAppsTransitionController.setAllAppsSearchBackAnimationListener(listener); } public void setScrimView(ScrimView scrimView) { mScrimView = scrimView; } Loading src/com/android/launcher3/allapps/AllAppsTransitionController.java +21 −4 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.view.View; import android.view.animation.Interpolator; import androidx.annotation.FloatRange; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; Loading Loading @@ -167,6 +168,8 @@ public class AllAppsTransitionController private final AnimatedFloat mAllAppScale = new AnimatedFloat(this::onScaleProgressChanged); private final int mNavScrimFlag; @Nullable private Animator.AnimatorListener mAllAppsSearchBackAnimationListener; private boolean mIsVerticalLayout; // Animation in this class is controlled by a single variable {@link mProgress}. Loading Loading @@ -312,11 +315,25 @@ public class AllAppsTransitionController } } /** Animate all apps view to 1f scale. */ /** Set {@link Animator.AnimatorListener} for scaling all apps scale to 1 animation. */ public void setAllAppsSearchBackAnimationListener(Animator.AnimatorListener listener) { mAllAppsSearchBackAnimationListener = listener; } /** * Animate all apps view to 1f scale. This is called when backing (exiting) from all apps * search view to all apps view. */ public void animateAllAppsToNoScale() { mAllAppScale.animateToValue(1f) .setDuration(REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS) .start(); if (mAllAppScale.isAnimating()) { return; } Animator animator = mAllAppScale.animateToValue(1f) .setDuration(REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS); if (mAllAppsSearchBackAnimationListener != null) { animator.addListener(mAllAppsSearchBackAnimationListener); } animator.start(); } /** Loading Loading
quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java +7 −4 Original line number Diff line number Diff line Loading @@ -68,10 +68,13 @@ public class AllAppsState extends LauncherState { @Override public void onBackInvoked(Launcher launcher) { // In predictive back swipe, onBackInvoked() will be called after onBackStarted(). // Because the 2nd InteractionJankMonitor.begin() will be ignore within timeout, it's safe // to call InteractionJankMonitorWrapper.begin here. InteractionJankMonitorWrapper.begin(launcher.getAppsView(), Cuj.CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK); // In 3 button mode, onBackStarted() is not called but onBackInvoked() will be called. // Thus In onBackInvoked(), we should only begin instrumenting if we didn't call // onBackStarted() to start instrumenting CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK. if (!InteractionJankMonitorWrapper.isInstrumenting(Cuj.CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK)) { InteractionJankMonitorWrapper.begin( launcher.getAppsView(), Cuj.CUJ_LAUNCHER_CLOSE_ALL_APPS_BACK); } super.onBackInvoked(launcher); } Loading
src/com/android/launcher3/Launcher.java +5 −1 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ public class Launcher extends StatefulActivity<LauncherState> @Override public void onBackCancelled() { mStateManager.getState().onBackCancelled(Launcher.this); Launcher.this.onBackCancelled(); } }; } Loading Loading @@ -2086,6 +2086,10 @@ public class Launcher extends StatefulActivity<LauncherState> mStateManager.getState().onBackInvoked(this); } protected void onBackCancelled() { mStateManager.getState().onBackCancelled(this); } protected void onScreenOnChanged(boolean isOn) { // Reset AllApps to its initial state only if we are not in the middle of // processing a multi-step drop Loading
src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +13 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.pm.UserCache; import com.android.launcher3.recyclerview.AllAppsRecyclerViewPool; import com.android.launcher3.util.ItemInfoMatcher; import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.BaseDragLayer; Loading Loading @@ -1366,6 +1367,18 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext> invalidateHeader(); } /** * Set {@link Animator.AnimatorListener} on {@link mAllAppsTransitionController} to observe * animation of backing out of all apps search view to all apps view. */ public void setAllAppsSearchBackAnimatorListener(Animator.AnimatorListener listener) { Preconditions.assertNotNull(mAllAppsTransitionController); if (mAllAppsTransitionController == null) { return; } mAllAppsTransitionController.setAllAppsSearchBackAnimationListener(listener); } public void setScrimView(ScrimView scrimView) { mScrimView = scrimView; } Loading
src/com/android/launcher3/allapps/AllAppsTransitionController.java +21 −4 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import android.view.View; import android.view.animation.Interpolator; import androidx.annotation.FloatRange; import androidx.annotation.Nullable; import com.android.app.animation.Interpolators; import com.android.launcher3.DeviceProfile; Loading Loading @@ -167,6 +168,8 @@ public class AllAppsTransitionController private final AnimatedFloat mAllAppScale = new AnimatedFloat(this::onScaleProgressChanged); private final int mNavScrimFlag; @Nullable private Animator.AnimatorListener mAllAppsSearchBackAnimationListener; private boolean mIsVerticalLayout; // Animation in this class is controlled by a single variable {@link mProgress}. Loading Loading @@ -312,11 +315,25 @@ public class AllAppsTransitionController } } /** Animate all apps view to 1f scale. */ /** Set {@link Animator.AnimatorListener} for scaling all apps scale to 1 animation. */ public void setAllAppsSearchBackAnimationListener(Animator.AnimatorListener listener) { mAllAppsSearchBackAnimationListener = listener; } /** * Animate all apps view to 1f scale. This is called when backing (exiting) from all apps * search view to all apps view. */ public void animateAllAppsToNoScale() { mAllAppScale.animateToValue(1f) .setDuration(REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS) .start(); if (mAllAppScale.isAnimating()) { return; } Animator animator = mAllAppScale.animateToValue(1f) .setDuration(REVERT_SWIPE_ALL_APPS_TO_HOME_ANIMATION_DURATION_MS); if (mAllAppsSearchBackAnimationListener != null) { animator.addListener(mAllAppsSearchBackAnimationListener); } animator.start(); } /** Loading