Merge "Sync hotseat/taskbar handoff" into tm-dev

This commit is contained in:
TreeHugger Robot
2022-03-10 09:22:21 +00:00
committed by Android (Google) Code Review
3 changed files with 49 additions and 3 deletions

View File

@@ -182,6 +182,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]
@@ -189,9 +199,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