Loading quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -483,6 +483,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener ? new float[]{1, mContentScale} : new float[]{mContentScale, 1}; // Pause expensive view updates as they can lead to layer thrashing and skipped frames. mLauncher.pauseExpensiveViewUpdates(); if (mLauncher.isInState(ALL_APPS)) { // All Apps in portrait mode is full screen, so we only animate AllAppsContainerView. final View appsView = mLauncher.getAppsView(); Loading Loading @@ -581,9 +584,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } } // Pause expensive view updates as they can lead to layer thrashing and skipped frames. mLauncher.pauseExpensiveViewUpdates(); endListener = () -> { viewsToAnimate.forEach(view -> { SCALE_PROPERTY.set(view, 1f); Loading quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.quickstep.util; 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; Loading Loading @@ -148,6 +149,9 @@ public class StaggeredWorkspaceAnim { }); } launcher.pauseExpensiveViewUpdates(); mAnimators.addListener(forEndCallback(launcher::resumeExpensiveViewUpdates)); if (animateOverviewScrim) { PendingAnimation pendingAnimation = new PendingAnimation(DURATION_MS); launcher.getWorkspace().getStateTransitionAnimation() Loading src/com/android/launcher3/Launcher.java +14 −1 Original line number Diff line number Diff line Loading @@ -3244,11 +3244,24 @@ public class Launcher extends StatefulActivity<LauncherState> public void pauseExpensiveViewUpdates() { // Pause page indicator animations as they lead to layer trashing. getWorkspace().getPageIndicator().pauseAnimations(); getWorkspace().mapOverItems((info, view) -> { if (view instanceof LauncherAppWidgetHostView) { ((LauncherAppWidgetHostView) view).beginDeferringUpdates(); } return false; // Return false to continue iterating through all the items. }); } /** Resumes view updates at the end of the app launch animation. */ public void resumeExpensiveViewUpdates() { getWorkspace().getPageIndicator().skipAnimationsToEnd(); } getWorkspace().mapOverItems((info, view) -> { if (view instanceof LauncherAppWidgetHostView) { ((LauncherAppWidgetHostView) view).endDeferringUpdates(); } return false; // Return false to continue iterating through all the items. }); } } src/com/android/launcher3/Workspace.java +6 −2 Original line number Diff line number Diff line Loading @@ -3265,7 +3265,11 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> } } private View mapOverCellLayout(CellLayout layout, ItemOperator op) { /** * Perform {param operator} over all the items in a given {param layout}. * @return The first item that satisfies the operator or null. */ public View mapOverCellLayout(CellLayout layout, ItemOperator operator) { // TODO(b/128460496) Potential race condition where layout is not yet loaded if (layout == null) { return null; Loading @@ -3275,7 +3279,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> final int itemCount = container.getChildCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { View item = container.getChildAt(itemIdx); if (op.evaluate((ItemInfo) item.getTag(), item)) { if (operator.evaluate((ItemInfo) item.getTag(), item)) { return item; } } Loading Loading
quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -483,6 +483,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener ? new float[]{1, mContentScale} : new float[]{mContentScale, 1}; // Pause expensive view updates as they can lead to layer thrashing and skipped frames. mLauncher.pauseExpensiveViewUpdates(); if (mLauncher.isInState(ALL_APPS)) { // All Apps in portrait mode is full screen, so we only animate AllAppsContainerView. final View appsView = mLauncher.getAppsView(); Loading Loading @@ -581,9 +584,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener } } // Pause expensive view updates as they can lead to layer thrashing and skipped frames. mLauncher.pauseExpensiveViewUpdates(); endListener = () -> { viewsToAnimate.forEach(view -> { SCALE_PROPERTY.set(view, 1f); Loading
quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +4 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.quickstep.util; 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; Loading Loading @@ -148,6 +149,9 @@ public class StaggeredWorkspaceAnim { }); } launcher.pauseExpensiveViewUpdates(); mAnimators.addListener(forEndCallback(launcher::resumeExpensiveViewUpdates)); if (animateOverviewScrim) { PendingAnimation pendingAnimation = new PendingAnimation(DURATION_MS); launcher.getWorkspace().getStateTransitionAnimation() Loading
src/com/android/launcher3/Launcher.java +14 −1 Original line number Diff line number Diff line Loading @@ -3244,11 +3244,24 @@ public class Launcher extends StatefulActivity<LauncherState> public void pauseExpensiveViewUpdates() { // Pause page indicator animations as they lead to layer trashing. getWorkspace().getPageIndicator().pauseAnimations(); getWorkspace().mapOverItems((info, view) -> { if (view instanceof LauncherAppWidgetHostView) { ((LauncherAppWidgetHostView) view).beginDeferringUpdates(); } return false; // Return false to continue iterating through all the items. }); } /** Resumes view updates at the end of the app launch animation. */ public void resumeExpensiveViewUpdates() { getWorkspace().getPageIndicator().skipAnimationsToEnd(); } getWorkspace().mapOverItems((info, view) -> { if (view instanceof LauncherAppWidgetHostView) { ((LauncherAppWidgetHostView) view).endDeferringUpdates(); } return false; // Return false to continue iterating through all the items. }); } }
src/com/android/launcher3/Workspace.java +6 −2 Original line number Diff line number Diff line Loading @@ -3265,7 +3265,11 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> } } private View mapOverCellLayout(CellLayout layout, ItemOperator op) { /** * Perform {param operator} over all the items in a given {param layout}. * @return The first item that satisfies the operator or null. */ public View mapOverCellLayout(CellLayout layout, ItemOperator operator) { // TODO(b/128460496) Potential race condition where layout is not yet loaded if (layout == null) { return null; Loading @@ -3275,7 +3279,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T> final int itemCount = container.getChildCount(); for (int itemIdx = 0; itemIdx < itemCount; itemIdx++) { View item = container.getChildAt(itemIdx); if (op.evaluate((ItemInfo) item.getTag(), item)) { if (operator.evaluate((ItemInfo) item.getTag(), item)) { return item; } } Loading