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
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 4eca048..1e7fd7f 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -69,7 +69,6 @@
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 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;
}
}