diff options
author | Vinit Nayak <peanutbutter@google.com> | 2021-10-12 21:41:13 -0700 |
---|---|---|
committer | Vinit Nayak <peanutbutter@google.com> | 2021-10-14 18:32:35 -0700 |
commit | 74b25ca2663a6098a4ee1223e293f2dc17aadf07 (patch) | |
tree | d12b7a6c56d98254963cf49e20097d003bfe7507 /quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java | |
parent | 60c64adeed0581d71e8add63fc251ded6df2a4cc (diff) |
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
Diffstat (limited to 'quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java')
-rw-r--r-- | quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index ed09fa5984..ff04799c92 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -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. */ |