[automerge] Revert "Revert "Sync hotseat/taskbar handoff"" 2p: 27f9559203 2p: debdedebed

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17606862

Bug: 223789074
Bug: 223443781
Bug: 202507555
Change-Id: I4c81d223826ba53f18b6e03d603e2a8ffb694f35
This commit is contained in:
Jon Miranda
2022-04-06 17:29:26 +00:00
committed by Presubmit Automerger Backend
3 changed files with 49 additions and 3 deletions
@@ -200,6 +200,16 @@ 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]
@@ -207,9 +217,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
* 1 => fully aligned
*/
public void setLauncherIconAlignment(float alignmentRatio, DeviceProfile launcherDp) {
if (mIconAlignControllerLazy == null) {
mIconAlignControllerLazy = createIconAlignmentController(launcherDp);
}
createIconAlignmentControllerIfNotExists(launcherDp);
mIconAlignControllerLazy.setPlayFraction(alignmentRatio);
if (alignmentRatio <= 0 || alignmentRatio >= 1) {
// Cleanup lazy controller so that it is created again in next animation