Add method to pause expensive view updates during the app launch aimation
Fixes: 220922269
Test: Manual
Change-Id: I39066f575c0ddfc4868ab9e27149e2bd9492b39c
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 8fb2f53..5c5aee5 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3192,4 +3192,15 @@
public ArrowPopup<?> getOptionsPopup() {
return findViewById(R.id.popup_container);
}
+
+ /** Pauses view updates that should not be run during the app launch animation. */
+ public void pauseExpensiveViewUpdates() {
+ // Pause page indicator animations as they lead to layer trashing.
+ getWorkspace().getPageIndicator().pauseAnimations();
+ }
+
+ /** Resumes view updates at the end of the app launch animation. */
+ public void resumeExpensiveViewUpdates() {
+ getWorkspace().getPageIndicator().skipAnimationsToEnd();
+ }
}