Fixed the hotseat placement in RTL mode

Updated logic that computest the hotseat shift.

Fixes: 372014534
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Put device into 3 buttons navigation mode, force RTL.
Hotseat is placed next to the navigation buttons bar.

Change-Id: Ie7b6be11a093ffa4006182bdc0b73018ba799246
This commit is contained in:
mpodolian committed 2024-10-07 10:34:42 -07:00
1 parent 644aad280b
commit 3dcb19f33a
4 files changed
+16 -15

No files matched your search

+4 -6
View File
@@ -69,7 +69,6 @@ import com.android.launcher3.util.CellContentDimensions;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.IconSizeSteps;
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.ResourceHelper;
import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.util.window.WindowManagerProxy;
@@ -2337,16 +2336,15 @@ public class DeviceProfile {
public boolean shouldAdjustHotseatOnBubblesLocationUpdate(Context context) {
return enableBubbleBar()
&& enableBubbleBarInPersistentTaskBar()
&& DisplayController.getNavigationMode(context)
== NavigationMode.THREE_BUTTONS;
&& !DisplayController.getNavigationMode(context).hasGestures;
}
/** Returns hotseat translation X for the bubble bar position. */
public int getHotseatTranslationXForBubbleBar(boolean isNavbarOnRight) {
public int getHotseatTranslationXForBubbleBar(boolean isNavbarOnRight, boolean isRtl) {
if (isNavbarOnRight) {
return 0;
return isRtl ? -navButtonsLayoutWidthPx : 0;
} else {
return navButtonsLayoutWidthPx;
return isRtl ? 0 : navButtonsLayoutWidthPx;
}
}