summaryrefslogtreecommitdiff
path: root/quickstep/src
diff options
context:
space:
mode:
authorAlex Chau <alexchau@google.com>2022-05-26 09:24:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-05-26 09:24:23 +0000
commit56e367b744e38001af170f488192546054b3571e (patch)
tree64459557c77ef87f551a9f48ba77cfcbd7a231a1 /quickstep/src
parentc907fd0a17ed84903aafda62ee02bc9463e349a4 (diff)
parente2e1509d55e6b51145edca13e49767a1457fe3b2 (diff)
downloadLauncher3-56e367b744e38001af170f488192546054b3571e.tar.gz
Merge "Fix taskbar icon flicker and jump when transforming to hotseat" into tm-dev
Diffstat (limited to 'quickstep/src')
-rw-r--r--quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java12
-rw-r--r--quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java14
2 files changed, 6 insertions, 20 deletions
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 052c695ff4..dc0ef27ba1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -30,7 +30,6 @@ import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseQuickstepLauncher;
-import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.statemanager.StateManager;
@@ -407,18 +406,13 @@ import java.util.function.Supplier;
boolean firstFrameVisChanged = (taskbarWillBeVisible && Float.compare(currentValue, 1) != 0)
|| (!taskbarWillBeVisible && Float.compare(currentValue, 0) != 0);
+ updateIconAlignment(alignment);
+
// Sync the first frame where we swap taskbar and hotseat.
if (firstFrameVisChanged && mCanSyncViews && !Utilities.IS_RUNNING_IN_TEST_HARNESS) {
- DeviceProfile dp = mLauncher.getDeviceProfile();
-
- // Do all the heavy work before the sync.
- mControllers.taskbarViewController.createIconAlignmentControllerIfNotExists(dp);
-
ViewRootSync.synchronizeNextDraw(mLauncher.getHotseat(),
mControllers.taskbarActivityContext.getDragLayer(),
- () -> updateIconAlignment(alignment));
- } else {
- updateIconAlignment(alignment);
+ () -> {});
}
}
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
index 3dd7932a9a..3562f5bc3c 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -205,23 +205,15 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
}
/**
- * Creates the icon alignment controller if it does not already exist.
- * @param launcherDp Launcher device profile.
- */
- public void createIconAlignmentControllerIfNotExists(DeviceProfile launcherDp) {
- if (mIconAlignControllerLazy == null) {
- mIconAlignControllerLazy = createIconAlignmentController(launcherDp);
- }
- }
-
- /**
* Sets the taskbar icon alignment relative to Launcher hotseat icons
* @param alignmentRatio [0, 1]
* 0 => not aligned
* 1 => fully aligned
*/
public void setLauncherIconAlignment(float alignmentRatio, DeviceProfile launcherDp) {
- createIconAlignmentControllerIfNotExists(launcherDp);
+ if (mIconAlignControllerLazy == null) {
+ mIconAlignControllerLazy = createIconAlignmentController(launcherDp);
+ }
mIconAlignControllerLazy.setPlayFraction(alignmentRatio);
if (alignmentRatio <= 0 || alignmentRatio >= 1) {
// Cleanup lazy controller so that it is created again in next animation