Sync hotseat/taskbar handoff

Bug: 202507555
Test: open/close apps in hotseat/taskbar
Change-Id: Ia5ecff8438f0cf237b39a54b7a78c423c53f9023
This commit is contained in:
Jon Miranda
2022-03-07 14:50:28 -08:00
parent 3c8277d161
commit 4937d79c03
3 changed files with 48 additions and 3 deletions

View File

@@ -191,6 +191,16 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
+ mTaskbarIconTranslationYForStash.value);
}
/**
* 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]
@@ -198,9 +208,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