From daa3150b9cb26ec2cc928f81f5f56eac2660d8c6 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 7 Feb 2022 14:06:35 -0800 Subject: [PATCH] Move All Apps button to the left in RTL. Bug: 205803230 Test: verify LTR force RTL using developer option verify All Apps button is in the left verify All Apps button moves left before fading out Change-Id: I2a5be9b37f471bfaa1a92f6819e04274e4dfb7a1 --- quickstep/src/com/android/launcher3/taskbar/TaskbarView.java | 4 +++- .../com/android/launcher3/taskbar/TaskbarViewController.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index fddd1ed6fb..40c67ffc04 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -32,6 +32,7 @@ import androidx.annotation.Nullable; import com.android.launcher3.BubbleTextView; import com.android.launcher3.Insettable; import com.android.launcher3.R; +import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.model.data.FolderInfo; @@ -214,7 +215,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar } if (mAllAppsButton != null) { - addView(mAllAppsButton); + int index = Utilities.isRtl(getResources()) ? 0 : getChildCount(); + addView(mAllAppsButton, index); } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 778040dbc1..30bdce1a36 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -235,7 +235,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar if (FeatureFlags.ENABLE_ALL_APPS_IN_TASKBAR.get() && i == count - 1) { // Note that there is no All Apps button in the hotseat, this position is only used // as its convenient for animation purposes. - positionInHotseat = mActivity.getDeviceProfile().inv.numShownHotseatIcons; + positionInHotseat = Utilities.isRtl(child.getResources()) + ? -1 + : mActivity.getDeviceProfile().inv.numShownHotseatIcons; setter.setViewAlpha(child, 0, LINEAR); } else if (child.getTag() instanceof ItemInfo) {