Align 3 button nav with hotseat

* Animate translationY alongside icons
* When device rotates on home, update
translationY
* Add padding to contextual buttons to center
it

Bug: 189807374
Change-Id: I149ef25df570fb1fd385f1da960c827105ff975d
This commit is contained in:
Vinit Nayak
2021-10-12 21:41:13 -07:00
parent 60c64adeed
commit 74b25ca266
7 changed files with 48 additions and 15 deletions

View File

@@ -60,6 +60,7 @@ public class TaskbarViewController {
this::updateTranslationY);
private final AnimatedFloat mTaskbarIconTranslationYForStash = new AnimatedFloat(
this::updateTranslationY);
private AnimatedFloat mTaskbarNavButtonTranslationY;
private final TaskbarModelCallbacks mModelCallbacks;
@@ -88,6 +89,8 @@ public class TaskbarViewController {
mModelCallbacks.init(controllers);
LauncherAppState.getInstance(mActivity).getModel().addCallbacksAndLoad(mModelCallbacks);
mTaskbarNavButtonTranslationY =
controllers.navbarButtonsViewController.getTaskbarNavButtonTranslationY();
}
public void onDestroy() {
@@ -214,6 +217,7 @@ public class TaskbarViewController {
int offsetY = launcherDp.getTaskbarOffsetY();
setter.setFloat(mTaskbarIconTranslationYForHome, VALUE, -offsetY, LINEAR);
setter.setFloat(mTaskbarNavButtonTranslationY, VALUE, -offsetY, LINEAR);
int collapsedHeight = mActivity.getDefaultTaskbarWindowHeight();
int expandedHeight = Math.max(collapsedHeight,
@@ -238,6 +242,14 @@ public class TaskbarViewController {
return controller;
}
public void onRotationChanged(DeviceProfile deviceProfile) {
if (areIconsVisible()) {
// We only translate on rotation when on home
return;
}
mTaskbarNavButtonTranslationY.updateValue(-deviceProfile.getTaskbarOffsetY());
}
/**
* Callbacks for {@link TaskbarView} to interact with its controller.
*/