Revert "Fix Taskbar Y-Translation with Visible Bottom Sheet"

This reverts commit d82503fc42.

Reason for revert: Introduced crashes

Change-Id: I0956f746e25ccfe655169580fd802d33f99c0652
This commit is contained in:
Sukesh Ram
2024-10-28 17:26:47 +00:00
committed by Android (Google) Code Review
parent d82503fc42
commit 99c442b015
6 changed files with 26 additions and 71 deletions
@@ -183,7 +183,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat(
this::updateNavButtonTranslationY);
private final AnimatedFloat mNavButtonTranslationYForInAppDisplay = new AnimatedFloat(
private final AnimatedFloat mTaskbarNavButtonTranslationYForInAppDisplay = new AnimatedFloat(
this::updateNavButtonTranslationY);
private final AnimatedFloat mTaskbarNavButtonTranslationYForIme = new AnimatedFloat(
this::updateNavButtonTranslationY);
@@ -704,8 +704,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
}
/** Use to set the translationY for the all nav+contextual buttons when in Launcher */
public AnimatedFloat getNavButtonTranslationYForInAppDisplay() {
return mNavButtonTranslationYForInAppDisplay;
public AnimatedFloat getTaskbarNavButtonTranslationYForInAppDisplay() {
return mTaskbarNavButtonTranslationYForInAppDisplay;
}
/** Use to set the dark intensity for the all nav+contextual buttons */
@@ -751,20 +751,18 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
if (mContext.isPhoneButtonNavMode()) {
return;
}
mLastSetNavButtonTranslationY = calculateNavButtonTranslationY();
mNavButtonsView.setTranslationY(mLastSetNavButtonTranslationY);
}
final float normalTranslationY = mTaskbarNavButtonTranslationY.value;
final float imeAdjustmentTranslationY = mTaskbarNavButtonTranslationYForIme.value;
TaskbarUIController uiController = mControllers.uiController;
final float inAppDisplayAdjustmentTranslationY =
(uiController instanceof LauncherTaskbarUIController
&& ((LauncherTaskbarUIController) uiController).shouldUseInAppLayout())
? mTaskbarNavButtonTranslationYForInAppDisplay.value : 0;
/**
* Calculates the translationY of the nav buttons based on the current device state.
*/
private float calculateNavButtonTranslationY() {
float translationY =
mTaskbarNavButtonTranslationY.value + mTaskbarNavButtonTranslationYForIme.value;
if (mControllers.uiController.shouldUseInAppLayout()) {
translationY += mNavButtonTranslationYForInAppDisplay.value;
}
return translationY;
mLastSetNavButtonTranslationY = normalTranslationY
+ imeAdjustmentTranslationY
+ inAppDisplayAdjustmentTranslationY;
mNavButtonsView.setTranslationY(mLastSetNavButtonTranslationY);
}
/**
@@ -1164,7 +1162,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
pw.println(prefix + "\t\tmTaskbarNavButtonTranslationY="
+ mTaskbarNavButtonTranslationY.value);
pw.println(prefix + "\t\tmTaskbarNavButtonTranslationYForInAppDisplay="
+ mNavButtonTranslationYForInAppDisplay.value);
+ mTaskbarNavButtonTranslationYForInAppDisplay.value);
pw.println(prefix + "\t\tmTaskbarNavButtonTranslationYForIme="
+ mTaskbarNavButtonTranslationYForIme.value);
pw.println(prefix + "\t\tmTaskbarNavButtonDarkIntensity="