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
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index fddd1ed..40c67ff 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -32,6 +32,7 @@
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 @@
}
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 778040d..30bdce1 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java
@@ -235,7 +235,9 @@
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) {