diff options
Diffstat (limited to 'src/com/android/launcher3/allapps/WorkModeSwitch.java')
-rw-r--r-- | src/com/android/launcher3/allapps/WorkModeSwitch.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/WorkModeSwitch.java b/src/com/android/launcher3/allapps/WorkModeSwitch.java index 144381c9c1..48400b23b9 100644 --- a/src/com/android/launcher3/allapps/WorkModeSwitch.java +++ b/src/com/android/launcher3/allapps/WorkModeSwitch.java @@ -117,12 +117,13 @@ public class WorkModeSwitch extends LinearLayout implements Insettable, protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); View parent = (View) getParent(); - int allAppsLeftRightPadding = mActivityContext.getDeviceProfile().allAppsLeftRightPadding; + boolean isRtl = Utilities.isRtl(getResources()); + Rect allAppsPadding = mActivityContext.getDeviceProfile().allAppsPadding; int size = parent.getWidth() - parent.getPaddingLeft() - parent.getPaddingRight() - - 2 * allAppsLeftRightPadding; + - (allAppsPadding.left + allAppsPadding.right); int tabWidth = getTabWidth(getContext(), size); - int shift = (size - tabWidth) / 2 + allAppsLeftRightPadding; - setTranslationX(Utilities.isRtl(getResources()) ? shift : -shift); + int shift = (size - tabWidth) / 2 + (isRtl ? allAppsPadding.left : allAppsPadding.right); + setTranslationX(isRtl ? shift : -shift); } @Override |