From f595fc31649d39ce3323a8394cd3aa76dec66d7c Mon Sep 17 00:00:00 2001 From: Sergey Pinkevich Date: Wed, 10 Jan 2024 19:39:59 +0000 Subject: [PATCH] Place app icons in correct place in RTL for Seascape mode The goal for this CL is to show icons for split apps (similar to Landscape mode). The aligning (perfect pixel, aligned to the task bounds) can be done in a separate task Bug: 317072320 Flag: NONE Test: manually Old behavior: https://drive.google.com/file/d/11UQyEB-EhKYu1eisjAW_MnhV-drrT38E/view?usp=sharing (icons are missing in RTL mode) New behavior: https://drive.google.com/file/d/1GrZe6J8zBIoHtP7DzgZnpJiyz2XWujLf/view?usp=sharing Change-Id: I2fe7defd1c668326ab0e0114a4cd9793e66d6175 --- .../touch/SeascapePagedViewHandler.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java index dcbf7d1a12..7077ad985a 100644 --- a/src/com/android/launcher3/touch/SeascapePagedViewHandler.java +++ b/src/com/android/launcher3/touch/SeascapePagedViewHandler.java @@ -285,7 +285,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { primaryIconView.setTranslationX(0); secondaryIconView.setTranslationX(0); if (enableOverviewIconMenu()) { - if (primaryIconView.getLayoutDirection() == LAYOUT_DIRECTION_RTL) { + if (isRtl) { primaryIconView.setTranslationY(groupedTaskViewHeight - primarySnapshotHeight); secondaryIconView.setTranslationY(0); } else { @@ -295,14 +295,25 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler { } else if (splitConfig.initiatedFromSeascape) { // if the split was initiated from seascape, // the task on the right (secondary) is slightly larger - primaryIconView.setTranslationY(-bottomToMidpointOffset - insetOffset - + taskIconHeight); - secondaryIconView.setTranslationY(-bottomToMidpointOffset - insetOffset); + if (isRtl) { + primaryIconView.setTranslationY(bottomToMidpointOffset - insetOffset + + taskIconHeight); + secondaryIconView.setTranslationY(bottomToMidpointOffset - insetOffset); + } else { + primaryIconView.setTranslationY(-bottomToMidpointOffset - insetOffset + + taskIconHeight); + secondaryIconView.setTranslationY(-bottomToMidpointOffset - insetOffset); + } } else { // if not, // the task on the left (primary) is slightly larger - primaryIconView.setTranslationY(-bottomToMidpointOffset + taskIconHeight); - secondaryIconView.setTranslationY(-bottomToMidpointOffset); + if (isRtl) { + primaryIconView.setTranslationY(bottomToMidpointOffset + taskIconHeight); + secondaryIconView.setTranslationY(bottomToMidpointOffset); + } else { + primaryIconView.setTranslationY(-bottomToMidpointOffset + taskIconHeight); + secondaryIconView.setTranslationY(-bottomToMidpointOffset); + } } primaryIconView.setLayoutParams(primaryIconParams);