Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fbeac43 authored by shawnlin's avatar shawnlin
Browse files

Fix incorrect icon alignment on shelf

ExpandableNotificationRow set the scrollX of notification icon in shelf while the notification is
swiped, but didn't set it back when reset without animation(ex: screen
off device).

Reset the scrollX of icon in shelf.

Test: runtest systemui
Change-Id: I05a428a7502de1618a7929b71a832c9e945a6aff
Fixes: 77569193
parent b9b0eaff
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1635,6 +1635,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                mTranslateableViews.get(i).setTranslationX(0);
            }
            invalidateOutline();
            getEntry().expandedIcon.setScrollX(0);
        }

        mMenuRow.resetMenu();
+9 −0
Original line number Diff line number Diff line
@@ -298,4 +298,13 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {

        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());
    }
}