diff --git a/quickstep/res/layout/taskbar.xml b/quickstep/res/layout/taskbar.xml
index dfa17d6..c0e0862 100644
--- a/quickstep/res/layout/taskbar.xml
+++ b/quickstep/res/layout/taskbar.xml
@@ -36,18 +36,27 @@
         android:layout_height="wrap_content"
         android:layout_gravity="bottom" >
 
+        <FrameLayout
+            android:id="@+id/start_contextual_buttons"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
+            android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
+            android:gravity="center_vertical"
+            android:layout_gravity="start"/>
+
         <LinearLayout
-            android:id="@+id/start_nav_buttons"
+            android:id="@+id/end_nav_buttons"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             android:orientation="horizontal"
             android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
             android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
             android:gravity="center_vertical"
-            android:layout_gravity="start"/>
+            android:layout_gravity="end"/>
 
         <FrameLayout
-            android:id="@+id/end_nav_buttons"
+            android:id="@+id/end_contextual_buttons"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
index 1edeba0..357dc7b 100644
--- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java
@@ -79,8 +79,10 @@
 
     private final TaskbarActivityContext mContext;
     private final FrameLayout mNavButtonsView;
-    private final ViewGroup mStartContainer;
-    private final ViewGroup mEndContainer;
+    private final ViewGroup mNavButtonContainer;
+    // Used for IME+A11Y buttons
+    private final ViewGroup mEndContextualContainer;
+    private final ViewGroup mStartContextualContainer;
 
     // Initialized in init.
     private TaskbarControllers mControllers;
@@ -91,8 +93,9 @@
     public NavbarButtonsViewController(TaskbarActivityContext context, FrameLayout navButtonsView) {
         mContext = context;
         mNavButtonsView = navButtonsView;
-        mStartContainer = mNavButtonsView.findViewById(R.id.start_nav_buttons);
-        mEndContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
+        mNavButtonContainer = mNavButtonsView.findViewById(R.id.end_nav_buttons);
+        mEndContextualContainer = mNavButtonsView.findViewById(R.id.end_contextual_buttons);
+        mStartContextualContainer = mNavButtonsView.findViewById(R.id.start_contextual_buttons);
     }
 
     /**
@@ -114,21 +117,22 @@
 
         // IME switcher
         View imeSwitcherButton = addButton(R.drawable.ic_ime_switcher, BUTTON_IME_SWITCH,
-                mEndContainer, mControllers.navButtonController, R.id.ime_switcher);
+                mEndContextualContainer, mControllers.navButtonController, R.id.ime_switcher);
         mPropertyHolders.add(new StatePropertyHolder(imeSwitcherButton,
                 flags -> ((flags & MASK_IME_SWITCHER_VISIBLE) == MASK_IME_SWITCHER_VISIBLE)
                         && ((flags & FLAG_ROTATION_BUTTON_VISIBLE) == 0)
                         && ((flags & FLAG_A11Y_VISIBLE) == 0)));
 
-        mBackButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
-                mStartContainer, mControllers.navButtonController, R.id.back);
+        View imeDownButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
+                mStartContextualContainer, mControllers.navButtonController, R.id.back);
+        imeDownButton.setRotation(Utilities.isRtl(mContext.getResources()) ? 90 : -90);
         // Rotate when Ime visible
-        mPropertyHolders.add(new StatePropertyHolder(mBackButton,
-                flags -> (flags & FLAG_IME_VISIBLE) == 0, View.ROTATION, 0,
-                Utilities.isRtl(mContext.getResources()) ? 90 : -90));
+        mPropertyHolders.add(new StatePropertyHolder(imeDownButton,
+                flags -> (flags & FLAG_IME_VISIBLE) != 0));
 
         if (mContext.isThreeButtonNav()) {
-            initButtons(mStartContainer, mEndContainer, mControllers.navButtonController);
+            initButtons(mNavButtonContainer, mEndContextualContainer,
+                    mControllers.navButtonController);
 
             // Animate taskbar background when IME shows
             mPropertyHolders.add(new StatePropertyHolder(
@@ -142,21 +146,18 @@
 
             // Rotation button
             RotationButton rotationButton = new RotationButtonImpl(
-                    addButton(mEndContainer, R.id.rotate_suggestion));
+                    addButton(mEndContextualContainer, R.id.rotate_suggestion));
             rotationButton.hide();
             mControllers.rotationButtonController.setRotationButton(rotationButton);
         } else {
             mControllers.rotationButtonController.setRotationButton(new RotationButton() {});
-            // Show when IME is visible
-            mPropertyHolders.add(new StatePropertyHolder(mBackButton,
-                    flags -> (flags & FLAG_IME_VISIBLE) != 0));
         }
 
         applyState();
         mPropertyHolders.forEach(StatePropertyHolder::endAnimation);
     }
 
-    private void initButtons(ViewGroup startContainer, ViewGroup endContainer,
+    private void initButtons(ViewGroup navContainer, ViewGroup endContainer,
             TaskbarNavButtonController navButtonController) {
 
         // Hide when keyguard is showing, show when bouncer is showing
@@ -164,14 +165,19 @@
                 flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 ||
                         (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
 
+        mBackButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
+                mNavButtonContainer, mControllers.navButtonController, R.id.back);
+        mPropertyHolders.add(new StatePropertyHolder(mBackButton,
+                flags -> (flags & FLAG_IME_VISIBLE) == 0));
+
         // home and recents buttons
-        View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, startContainer,
+        View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, navContainer,
                 navButtonController, R.id.home);
         mPropertyHolders.add(new StatePropertyHolder(homeButton,
                 flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
                         (flags & FLAG_KEYGUARD_VISIBLE) == 0));
         View recentsButton = addButton(R.drawable.ic_sysbar_recent, BUTTON_RECENTS,
-                startContainer, navButtonController, R.id.recent_apps);
+                navContainer, navButtonController, R.id.recent_apps);
         mPropertyHolders.add(new StatePropertyHolder(recentsButton,
                 flags -> (flags & FLAG_IME_VISIBLE) == 0 &&
                         (flags & FLAG_KEYGUARD_VISIBLE) == 0));
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
index 820d40a..e020e04 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
@@ -194,24 +194,30 @@
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
         int count = getChildCount();
         int spaceNeeded = count * (mItemMarginLeftRight * 2 + mIconTouchSize);
-        int iconStart = (right - left - spaceNeeded) / 2;
-        int startOffset = ApiWrapper.getHotseatStartOffset(getContext());
-        if (startOffset > iconStart) {
-            int diff = startOffset - iconStart;
-            iconStart = isLayoutRtl() ? (iconStart - diff) : iconStart + diff;
+        int navSpaceNeeded = ApiWrapper.getHotseatEndOffset(getContext());
+        boolean layoutRtl = isLayoutRtl();
+        int iconEnd = right - (right - left - spaceNeeded) / 2;
+        boolean needMoreSpaceForNav = layoutRtl ?
+                navSpaceNeeded > (iconEnd - spaceNeeded) :
+                iconEnd > (right - navSpaceNeeded);
+        if (needMoreSpaceForNav) {
+            int offset = layoutRtl ?
+                    navSpaceNeeded - (iconEnd - spaceNeeded) :
+                    (right - navSpaceNeeded) - iconEnd;
+            iconEnd += offset;
         }
         // Layout the children
-        mIconLayoutBounds.left = iconStart;
+        mIconLayoutBounds.right = iconEnd;
         mIconLayoutBounds.top = (bottom - top - mIconTouchSize) / 2;
         mIconLayoutBounds.bottom = mIconLayoutBounds.top + mIconTouchSize;
-        for (int i = 0; i < count; i++) {
-            View child = getChildAt(i);
-            iconStart += mItemMarginLeftRight;
-            int iconEnd = iconStart + mIconTouchSize;
+        for (int i = count; i > 0; i--) {
+            View child = getChildAt(i - 1);
+            iconEnd -= mItemMarginLeftRight;
+            int iconStart = iconEnd - mIconTouchSize;
             child.layout(iconStart, mIconLayoutBounds.top, iconEnd, mIconLayoutBounds.bottom);
-            iconStart = iconEnd + mItemMarginLeftRight;
+            iconEnd = iconStart - mItemMarginLeftRight;
         }
-        mIconLayoutBounds.right = iconStart;
+        mIconLayoutBounds.left = iconEnd;
     }
 
     @Override
diff --git a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
index a595f54..85943b6 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/ApiWrapper.java
@@ -44,9 +44,9 @@
     }
 
     /**
-     * Returns the minimum space that should be left empty at the start of hotseat
+     * Returns the minimum space that should be left empty at the end of hotseat
      */
-    public static int getHotseatStartOffset(Context context) {
+    public static int getHotseatEndOffset(Context context) {
         if (SysUINavigationMode.INSTANCE.get(context).getMode() == Mode.THREE_BUTTONS) {
             Resources res = context.getResources();
             return 2 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_spacing)
