Merge "Fix incorrect icon alignment on shelf" into pi-dev
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index 3efeb6e..27fa48a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -1635,6 +1635,7 @@
                 mTranslateableViews.get(i).setTranslationX(0);
             }
             invalidateOutline();
+            getEntry().expandedIcon.setScrollX(0);
         }
 
         mMenuRow.resetMenu();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
index ab042d4..2a4a5ad 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ExpandableNotificationRowTest.java
@@ -298,4 +298,13 @@
 
         assertEquals(3, mGroupRow.getNumUniqueChannels());
     }
+
+    @Test
+    public void testIconScrollXAfterTranslationAndReset() throws Exception {
+        mGroupRow.setTranslation(50);
+        assertEquals(50, -mGroupRow.getEntry().expandedIcon.getScrollX());
+
+        mGroupRow.resetTranslation();
+        assertEquals(0, mGroupRow.getEntry().expandedIcon.getScrollX());
+    }
 }