Refactored hotseat translation X logic
Made retrieval of the hotseat translation X easier to use. Test: Manual. Set the navigation mode to 3-button. Moved the bubble bar from one side to the other. Switched the navigation mode to gestures. Moved the bubble bar from one side to the other again. Bug: 373422448 Flag: EXEMPT refactoring Change-Id: Ie69f1ecf178244008e5c752882c4b91a30928756
This commit is contained in:
1 parent
9c5d8a2059
commit
1d4e75c777
5 files changed
+27
-29
No files matched your search
@@ -2355,18 +2355,23 @@ public class DeviceProfile {
|
||||
/**
|
||||
* Returns whether Taskbar and Hotseat should adjust horizontally on bubble bar location update.
|
||||
*/
|
||||
public boolean shouldAdjustHotseatOnBubblesLocationUpdate(Context context) {
|
||||
public boolean shouldAdjustHotseatOnNavBarLocationUpdate(Context context) {
|
||||
return enableBubbleBar()
|
||||
&& enableBubbleBarInPersistentTaskBar()
|
||||
&& !DisplayController.getNavigationMode(context).hasGestures;
|
||||
}
|
||||
|
||||
/** Returns hotseat translation X for the bubble bar position. */
|
||||
public int getHotseatTranslationXForBubbleBar(boolean isNavbarOnRight, boolean isRtl) {
|
||||
if (isNavbarOnRight) {
|
||||
return isRtl ? -navButtonsLayoutWidthPx : 0;
|
||||
public int getHotseatTranslationXForNavBar(Context context, boolean isBubblesOnLeft) {
|
||||
if (shouldAdjustHotseatOnNavBarLocationUpdate(context)) {
|
||||
boolean isRtl = Utilities.isRtl(context.getResources());
|
||||
if (isBubblesOnLeft) {
|
||||
return isRtl ? -navButtonsLayoutWidthPx : 0;
|
||||
} else {
|
||||
return isRtl ? 0 : navButtonsLayoutWidthPx;
|
||||
}
|
||||
} else {
|
||||
return isRtl ? 0 : navButtonsLayoutWidthPx;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user