mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user